mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Revert "remove unnecessary guard statement"
This reverts commit 272162ddb7.
This commit is contained in:
@@ -443,6 +443,8 @@ open class MessageInputBar: UIView {
|
||||
/// - Parameter positions: The UIStackView's to layout
|
||||
public func layoutStackViews(_ positions: [InputStackView.Position] = [.left, .right, .bottom, .top]) {
|
||||
|
||||
guard superview != nil else { return }
|
||||
|
||||
for position in positions {
|
||||
switch position {
|
||||
case .left:
|
||||
@@ -507,6 +509,7 @@ open class MessageInputBar: UIView {
|
||||
$0.parentStackViewPosition = position
|
||||
leftStackView.addArrangedSubview($0)
|
||||
}
|
||||
guard superview != nil else { return }
|
||||
leftStackView.layoutIfNeeded()
|
||||
case .right:
|
||||
rightStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
@@ -516,6 +519,7 @@ open class MessageInputBar: UIView {
|
||||
$0.parentStackViewPosition = position
|
||||
rightStackView.addArrangedSubview($0)
|
||||
}
|
||||
guard superview != nil else { return }
|
||||
rightStackView.layoutIfNeeded()
|
||||
case .bottom:
|
||||
bottomStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
@@ -525,6 +529,7 @@ open class MessageInputBar: UIView {
|
||||
$0.parentStackViewPosition = position
|
||||
bottomStackView.addArrangedSubview($0)
|
||||
}
|
||||
guard superview != nil else { return }
|
||||
bottomStackView.layoutIfNeeded()
|
||||
case .top:
|
||||
topStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
@@ -534,6 +539,7 @@ open class MessageInputBar: UIView {
|
||||
$0.parentStackViewPosition = position
|
||||
topStackView.addArrangedSubview($0)
|
||||
}
|
||||
guard superview != nil else { return }
|
||||
topStackView.layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user