Skip to content

Commit

Permalink
Add guard statement
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller committed Jan 23, 2024
1 parent 7d32cef commit f3adaf0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Layout/Layout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,9 @@ public final class Layout { // swiftlint:disable:this type_body_length
/// https://developer.apple.com/documentation/uikit/uiview/1622595-updateconstraintsifneeded
/// ) on the ``view`` of the layout.
public func update() {
view?.setNeedsUpdateConstraints()
view?.updateConstraintsIfNeeded()
guard let view: UIView
else { return }
view.setNeedsUpdateConstraints()
view.updateConstraintsIfNeeded()
}
}

0 comments on commit f3adaf0

Please sign in to comment.