fix: remove tiuielements updates
This commit is contained in:
parent
9a9b57df4b
commit
3ccadd07b4
|
|
@ -32,8 +32,7 @@ public struct SubviewConstraints {
|
|||
public var widthConstraint: NSLayoutConstraint?
|
||||
public var heightConstraint: NSLayoutConstraint?
|
||||
|
||||
// TODO: remove from release version
|
||||
public init(centerXConstraint: NSLayoutConstraint? = nil,
|
||||
init(centerXConstraint: NSLayoutConstraint? = nil,
|
||||
centerYConstraint: NSLayoutConstraint? = nil,
|
||||
leadingConstraint: NSLayoutConstraint? = nil,
|
||||
topConstraint: NSLayoutConstraint? = nil,
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@
|
|||
import TIUIKitCore
|
||||
import UIKit
|
||||
|
||||
// TODO: make internal on release
|
||||
public extension WrappedViewLayout {
|
||||
extension WrappedViewLayout {
|
||||
func setupSize(widthConstraint: NSLayoutConstraint?,
|
||||
heightConstraint: NSLayoutConstraint?) {
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ open class StatefulButton: UIButton {
|
|||
public var additionalHitTestMargins: UIEdgeInsets = .zero
|
||||
|
||||
public var onDisabledStateTapHandler: VoidClosure?
|
||||
public var wrappedConstraints: SubviewConstraints?
|
||||
|
||||
private var eventPropagations: StateEventPropagations = [:]
|
||||
|
||||
|
|
@ -223,26 +222,8 @@ open class StatefulButton: UIButton {
|
|||
private func updateAppearance(to state: State) {
|
||||
if let appearance = stateAppearance[state] {
|
||||
configureUIButton(appearance: appearance)
|
||||
configureLayout(layout: appearance.layout)
|
||||
} else if state != .normal, let appearance = stateAppearance[.normal] {
|
||||
configureUIButton(appearance: appearance)
|
||||
configureLayout(layout: appearance.layout)
|
||||
}
|
||||
}
|
||||
|
||||
private func configureLayout(layout: UIView.DefaultWrappedLayout) {
|
||||
guard let constraints = wrappedConstraints else {
|
||||
return
|
||||
}
|
||||
|
||||
layout.setupSize(widthConstraint: constraints.widthConstraint, heightConstraint: constraints.heightConstraint)
|
||||
|
||||
layout.setupCenterYOffset(centerYConstraint: constraints.centerYConstraint,
|
||||
topConstraint: constraints.topConstraint,
|
||||
bottomConstraint: constraints.bottomConstraint)
|
||||
|
||||
layout.setupCenterXOffset(centerXConstraint: constraints.centerXConstraint,
|
||||
leadingConstraint: constraints.leadingConstraint,
|
||||
trailingConstraint: constraints.trailingConstraint)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue