resolving gitlab

This commit is contained in:
Kevin G Christiano 2020-05-01 16:47:45 -04:00
parent 35531a2f9b
commit c8155a57db
8 changed files with 29 additions and 51 deletions

View File

@ -2045,7 +2045,6 @@
D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */,
01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */,
0A9D09212433796500D2E6C0 /* CarouselIndicatorModel.swift in Sources */,
D28A838323CCBD3F00DFE4FC /* CircleProgressModel.swift in Sources */,
EA5124FF2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift in Sources */,
D28A838323CCBD3F00DFE4FC /* WheelModel.swift in Sources */,
D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */,

View File

@ -20,8 +20,8 @@ open class Arrow: View {
return model as? ArrowModel
}
public var direction: Direction {
get { return Direction(rawValue: degrees) ?? .right}
public var direction: ArrowModel.Direction {
get { return ArrowModel.Direction(rawValue: degrees) ?? .right}
set { degrees = newValue.rawValue }
}
@ -54,23 +54,7 @@ open class Arrow: View {
get { return arrowModel?.lineWidth ?? 1 }
set { arrowModel?.lineWidth = newValue }
}
//--------------------------------------------------
// MARK: - Enum
//--------------------------------------------------
/// Conveniece for readability of arrow pointing direction.
public enum Direction: Float {
case right = 0
case upperRight = 45
case up = 90
case upperLeft = 135
case left = 180
case bottomLeft = 225
case down = 270
case bottomRight = 315
}
//--------------------------------------------------
// MARK: - Constraints
//--------------------------------------------------

View File

@ -28,6 +28,22 @@ open class ArrowModel: MoleculeModelProtocol {
public var width: CGFloat = 12
public var enabled: Bool = true
//--------------------------------------------------
// MARK: - Enum
//--------------------------------------------------
/// Conveniece for readability of arrow pointing direction.
public enum Direction: Float {
case right = 0
case upperRight = 45
case up = 90
case upperLeft = 135
case left = 180
case bottomLeft = 225
case down = 270
case bottomRight = 315
}
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------

View File

@ -45,5 +45,6 @@ open class BarsCarouselIndicatorModel: CarouselIndicatorModel {
public override func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(currentIndicatorColor, forKey: .currentIndicatorColor)
try super.encode(to: encoder)
}
}

View File

@ -147,6 +147,8 @@ open class BarsIndicatorView: CarouselIndicator {
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
guard newIndex < totalCount else { return }
guard !barReferences.isEmpty else {
generateBars()
return

View File

@ -29,7 +29,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
}
/// Set this closure to perform an action when a different indicator was selected.
/// Passes through oldInde and newIndex, respectively.
/// Passes through oldIndex and newIndex, respectively.
public var indicatorTouchAction: ((CarouselPageControlProtocol) -> ())?
open override var isEnabled: Bool {
@ -60,7 +60,6 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
/// Holds the total number of pages displayed by the carousel.
/// Updating this property will potentially update the UI.
/// The maxmum count of pages before the indicatorView forces a Numeric Indicator in place of Bar.
public var numberOfPages: Int {
get { return carouselIndicatorModel?.numberOfPages ?? 0 }
set (newTotal) {
@ -106,16 +105,11 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
// MARK: - Lifecycle
//--------------------------------------------------
public override func initialSetup() {
super.initialSetup()
isAccessibilityElement = true
accessibilityTraits = .adjustable
}
open override func setupView() {
super.setupView()
isAccessibilityElement = true
accessibilityTraits = .adjustable
setupGestures()
}
@ -192,9 +186,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? CarouselIndicatorModel else { return }
indicatorColor = model.indicatorColor.uiColor
disabledIndicatorColor = model.disabledIndicatorColor.uiColor
currentIndex = model.currentIndex
isEnabled = model.enabled

View File

@ -127,7 +127,7 @@ open class Carousel: View {
collectionView.backgroundColor = backgroundColor
collectionView.layer.borderColor = backgroundColor?.cgColor
collectionView.layer.borderWidth = carouselModel.border! ? 1 : 0
collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0
backgroundColor = .white
registerCells(with: carouselModel, delegateObject: delegateObject)
@ -178,16 +178,9 @@ open class Carousel: View {
// Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell).
loop = true
if let last = newMolecules.last {
molecules?.insert(last, at: 0)
}
molecules?.insert(newMolecules.last!, at: 0)
molecules?.insert(newMolecules[(newMolecules.count - 2)], at: 0)
if let first = newMolecules.first {
molecules?.append(first)
}
molecules?.append(newMolecules.first!)
molecules?.append(newMolecules[1])
}

View File

@ -13,7 +13,6 @@ open class ImageView: UIImageView, ModelMoleculeViewProtocol {
// MARK: - Properties
//--------------------------------------------------
open var json: [AnyHashable: Any]?
open var model: MoleculeModelProtocol?
private var initialSetupPerformed = false
@ -96,14 +95,6 @@ extension ImageView: MVMCoreViewProtocol {
// MARK:- MVMCoreUIMoleculeViewProtocol
extension ImageView: MVMCoreUIMoleculeViewProtocol {
open func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
self.json = json
if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) {
backgroundColor = UIColor.mfGet(forHex: backgroundColorString)
}
}
open func reset() {
backgroundColor = .clear
}