Skip to content

Commit 8f82bd5

Browse files
committed
Fix bug with ovveride interface style
1 parent a4524de commit 8f82bd5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

SPAlert.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "SPAlert"
4-
s.version = "2.0.15"
4+
s.version = "2.0.16"
55
s.summary = "Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets."
66
s.homepage = "https://github.com/IvanVorobei/SPAlert"
77
s.source = { :git => "https://github.com/IvanVorobei/SPAlert.git", :tag => s.version }

Source/SPAlert/Views/SPAlertView.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,14 @@ open class SPAlertView: UIView {
271271
*/
272272
private var isDarkMode: Bool {
273273
if #available(iOS 12.0, *) {
274-
if traitCollection.userInterfaceStyle == .dark {
274+
switch UIApplication.shared.windows.first?.traitCollection.userInterfaceStyle ?? .light {
275+
case .dark:
275276
return true
276-
} else {
277+
case .light:
278+
return false
279+
case .unspecified:
280+
return false
281+
@unknown default:
277282
return false
278283
}
279284
} else {

0 commit comments

Comments
 (0)