Skip to content

Commit 443cfee

Browse files
committed
tvOS
1 parent cdefb28 commit 443cfee

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import PackageDescription
55
let package = Package(
66
name: "AlertKit",
77
platforms: [
8-
.iOS(.v13)
8+
.iOS(.v13),
9+
.tvOS(.v13)
910
],
1011
products: [
1112
.library(

Sources/AlertKit/AlertHaptic.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public enum AlertHaptic {
88
case none
99

1010
func impact() {
11+
#if os(iOS)
1112
let generator = UINotificationFeedbackGenerator()
1213
switch self {
1314
case .success:
@@ -19,5 +20,6 @@ public enum AlertHaptic {
1920
case .none:
2021
break
2122
}
23+
#endif
2224
}
2325
}

Sources/AlertKit/Views/AlertAppleMusic16View.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ public class AlertAppleMusic16View: UIView {
1919

2020
private lazy var backgroundView: UIVisualEffectView = {
2121
let view: UIVisualEffectView = {
22+
#if !os(tvOS)
2223
if #available(iOS 13.0, *) {
2324
return UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial))
2425
} else {
2526
return UIVisualEffectView(effect: UIBlurEffect(style: .light))
2627
}
28+
#else
29+
return UIVisualEffectView(effect: UIBlurEffect(style: .light))
30+
#endif
2731
}()
2832
view.isUserInteractionEnabled = false
2933
return view

Sources/AlertKit/Views/AlertAppleMusic17View.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ public class AlertAppleMusic17View: UIView {
1919

2020
private lazy var backgroundView: UIVisualEffectView = {
2121
let view: UIVisualEffectView = {
22+
#if !os(tvOS)
2223
if #available(iOS 13.0, *) {
2324
return UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial))
2425
} else {
2526
return UIVisualEffectView(effect: UIBlurEffect(style: .light))
2627
}
28+
#else
29+
return UIVisualEffectView(effect: UIBlurEffect(style: .light))
30+
#endif
2731
}()
2832
view.isUserInteractionEnabled = false
2933
return view

0 commit comments

Comments
 (0)