Making container tappabble to increase actionable surface area.

This commit is contained in:
Kevin G Christiano 2019-12-05 14:07:53 -05:00
parent 6b34b8840d
commit 420a874711
3 changed files with 37 additions and 31 deletions

View File

@ -120,6 +120,10 @@ import UIKit
if let bottomBar = bottomBar { if let bottomBar = bottomBar {
layer.addSublayer(bottomBar) layer.addSublayer(bottomBar)
} }
let tap = UITapGestureRecognizer(target: self, action: #selector(callTextField))
addGestureRecognizer(tap)
updateView(MVMCoreUISplitViewController.getDetailViewWidth()) updateView(MVMCoreUISplitViewController.getDetailViewWidth())
} }
@ -144,40 +148,41 @@ import UIKit
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Methods // MARK: - Methods
//-------------------------------------------------- //--------------------------------------------------
@objc public func callTextField() {
digitField.becomeFirstResponder()
}
@objc public override func updateView(_ size: CGFloat) { @objc public override func updateView(_ size: CGFloat) {
super.updateView(size) super.updateView(size)
DispatchQueue.main.async { [weak self] in if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(previousSize)) {
guard let self = self else { return } MFStyler.styleTextField(digitField)
digitField.font = MFFonts.mfFont55Rg(28)
if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(self.previousSize)) { var width: CGFloat = 0
MFStyler.styleTextField(self.digitField) var height: CGFloat = 0
self.digitField.font = MFFonts.mfFont55Rg(28)
var width: CGFloat = 0
var height: CGFloat = 0
let sizeObject = MFSizeObject(standardBlock: {
width = 39
height = 44
}, smalliPhone: {
width = 35
height = 38
}, standardiPadPortraitBlock: {
width = 59
height = 74
})
sizeObject?.performBlockBase(onSize: size)
self.widthConstraint?.constant = width
self.heightConstraint?.constant = height
self.previousSize = size
}
self.setNeedsLayout() let sizeObject = MFSizeObject(standardBlock: {
width = 39
height = 44
}, smalliPhone: {
width = 35
height = 38
}, standardiPadPortraitBlock: {
width = 59
height = 74
})
sizeObject?.performBlockBase(onSize: size)
widthConstraint?.constant = width
heightConstraint?.constant = height
previousSize = size
} }
setNeedsLayout()
} }
} }

View File

@ -166,6 +166,9 @@ import UIKit
textFieldTrailingConstraint = container.trailingAnchor.constraint(equalTo: textField.trailingAnchor, constant: 16) textFieldTrailingConstraint = container.trailingAnchor.constraint(equalTo: textField.trailingAnchor, constant: 16)
textFieldTrailingConstraint?.isActive = true textFieldTrailingConstraint?.isActive = true
let tap = UITapGestureRecognizer(target: self, action: #selector(startEditing))
entryFieldContainer.addGestureRecognizer(tap)
accessibilityElements = [titleLabel, textField, feedbackLabel] accessibilityElements = [titleLabel, textField, feedbackLabel]
} }

View File

@ -271,7 +271,5 @@ import UIKit
self.delegateObject = delegateObject self.delegateObject = delegateObject
guard let dictionary = json, !dictionary.isEmpty else { return } guard let dictionary = json, !dictionary.isEmpty else { return }
} }
} }