Increased the tappable space of the Checkbox.
This commit is contained in:
parent
aaa8e4132e
commit
a7989c589f
@ -351,18 +351,14 @@ import MVMCore
|
|||||||
|
|
||||||
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
|
|
||||||
sendActions(for: touchIsAcceptablyOutside(touches.first) ? .touchUpOutside : .touchUpInside)
|
sendActions(for: .touchUpInside)
|
||||||
}
|
}
|
||||||
|
|
||||||
func touchIsAcceptablyOutside(_ touch: UITouch?) -> Bool {
|
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||||
let endLocation = touch?.location(in: self)
|
|
||||||
let x = endLocation?.x ?? 0.0
|
|
||||||
let y = endLocation?.y ?? 0.0
|
|
||||||
let faultTolerance: CGFloat = 20.0
|
|
||||||
let widthLimit = CGFloat(bounds.size.width + faultTolerance)
|
|
||||||
let heightLimt = CGFloat(bounds.size.height + faultTolerance)
|
|
||||||
|
|
||||||
return x < -faultTolerance || y < -faultTolerance || x > widthLimit || y > heightLimt
|
let faultTolerance: CGFloat = 20.0
|
||||||
|
let area = bounds.insetBy(dx: -faultTolerance, dy: -faultTolerance)
|
||||||
|
return area.contains(point)
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func accessibilityActivate() -> Bool {
|
override open func accessibilityActivate() -> Bool {
|
||||||
@ -413,7 +409,7 @@ import MVMCore
|
|||||||
FormValidator.setupValidation(molecule: self, delegate: delegateObject?.formValidationProtocol)
|
FormValidator.setupValidation(molecule: self, delegate: delegateObject?.formValidationProtocol)
|
||||||
|
|
||||||
guard let dictionary = json else { return }
|
guard let dictionary = json else { return }
|
||||||
|
|
||||||
groupName = dictionary.optionalStringForKey("groupName")
|
groupName = dictionary.optionalStringForKey("groupName")
|
||||||
fieldValue = dictionary.optionalStringForKey("value")
|
fieldValue = dictionary.optionalStringForKey("value")
|
||||||
if let fieldKey = dictionary[KeyFieldKey] as? String {
|
if let fieldKey = dictionary[KeyFieldKey] as? String {
|
||||||
@ -470,7 +466,7 @@ import MVMCore
|
|||||||
|
|
||||||
// MARK:- FormValidationProtocol
|
// MARK:- FormValidationProtocol
|
||||||
extension Checkbox: FormValidationFormFieldProtocol {
|
extension Checkbox: FormValidationFormFieldProtocol {
|
||||||
|
|
||||||
public func formFieldGroupName() -> String? {
|
public func formFieldGroupName() -> String? {
|
||||||
return groupName
|
return groupName
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user