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 */, D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */,
01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */, 01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */,
0A9D09212433796500D2E6C0 /* CarouselIndicatorModel.swift in Sources */, 0A9D09212433796500D2E6C0 /* CarouselIndicatorModel.swift in Sources */,
D28A838323CCBD3F00DFE4FC /* CircleProgressModel.swift in Sources */,
EA5124FF2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift in Sources */, EA5124FF2436018E0051A3A4 /* BGImageHeadlineBodyButtonModel.swift in Sources */,
D28A838323CCBD3F00DFE4FC /* WheelModel.swift in Sources */, D28A838323CCBD3F00DFE4FC /* WheelModel.swift in Sources */,
D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */, D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */,

View File

@ -20,8 +20,8 @@ open class Arrow: View {
return model as? ArrowModel return model as? ArrowModel
} }
public var direction: Direction { public var direction: ArrowModel.Direction {
get { return Direction(rawValue: degrees) ?? .right} get { return ArrowModel.Direction(rawValue: degrees) ?? .right}
set { degrees = newValue.rawValue } set { degrees = newValue.rawValue }
} }
@ -54,23 +54,7 @@ open class Arrow: View {
get { return arrowModel?.lineWidth ?? 1 } get { return arrowModel?.lineWidth ?? 1 }
set { arrowModel?.lineWidth = newValue } 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 // MARK: - Constraints
//-------------------------------------------------- //--------------------------------------------------

View File

@ -28,6 +28,22 @@ open class ArrowModel: MoleculeModelProtocol {
public var width: CGFloat = 12 public var width: CGFloat = 12
public var enabled: Bool = true 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 // MARK: - Initializer
//-------------------------------------------------- //--------------------------------------------------

View File

@ -45,5 +45,6 @@ open class BarsCarouselIndicatorModel: CarouselIndicatorModel {
public override func encode(to encoder: Encoder) throws { public override func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(currentIndicatorColor, forKey: .currentIndicatorColor) 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) { public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
guard newIndex < totalCount else { return }
guard !barReferences.isEmpty else { guard !barReferences.isEmpty else {
generateBars() generateBars()
return 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. /// 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) -> ())? public var indicatorTouchAction: ((CarouselPageControlProtocol) -> ())?
open override var isEnabled: Bool { open override var isEnabled: Bool {
@ -60,7 +60,6 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
/// Holds the total number of pages displayed by the carousel. /// Holds the total number of pages displayed by the carousel.
/// Updating this property will potentially update the UI. /// 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 { public var numberOfPages: Int {
get { return carouselIndicatorModel?.numberOfPages ?? 0 } get { return carouselIndicatorModel?.numberOfPages ?? 0 }
set (newTotal) { set (newTotal) {
@ -106,16 +105,11 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
// MARK: - Lifecycle // MARK: - Lifecycle
//-------------------------------------------------- //--------------------------------------------------
public override func initialSetup() {
super.initialSetup()
isAccessibilityElement = true
accessibilityTraits = .adjustable
}
open override func setupView() { open override func setupView() {
super.setupView() super.setupView()
isAccessibilityElement = true
accessibilityTraits = .adjustable
setupGestures() setupGestures()
} }
@ -192,9 +186,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
guard let model = model as? CarouselIndicatorModel else { return } guard let model = model as? CarouselIndicatorModel else { return }
indicatorColor = model.indicatorColor.uiColor
disabledIndicatorColor = model.disabledIndicatorColor.uiColor
currentIndex = model.currentIndex currentIndex = model.currentIndex
isEnabled = model.enabled isEnabled = model.enabled

View File

@ -127,7 +127,7 @@ open class Carousel: View {
collectionView.backgroundColor = backgroundColor collectionView.backgroundColor = backgroundColor
collectionView.layer.borderColor = backgroundColor?.cgColor collectionView.layer.borderColor = backgroundColor?.cgColor
collectionView.layer.borderWidth = carouselModel.border! ? 1 : 0 collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0
backgroundColor = .white backgroundColor = .white
registerCells(with: carouselModel, delegateObject: delegateObject) 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). // 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 loop = true
if let last = newMolecules.last { molecules?.insert(newMolecules.last!, at: 0)
molecules?.insert(last, at: 0)
}
molecules?.insert(newMolecules[(newMolecules.count - 2)], at: 0) molecules?.insert(newMolecules[(newMolecules.count - 2)], at: 0)
molecules?.append(newMolecules.first!)
if let first = newMolecules.first {
molecules?.append(first)
}
molecules?.append(newMolecules[1]) molecules?.append(newMolecules[1])
} }

View File

@ -13,7 +13,6 @@ open class ImageView: UIImageView, ModelMoleculeViewProtocol {
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
open var json: [AnyHashable: Any]?
open var model: MoleculeModelProtocol? open var model: MoleculeModelProtocol?
private var initialSetupPerformed = false private var initialSetupPerformed = false
@ -96,14 +95,6 @@ extension ImageView: MVMCoreViewProtocol {
// MARK:- MVMCoreUIMoleculeViewProtocol // MARK:- MVMCoreUIMoleculeViewProtocol
extension ImageView: 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() { open func reset() {
backgroundColor = .clear backgroundColor = .clear
} }