Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/conic_wheel

This commit is contained in:
Pfeil, Scott Robert 2020-08-03 13:54:08 -04:00
commit 1094df4cba
4 changed files with 7 additions and 13 deletions

View File

@ -45,6 +45,7 @@
if let selectedIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedIndex) {
self.selectedIndex = selectedIndex
}
baseValue = options.indices.contains(selectedIndex) ? options[selectedIndex] : nil
}
public override func encode(to encoder: Encoder) throws {

View File

@ -323,6 +323,9 @@ import UIKit
case .email:
textField.keyboardType = .emailAddress
case .phone:
textField.keyboardType = .phonePad
default:
break
}

View File

@ -18,6 +18,7 @@
case number
case email
case text
case phone
}
//--------------------------------------------------

View File

@ -11,7 +11,7 @@ import UIKit
@objcMembers open class Wheel: View, MVMCoreUIViewConstrainingProtocol {
var heightConstraint: NSLayoutConstraint?
var gradientLayer: CALayer?
weak var gradientLayer: CALayer?
var graphModel: WheelModel? {
return model as? WheelModel
}
@ -193,20 +193,9 @@ import UIKit
rotation.timingFunction = CAMediaTimingFunction(name: .linear)
rotation.fillMode = .both
rotation.isRemovedOnCompletion = false
rotation.repeatCount = Float.greatestFiniteMagnitude
//avoid infinity animation take high CPU momery usage when layer is not displayed
rotation.delegate = self
rotation.repeatCount = 1
self.gradientLayer?.add(rotation, forKey: "rotation")
})
}
}
extension Wheel: CAAnimationDelegate {
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
if let object = graphModel {
rotationAnimation(object)
}
}
}