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) { if let selectedIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedIndex) {
self.selectedIndex = selectedIndex self.selectedIndex = selectedIndex
} }
baseValue = options.indices.contains(selectedIndex) ? options[selectedIndex] : nil
} }
public override func encode(to encoder: Encoder) throws { public override func encode(to encoder: Encoder) throws {

View File

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

View File

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

View File

@ -11,7 +11,7 @@ import UIKit
@objcMembers open class Wheel: View, MVMCoreUIViewConstrainingProtocol { @objcMembers open class Wheel: View, MVMCoreUIViewConstrainingProtocol {
var heightConstraint: NSLayoutConstraint? var heightConstraint: NSLayoutConstraint?
var gradientLayer: CALayer? weak var gradientLayer: CALayer?
var graphModel: WheelModel? { var graphModel: WheelModel? {
return model as? WheelModel return model as? WheelModel
} }
@ -193,20 +193,9 @@ import UIKit
rotation.timingFunction = CAMediaTimingFunction(name: .linear) rotation.timingFunction = CAMediaTimingFunction(name: .linear)
rotation.fillMode = .both rotation.fillMode = .both
rotation.isRemovedOnCompletion = false 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") self.gradientLayer?.add(rotation, forKey: "rotation")
}) })
} }
} }
extension Wheel: CAAnimationDelegate {
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
if let object = graphModel {
rotationAnimation(object)
}
}
}