added script to improve test page access and separate from release compilation. Formatting updates.

This commit is contained in:
Kevin G Christiano 2020-12-15 14:56:18 -05:00
parent 197bdd60de
commit 01908be951
9 changed files with 19 additions and 29 deletions

View File

@ -104,7 +104,10 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
self.disabledTitleColor = disabledTitleColor self.disabledTitleColor = disabledTitleColor
} }
#if DEBUG
// Useful to detect with isHittable when performing UI testing.
isAccessibilityElement = isEnabled isAccessibilityElement = isEnabled
#endif
if isEnabled { if isEnabled {
if let fillColor = buttonModel?.enabledColors.fill { if let fillColor = buttonModel?.enabledColors.fill {

View File

@ -43,7 +43,7 @@ import UIKit
//-------------------------------------------------- //--------------------------------------------------
public override var showError: Bool { public override var showError: Bool {
get { return super.showError } get { super.showError }
set (error) { set (error) {
DispatchQueue.main.async { [weak self] in DispatchQueue.main.async { [weak self] in
guard let self = self else { return } guard let self = self else { return }

View File

@ -357,9 +357,7 @@ import UIKit
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
} }
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { 115 }
return 115
}
} }
// MARK: - TextField Delegate // MARK: - TextField Delegate

View File

@ -14,9 +14,7 @@ import Foundation
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public class var identifier: String { public class var identifier: String { "" }
return ""
}
public var backgroundColor: Color? public var backgroundColor: Color?
public var accessibilityIdentifier: String? public var accessibilityIdentifier: String?

View File

@ -11,9 +11,7 @@
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public override class var identifier: String { public override class var identifier: String { "dropDown" }
return "dropDown"
}
public var options: [String] = [] public var options: [String] = []
public var selectedIndex: Int? public var selectedIndex: Int?

View File

@ -211,17 +211,14 @@ import MVMCore
} }
@objc public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { @objc public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
proprietorTextDelegate?.textFieldShouldBeginEditing?(textField) ?? true
return proprietorTextDelegate?.textFieldShouldBeginEditing?(textField) ?? true
} }
@objc public func textFieldShouldEndEditing(_ textField: UITextField) -> Bool { @objc public func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
proprietorTextDelegate?.textFieldShouldEndEditing?(textField) ?? true
return proprietorTextDelegate?.textFieldShouldEndEditing?(textField) ?? true
} }
@objc public func textFieldShouldClear(_ textField: UITextField) -> Bool { @objc public func textFieldShouldClear(_ textField: UITextField) -> Bool {
proprietorTextDelegate?.textFieldShouldClear?(textField) ?? true
return proprietorTextDelegate?.textFieldShouldClear?(textField) ?? true
} }
} }

View File

@ -31,11 +31,11 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
//-------------------------------------------------- //--------------------------------------------------
public var textViewEntryFieldModel: TextViewEntryFieldModel? { public var textViewEntryFieldModel: TextViewEntryFieldModel? {
return model as? TextViewEntryFieldModel model as? TextViewEntryFieldModel
} }
public override var isEnabled: Bool { public override var isEnabled: Bool {
get { return super.isEnabled } get { super.isEnabled }
set (enabled) { set (enabled) {
super.isEnabled = enabled super.isEnabled = enabled
@ -53,7 +53,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
} }
public override var showError: Bool { public override var showError: Bool {
get { return super.showError } get { super.showError }
set (error) { set (error) {
if error { if error {
@ -68,7 +68,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
/// The text of this textView. /// The text of this textView.
open override var text: String? { open override var text: String? {
get { return textViewEntryFieldModel?.text } get { textViewEntryFieldModel?.text }
set { set {
textView.text = newValue textView.text = newValue
textViewEntryFieldModel?.text = newValue textViewEntryFieldModel?.text = newValue
@ -77,7 +77,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
/// Placeholder access for the textView. /// Placeholder access for the textView.
public var placeholder: String? { public var placeholder: String? {
get { return textViewEntryFieldModel?.placeholder } get { textViewEntryFieldModel?.placeholder }
set { set {
textView.placeholder = newValue ?? "" textView.placeholder = newValue ?? ""
textViewEntryFieldModel?.placeholder = newValue textViewEntryFieldModel?.placeholder = newValue
@ -127,7 +127,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
/// If you're using a ViewController, you must set this to it /// If you're using a ViewController, you must set this to it
public weak var uiTextViewDelegate: UITextViewDelegate? { public weak var uiTextViewDelegate: UITextViewDelegate? {
get { return textView.delegate } get { textView.delegate }
set { textView.delegate = newValue } set { textView.delegate = newValue }
} }

View File

@ -14,9 +14,7 @@ class TextViewEntryFieldModel: TextEntryFieldModel {
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public override class var identifier: String { public override class var identifier: String { "textView" }
return "textView"
}
public var accessibilityText: String? public var accessibilityText: String?
public var fontStyle: Styler.Font = Styler.Font.RegularBodyLarge public var fontStyle: Styler.Font = Styler.Font.RegularBodyLarge

View File

@ -15,7 +15,7 @@ import UIKit
//-------------------------------------------------- //--------------------------------------------------
public var diameter: CGFloat = 30 { public var diameter: CGFloat = 30 {
didSet { widthConstraint?.constant = diameter } didSet { widthConstraint?.constant = diameter }
} }
@objc public override var isSelected: Bool { @objc public override var isSelected: Bool {
@ -34,9 +34,7 @@ import UIKit
model as? RadioButtonModel model as? RadioButtonModel
} }
lazy public var radioGroupName: String? = { lazy public var radioGroupName: String? = { radioModel?.fieldKey }()
return radioModel?.fieldKey
}()
lazy public var radioButtonSelectionHelper: RadioButtonSelectionHelper? = { lazy public var radioButtonSelectionHelper: RadioButtonSelectionHelper? = {