Skip to content

Commit

Permalink
Merge pull request #5 from Zandor300/fix/update-style-on-traitcollect…
Browse files Browse the repository at this point in the history
…iondidchange

Update background color when switching between light and dark mode.
  • Loading branch information
BastiaanJansen authored Nov 9, 2021
2 parents 1e21632 + 311a462 commit 91108c8
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 91108c8

Please sign in to comment.