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 {
layer.addSublayer(bottomBar)
}
let tap = UITapGestureRecognizer(target: self, action: #selector(callTextField))
addGestureRecognizer(tap)
updateView(MVMCoreUISplitViewController.getDetailViewWidth())
}
@ -144,40 +148,41 @@ import UIKit
//--------------------------------------------------
// MARK: - Methods
//--------------------------------------------------
@objc public func callTextField() {
digitField.becomeFirstResponder()
}
@objc public override func updateView(_ size: CGFloat) {
super.updateView(size)
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(previousSize)) {
MFStyler.styleTextField(digitField)
digitField.font = MFFonts.mfFont55Rg(28)
if !MVMCoreGetterUtility.fequal(a: Float(size), b: Float(self.previousSize)) {
MFStyler.styleTextField(self.digitField)
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
}
var width: CGFloat = 0
var height: CGFloat = 0
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?.isActive = true
let tap = UITapGestureRecognizer(target: self, action: #selector(startEditing))
entryFieldContainer.addGestureRecognizer(tap)
accessibilityElements = [titleLabel, textField, feedbackLabel]
}

View File

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