moved tap back into each control since not all controls should need this
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
1306c9e2a9
commit
6c67544c71
@ -27,7 +27,6 @@ open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProto
|
|||||||
//if set to true this will call the
|
//if set to true this will call the
|
||||||
//defaultAction() in the class
|
//defaultAction() in the class
|
||||||
public var executeDefaultAction = true
|
public var executeDefaultAction = true
|
||||||
public var isTappable = true
|
|
||||||
|
|
||||||
@Proxy(\.model.surface)
|
@Proxy(\.model.surface)
|
||||||
open var surface: Surface
|
open var surface: Surface
|
||||||
@ -84,7 +83,6 @@ open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProto
|
|||||||
initialSetupPerformed = true
|
initialSetupPerformed = true
|
||||||
setupUpdateView()
|
setupUpdateView()
|
||||||
setup()
|
setup()
|
||||||
if isTappable { addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap))) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,10 +102,6 @@ open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProto
|
|||||||
defaultAction()
|
defaultAction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func tap() {
|
|
||||||
sendActions(for: .touchUpInside)
|
|
||||||
}
|
|
||||||
|
|
||||||
open func defaultAction() { }
|
open func defaultAction() { }
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,8 @@ open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType>, Changable
|
|||||||
|
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap)))
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
addSubview(mainStackView)
|
addSubview(mainStackView)
|
||||||
@ -204,6 +205,10 @@ open class CheckboxBase<ModelType: CheckboxModel>: Control<ModelType>, Changable
|
|||||||
onChange = nil
|
onChange = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func tap() {
|
||||||
|
sendActions(for: .touchUpInside)
|
||||||
|
}
|
||||||
|
|
||||||
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
|
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
|
||||||
open override func defaultAction() {
|
open override func defaultAction() {
|
||||||
//removed error
|
//removed error
|
||||||
|
|||||||
@ -128,6 +128,7 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable
|
|||||||
|
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap)))
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
@ -202,6 +203,10 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable
|
|||||||
setAccessibilityLabel()
|
setAccessibilityLabel()
|
||||||
onChange = nil
|
onChange = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func tap() {
|
||||||
|
sendActions(for: .touchUpInside)
|
||||||
|
}
|
||||||
|
|
||||||
/// This will radioBox the state of the Selector and execute the actionBlock if provided.
|
/// This will radioBox the state of the Selector and execute the actionBlock if provided.
|
||||||
open override func defaultAction() {
|
open override func defaultAction() {
|
||||||
|
|||||||
@ -126,7 +126,8 @@ open class RadioButtonBase<ModelType: RadioButtonModel>: Control<ModelType>, Cha
|
|||||||
|
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap)))
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
addSubview(mainStackView)
|
addSubview(mainStackView)
|
||||||
@ -203,6 +204,9 @@ open class RadioButtonBase<ModelType: RadioButtonModel>: Control<ModelType>, Cha
|
|||||||
onChange = nil
|
onChange = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func tap() {
|
||||||
|
sendActions(for: .touchUpInside)
|
||||||
|
}
|
||||||
|
|
||||||
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
|
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
|
||||||
open override func defaultAction() {
|
open override func defaultAction() {
|
||||||
|
|||||||
@ -88,7 +88,8 @@ open class RadioSwatchBase<ModelType: RadioSwatchModel>: Control<ModelType>, Cha
|
|||||||
|
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap)))
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
addSubview(selectorView)
|
addSubview(selectorView)
|
||||||
@ -120,7 +121,11 @@ open class RadioSwatchBase<ModelType: RadioSwatchModel>: Control<ModelType>, Cha
|
|||||||
setAccessibilityLabel()
|
setAccessibilityLabel()
|
||||||
onChange = nil
|
onChange = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func tap() {
|
||||||
|
sendActions(for: .touchUpInside)
|
||||||
|
}
|
||||||
|
|
||||||
open override func defaultAction() {
|
open override func defaultAction() {
|
||||||
isSelected.toggle()
|
isSelected.toggle()
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
|
|||||||
@ -96,7 +96,7 @@ public class RadioSwatchGroupBase<GroupModelType: RadioSwatchGroupModel, ModelHa
|
|||||||
|
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
isTappable = false
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
addSubview(label)
|
addSubview(label)
|
||||||
|
|||||||
@ -254,6 +254,7 @@ open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, Changable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(Self.tap)))
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
@ -309,7 +310,11 @@ open class ToggleBase<ModelType: ToggleModel>: Control<ModelType>, Changable {
|
|||||||
setAccessibilityLabel()
|
setAccessibilityLabel()
|
||||||
onChange = nil
|
onChange = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func tap() {
|
||||||
|
sendActions(for: .touchUpInside)
|
||||||
|
}
|
||||||
|
|
||||||
/// This will toggle the state of the Toggle and execute the actionBlock if provided.
|
/// This will toggle the state of the Toggle and execute the actionBlock if provided.
|
||||||
open override func defaultAction() {
|
open override func defaultAction() {
|
||||||
isOn.toggle()
|
isOn.toggle()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user