updated to private methods

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-09 11:52:25 -05:00
parent eb8edd2acd
commit 760433243e
6 changed files with 30 additions and 30 deletions

View File

@ -78,7 +78,7 @@ open class Control: UIControl, ViewProtocol, UserInfoable, Clickable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
shouldUpdateView = false

View File

@ -57,7 +57,7 @@ open class View: UIView, ViewProtocol, UserInfoable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
shouldUpdateView = false

View File

@ -97,12 +97,9 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = []
shouldUpdateView = false
setup()
shouldUpdateView = true
@ -112,8 +109,9 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable {
open func setup() {
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = []
titleLabel?.adjustsFontSizeToFitWidth = false
titleLabel?.lineBreakMode = .byTruncatingTail
titleLabel?.numberOfLines = 1

View File

@ -192,23 +192,9 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
//register for ContentSizeChanges
NotificationCenter
.Publisher(center: .default, name: UIContentSizeCategory.didChangeNotification)
.sink { [weak self] notification in
self?.setNeedsUpdate()
}.store(in: &subscribers)
backgroundColor = .clear
numberOfLines = 0
lineBreakMode = .byTruncatingTail
translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = []
isAccessibilityElement = true
accessibilityTraits = .staticText
textAlignment = .left
shouldUpdateView = false
setup()
shouldUpdateView = true
@ -217,6 +203,20 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
}
open func setup() {
//register for ContentSizeChanges
NotificationCenter
.Publisher(center: .default, name: UIContentSizeCategory.didChangeNotification)
.sink { [weak self] notification in
self?.setNeedsUpdate()
}.store(in: &subscribers)
backgroundColor = .clear
numberOfLines = 0
lineBreakMode = .byTruncatingTail
translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = []
isAccessibilityElement = true
accessibilityTraits = .staticText
textAlignment = .left
}
open func reset() {

View File

@ -98,13 +98,9 @@ open class TextField: UITextField, ViewProtocol, Errorable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
clipsToBounds = true
shouldUpdateView = false
setup()
shouldUpdateView = true
@ -113,6 +109,11 @@ open class TextField: UITextField, ViewProtocol, Errorable {
}
open func setup() {
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
clipsToBounds = true
let accessView = UIView(frame: .init(origin: .zero, size: .init(width: UIScreen.main.bounds.width, height: 44)))
accessView.backgroundColor = .white
accessView.addBorder(side: .top, width: 1, color: .lightGray)

View File

@ -107,11 +107,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
//--------------------------------------------------
// MARK: - Lifecycle
//--------------------------------------------------
open func initialSetup() {
private func initialSetup() {
if !initialSetupPerformed {
initialSetupPerformed = true
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
shouldUpdateView = false
setup()
shouldUpdateView = true
@ -120,6 +118,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
}
open func setup() {
backgroundColor = .clear
translatesAutoresizingMaskIntoConstraints = false
let accessView = UIView(frame: .init(origin: .zero, size: .init(width: UIScreen.main.bounds.width, height: 44)))
accessView.backgroundColor = .white
accessView.addBorder(side: .top, width: 1, color: .lightGray)