Skip to content

Commit

Permalink
Update background color on traitCollectionDidChange.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zandor300 committed Nov 8, 2021
1 parent 4d5b82b commit 311a462
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Toast/ToastViews/AppleToastView/AppleToastView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public class AppleToastView : UIView, ToastView {
style()
}

public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
UIView.animate(withDuration: 0.5) {
self.style()
}
}

private func style() {
layoutIfNeeded()
clipsToBounds = true
Expand Down

0 comments on commit 311a462

Please sign in to comment.