generally functioning. some loose ends with TextField.
This commit is contained in:
parent
d0cb4a987e
commit
19310bff89
@ -12,7 +12,7 @@ import UIKit
|
|||||||
@objc optional func textFieldDidDelete(_ textField: UITextField?)
|
@objc optional func textFieldDidDelete(_ textField: UITextField?)
|
||||||
}
|
}
|
||||||
|
|
||||||
class DigitTextBox: UITextField, MVMCoreViewProtocol {
|
@objcMembers open class DigitTextBox: UITextField, MVMCoreViewProtocol {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -38,7 +38,7 @@ class DigitTextBox: UITextField, MVMCoreViewProtocol {
|
|||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required public init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
@ -58,33 +58,32 @@ class DigitTextBox: UITextField, MVMCoreViewProtocol {
|
|||||||
|
|
||||||
func setup() {
|
func setup() {
|
||||||
|
|
||||||
if constraints.count == 0 {
|
guard constraints.isEmpty else { return }
|
||||||
|
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
backgroundColor = .white
|
backgroundColor = .white
|
||||||
textAlignment = .center
|
textAlignment = .center
|
||||||
keyboardType = .numberPad
|
keyboardType = .numberPad
|
||||||
layer.borderWidth = 1
|
layer.borderWidth = 1
|
||||||
hideError()
|
hideError()
|
||||||
|
|
||||||
widthConstraint = widthAnchor.constraint(equalToConstant: 40)
|
widthConstraint = widthAnchor.constraint(equalToConstant: 40)
|
||||||
widthConstraint?.isActive = true
|
widthConstraint?.isActive = true
|
||||||
|
|
||||||
heightConstraint = heightAnchor.constraint(equalToConstant: 60)
|
heightConstraint = heightAnchor.constraint(equalToConstant: 60)
|
||||||
heightConstraint?.isActive = true
|
heightConstraint?.isActive = true
|
||||||
|
|
||||||
bottomBar = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot)
|
bottomBar = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot)
|
||||||
bottomBar?.setAsMedium()
|
bottomBar?.setAsMedium()
|
||||||
|
|
||||||
updateView(MVMCoreUISplitViewController.getDetailViewWidth())
|
updateView(MVMCoreUISplitViewController.getDetailViewWidth())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
override func deleteBackward() {
|
override open func deleteBackward() {
|
||||||
super.deleteBackward()
|
super.deleteBackward()
|
||||||
|
|
||||||
if let delegate = mfTextBoxDelegate {
|
if let delegate = mfTextBoxDelegate {
|
||||||
@ -92,7 +91,7 @@ class DigitTextBox: UITextField, MVMCoreViewProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateView(_ size: CGFloat) {
|
public func updateView(_ size: CGFloat) {
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(self.previousSize)) {
|
if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(self.previousSize)) {
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class DigitTextField: TextField, UITextFieldDelegate, MFDigitTextBoxDelegate {
|
@objcMembers open class DigitTextField: TextField, UITextFieldDelegate, MFDigitTextBoxDelegate {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import UIKit
|
|||||||
import MVMCore
|
import MVMCore
|
||||||
|
|
||||||
|
|
||||||
@objcMembers class MdnTextField: TextField, UITextFieldDelegate, ABPeoplePickerNavigationControllerDelegate, CNContactPickerDelegate {
|
@objcMembers open class MdnTextField: TextField, UITextFieldDelegate, ABPeoplePickerNavigationControllerDelegate, CNContactPickerDelegate {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -25,9 +25,9 @@ import MVMCore
|
|||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override init(frame: CGRect) {
|
open override init(frame: CGRect) {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
setup()
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
public convenience init() {
|
public convenience init() {
|
||||||
@ -42,14 +42,14 @@ import MVMCore
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Setup
|
// MARK: - Setup
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
private func setup() {
|
private func setup() {
|
||||||
|
|
||||||
textField?.delegate = self
|
textField?.delegate = self
|
||||||
customDelegate = uiTextFieldDelegate
|
customDelegate = uiTextFieldDelegate
|
||||||
isNationalMdn = true
|
isNationalMdn = true
|
||||||
textField?.keyboardType = .numberPad
|
textField?.keyboardType = .numberPad
|
||||||
|
|
||||||
let toolbar = MVMCoreUICommonViewsUtility.makeEmptyToolbar()
|
let toolbar = MVMCoreUICommonViewsUtility.makeEmptyToolbar()
|
||||||
let space = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
let space = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
||||||
let contacts = UIBarButtonItem(title: MVMCoreUIUtility.hardcodedString(withKey: "textfield_contacts_barbutton"), style: .plain, target: self, action: #selector(getContacts(_:)))
|
let contacts = UIBarButtonItem(title: MVMCoreUIUtility.hardcodedString(withKey: "textfield_contacts_barbutton"), style: .plain, target: self, action: #selector(getContacts(_:)))
|
||||||
@ -72,13 +72,13 @@ import MVMCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
func hasValidMdn() -> Bool {
|
func hasValidMdn() -> Bool {
|
||||||
|
|
||||||
guard let mdn = getMdn() else { return true }
|
guard let mdn = getMdn() else { return true }
|
||||||
|
|
||||||
if mdn.isEmpty {
|
if mdn.isEmpty {
|
||||||
@ -92,7 +92,7 @@ import MVMCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
func validateAndColor() -> Bool {
|
func validateAndColor() -> Bool {
|
||||||
|
|
||||||
if !shouldValidateMDN {
|
if !shouldValidateMDN {
|
||||||
let isValid = hasValidMdn()
|
let isValid = hasValidMdn()
|
||||||
|
|
||||||
@ -108,24 +108,24 @@ import MVMCore
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func getErrorMessage() -> String? {
|
func getErrorMessage() -> String? {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMdn() -> String? {
|
func getMdn() -> String? {
|
||||||
|
|
||||||
return MVMCoreUIUtility.removeMdnFormat(text! as String)
|
return MVMCoreUIUtility.removeMdnFormat(text! as String)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setMdn(_ mdn: String?) {
|
func setMdn(_ mdn: String?) {
|
||||||
|
|
||||||
guard let MDN = mdn else { return }
|
guard let MDN = mdn else { return }
|
||||||
|
|
||||||
text = MVMCoreUIUtility.formatMdn(MDN)
|
text = MVMCoreUIUtility.formatMdn(MDN)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func dismissFieldInput(_ sender: Any?) {
|
@objc func dismissFieldInput(_ sender: Any?) {
|
||||||
|
|
||||||
if let delegate = uiTextFieldDelegate {
|
if let delegate = uiTextFieldDelegate {
|
||||||
@ -134,7 +134,7 @@ import MVMCore
|
|||||||
textField?.resignFirstResponder()
|
textField?.resignFirstResponder()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getContacts(_ sender: Any?) {
|
func getContacts(_ sender: Any?) {
|
||||||
|
|
||||||
let picker = CNContactPickerViewController()
|
let picker = CNContactPickerViewController()
|
||||||
@ -144,19 +144,19 @@ import MVMCore
|
|||||||
picker.predicateForSelectionOfProperty = NSPredicate(format: "key == 'phoneNumbers'")
|
picker.predicateForSelectionOfProperty = NSPredicate(format: "key == 'phoneNumbers'")
|
||||||
MVMCoreNavigationHandler.shared()?.present(picker, animated: true)
|
MVMCoreNavigationHandler.shared()?.present(picker, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - ContactPicker Delegate
|
// MARK: - ContactPicker Delegate
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) {
|
func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) {
|
||||||
|
|
||||||
if contactProperty.value != nil && (contactProperty.value is CNPhoneNumber) {
|
if contactProperty.value != nil && (contactProperty.value is CNPhoneNumber) {
|
||||||
|
|
||||||
let phoneNumber = contactProperty.value as? CNPhoneNumber
|
let phoneNumber = contactProperty.value as? CNPhoneNumber
|
||||||
let MDN = phoneNumber?.stringValue
|
let MDN = phoneNumber?.stringValue
|
||||||
var unformattedMDN = MVMCoreUIUtility.removeMdnFormat(MDN)
|
var unformattedMDN = MVMCoreUIUtility.removeMdnFormat(MDN)
|
||||||
|
|
||||||
// Sometimes user add extra 1 in front of mdn in their address book
|
// Sometimes user add extra 1 in front of mdn in their address book
|
||||||
if isNationalMdn,
|
if isNationalMdn,
|
||||||
let unformedMDN = unformattedMDN,
|
let unformedMDN = unformattedMDN,
|
||||||
@ -165,7 +165,7 @@ import MVMCore
|
|||||||
|
|
||||||
unformattedMDN = (unformedMDN as NSString).substring(from: 1)
|
unformattedMDN = (unformedMDN as NSString).substring(from: 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
text = unformattedMDN
|
text = unformattedMDN
|
||||||
|
|
||||||
if let textField = textField {
|
if let textField = textField {
|
||||||
@ -174,7 +174,7 @@ import MVMCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - ImplementedTextField Delegate
|
// MARK: - ImplementedTextField Delegate
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -183,27 +183,27 @@ import MVMCore
|
|||||||
@objc func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
@objc func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
||||||
|
|
||||||
textField.resignFirstResponder()
|
textField.resignFirstResponder()
|
||||||
|
|
||||||
if let customDelegate = customDelegate {
|
if let customDelegate = customDelegate {
|
||||||
return customDelegate.textFieldShouldReturn?(textField) ?? false
|
return customDelegate.textFieldShouldReturn?(textField) ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
@objc func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||||
|
|
||||||
if !MVMCoreUIUtility.validate(string, withRegularExpression: RegularExpressionDigitOnly) {
|
if !MVMCoreUIUtility.validate(string, withRegularExpression: RegularExpressionDigitOnly) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if let customDelegate = customDelegate {
|
if let customDelegate = customDelegate {
|
||||||
return customDelegate.textField?(textField, shouldChangeCharactersIn: range, replacementString: string) ?? true
|
return customDelegate.textField?(textField, shouldChangeCharactersIn: range, replacementString: string) ?? true
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func textFieldDidBeginEditing(_ textField: UITextField) {
|
func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||||
|
|
||||||
textField.text = MVMCoreUIUtility.removeMdnFormat(textField.text)
|
textField.text = MVMCoreUIUtility.removeMdnFormat(textField.text)
|
||||||
@ -213,16 +213,16 @@ import MVMCore
|
|||||||
func textFieldDidEndEditing(_ textField: UITextField) {
|
func textFieldDidEndEditing(_ textField: UITextField) {
|
||||||
|
|
||||||
customDelegate?.textFieldDidEndEditing?(textField)
|
customDelegate?.textFieldDidEndEditing?(textField)
|
||||||
|
|
||||||
if validateAndColor() && isNationalMdn {
|
if validateAndColor() && isNationalMdn {
|
||||||
textField.text = MVMCoreUIUtility.formatMdn(textField.text)
|
textField.text = MVMCoreUIUtility.formatMdn(textField.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Passed Along TextField delegate
|
// MARK: - Passed Along TextField delegate
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
@objc func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
|
@objc func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
|
||||||
|
|
||||||
if let customDelegate = customDelegate {
|
if let customDelegate = customDelegate {
|
||||||
@ -231,7 +231,7 @@ import MVMCore
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
|
@objc func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
|
||||||
|
|
||||||
if let customDelegate = customDelegate {
|
if let customDelegate = customDelegate {
|
||||||
@ -240,7 +240,7 @@ import MVMCore
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func textFieldShouldClear(_ textField: UITextField) -> Bool {
|
@objc func textFieldShouldClear(_ textField: UITextField) -> Bool {
|
||||||
|
|
||||||
if let customDelegate = customDelegate {
|
if let customDelegate = customDelegate {
|
||||||
@ -249,5 +249,4 @@ import MVMCore
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -226,6 +226,7 @@ import UIKit
|
|||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
/// Initial configuration of class and view.
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
|
|
||||||
guard subviews.isEmpty else { return }
|
guard subviews.isEmpty else { return }
|
||||||
@ -241,6 +242,8 @@ import UIKit
|
|||||||
formLabel.textColor = UIColor.mfBattleshipGrey()
|
formLabel.textColor = UIColor.mfBattleshipGrey()
|
||||||
formLabel.setContentHuggingPriority(UILayoutPriority(251), for: .horizontal)
|
formLabel.setContentHuggingPriority(UILayoutPriority(251), for: .horizontal)
|
||||||
formLabel.setContentHuggingPriority(UILayoutPriority(251), for: .vertical)
|
formLabel.setContentHuggingPriority(UILayoutPriority(251), for: .vertical)
|
||||||
|
formLabel.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
|
formLabel.heightAnchor.constraint(greaterThanOrEqualToConstant: 0).isActive = true
|
||||||
|
|
||||||
addSubview(formLabel)
|
addSubview(formLabel)
|
||||||
|
|
||||||
@ -282,6 +285,7 @@ import UIKit
|
|||||||
layoutMarginsGuide.bottomAnchor.constraint(equalTo: placeholderErrorLabel.bottomAnchor).isActive = true
|
layoutMarginsGuide.bottomAnchor.constraint(equalTo: placeholderErrorLabel.bottomAnchor).isActive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Configuration logic for the text container view.
|
||||||
private func constrainContent(_ parentView: UIView) {
|
private func constrainContent(_ parentView: UIView) {
|
||||||
|
|
||||||
let backgroundView = UIView(frame: .zero)
|
let backgroundView = UIView(frame: .zero)
|
||||||
@ -299,7 +303,8 @@ import UIKit
|
|||||||
let textField = UITextField(frame: .zero)
|
let textField = UITextField(frame: .zero)
|
||||||
self.textField = textField
|
self.textField = textField
|
||||||
textField.translatesAutoresizingMaskIntoConstraints = false
|
textField.translatesAutoresizingMaskIntoConstraints = false
|
||||||
textField.setContentHuggingPriority(.required, for: .vertical)
|
textField.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
|
textField.heightAnchor.constraint(equalToConstant: 24).isActive = true
|
||||||
textField.font = MFStyler.fontForTextField()
|
textField.font = MFStyler.fontForTextField()
|
||||||
textField.smartQuotesType = .no
|
textField.smartQuotesType = .no
|
||||||
textField.smartDashesType = .no
|
textField.smartDashesType = .no
|
||||||
@ -311,7 +316,7 @@ import UIKit
|
|||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
textField.topAnchor.constraint(equalTo: parentView.topAnchor, constant: 10),
|
textField.topAnchor.constraint(equalTo: parentView.topAnchor, constant: 10),
|
||||||
textField.leadingAnchor.constraint(equalTo: parentView.leadingAnchor, constant: 16),
|
textField.leadingAnchor.constraint(equalTo: parentView.leadingAnchor, constant: 16),
|
||||||
parentView.trailingAnchor.constraint(equalTo: textField.trailingAnchor, constant: 10)])
|
parentView.bottomAnchor.constraint(equalTo: textField.bottomAnchor, constant: 10)])
|
||||||
|
|
||||||
let dropDownCarrotLabel = Label()
|
let dropDownCarrotLabel = Label()
|
||||||
self.dropDownCarrotLabel = dropDownCarrotLabel
|
self.dropDownCarrotLabel = dropDownCarrotLabel
|
||||||
@ -325,8 +330,8 @@ import UIKit
|
|||||||
|
|
||||||
addSubview(dropDownCarrotLabel)
|
addSubview(dropDownCarrotLabel)
|
||||||
|
|
||||||
textField.topAnchor.constraint(equalTo: parentView.topAnchor, constant: 10).isActive = true
|
dropDownCarrotLabel.topAnchor.constraint(equalTo: parentView.topAnchor).isActive = true
|
||||||
textField.leadingAnchor.constraint(equalTo: textField.leadingAnchor, constant: 6).isActive = true
|
dropDownCarrotLabel.leadingAnchor.constraint(equalTo: textField.trailingAnchor, constant: 6).isActive = true
|
||||||
parentView.trailingAnchor.constraint(equalTo: dropDownCarrotLabel.trailingAnchor, constant: 16).isActive = true
|
parentView.trailingAnchor.constraint(equalTo: dropDownCarrotLabel.trailingAnchor, constant: 16).isActive = true
|
||||||
parentView.bottomAnchor.constraint(equalTo: dropDownCarrotLabel.bottomAnchor).isActive = true
|
parentView.bottomAnchor.constraint(equalTo: dropDownCarrotLabel.bottomAnchor).isActive = true
|
||||||
dropDownCarrotWidth = dropDownCarrotLabel.widthAnchor.constraint(equalToConstant: 0)
|
dropDownCarrotWidth = dropDownCarrotLabel.widthAnchor.constraint(equalToConstant: 0)
|
||||||
@ -346,6 +351,7 @@ import UIKit
|
|||||||
parentView.bottomAnchor.constraint(equalTo: separatorView.bottomAnchor).isActive = true
|
parentView.bottomAnchor.constraint(equalTo: separatorView.bottomAnchor).isActive = true
|
||||||
|
|
||||||
let dashLine = DashLine()
|
let dashLine = DashLine()
|
||||||
|
dashLine.translatesAutoresizingMaskIntoConstraints = false
|
||||||
dashLine.backgroundColor = .white
|
dashLine.backgroundColor = .white
|
||||||
dashLine.isHidden = true
|
dashLine.isHidden = true
|
||||||
|
|
||||||
@ -355,8 +361,7 @@ import UIKit
|
|||||||
dashLine.centerYAnchor.constraint(equalTo: separatorView.centerYAnchor),
|
dashLine.centerYAnchor.constraint(equalTo: separatorView.centerYAnchor),
|
||||||
dashLine.centerXAnchor.constraint(equalTo: separatorView.centerXAnchor),
|
dashLine.centerXAnchor.constraint(equalTo: separatorView.centerXAnchor),
|
||||||
dashLine.topAnchor.constraint(equalTo: separatorView.topAnchor),
|
dashLine.topAnchor.constraint(equalTo: separatorView.topAnchor),
|
||||||
dashLine.leadingAnchor.constraint(equalTo: separatorView.leadingAnchor),
|
dashLine.leadingAnchor.constraint(equalTo: separatorView.leadingAnchor)])
|
||||||
separatorView.bottomAnchor.constraint(equalTo: dashLine.bottomAnchor)])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
@ -706,7 +711,7 @@ extension TextField {
|
|||||||
setWithMap(json)
|
setWithMap(json)
|
||||||
|
|
||||||
if let formValidationProtocol = delegateObject.formValidationProtocol {
|
if let formValidationProtocol = delegateObject.formValidationProtocol {
|
||||||
mfTextFieldDelegate = FormValidator.getFormValidatorFor(delegate: formValidationProtocol) as? TextFieldDelegate
|
mfTextFieldDelegate = FormValidator.getFormValidatorFor(delegate: formValidationProtocol)
|
||||||
}
|
}
|
||||||
|
|
||||||
uiTextFieldDelegate = delegateObject.uiTextFieldDelegate
|
uiTextFieldDelegate = delegateObject.uiTextFieldDelegate
|
||||||
|
|||||||
@ -31,7 +31,6 @@ open class DashLine: MFView {
|
|||||||
|
|
||||||
required public init?(coder: NSCoder) {
|
required public init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
fatalError("init(coder:) has not been implemented")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
@ -39,6 +38,7 @@ open class DashLine: MFView {
|
|||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
@objc override open func updateView(_ size: CGFloat) {
|
@objc override open func updateView(_ size: CGFloat) {
|
||||||
|
|
||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
self?.setNeedsDisplay()
|
self?.setNeedsDisplay()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user