diff --git a/Package.swift b/Package.swift index 873a8aa..8b612f3 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,8 @@ import PackageDescription let package = Package( name: "AlertKit", platforms: [ - .iOS(.v13) + .iOS(.v13), + .tvOS(.v13) ], products: [ .library( diff --git a/SPAlert.podspec b/SPAlert.podspec index dda12ba..4eb75c0 100644 --- a/SPAlert.podspec +++ b/SPAlert.podspec @@ -10,6 +10,7 @@ Pod::Spec.new do |s| s.swift_version = '5.1' s.ios.deployment_target = '13.0' + s.tvos.deployment_target = '13.0' s.source_files = 'Sources/AlertKit/**/*.swift' diff --git a/Sources/AlertKit/AlertHaptic.swift b/Sources/AlertKit/AlertHaptic.swift index 231b01e..1b1d7d3 100644 --- a/Sources/AlertKit/AlertHaptic.swift +++ b/Sources/AlertKit/AlertHaptic.swift @@ -8,6 +8,7 @@ public enum AlertHaptic { case none func impact() { + #if os(iOS) let generator = UINotificationFeedbackGenerator() switch self { case .success: @@ -19,5 +20,6 @@ public enum AlertHaptic { case .none: break } + #endif } } diff --git a/Sources/AlertKit/Views/AlertAppleMusic16View.swift b/Sources/AlertKit/Views/AlertAppleMusic16View.swift index 5b29abc..2e2d945 100644 --- a/Sources/AlertKit/Views/AlertAppleMusic16View.swift +++ b/Sources/AlertKit/Views/AlertAppleMusic16View.swift @@ -19,11 +19,15 @@ public class AlertAppleMusic16View: UIView { private lazy var backgroundView: UIVisualEffectView = { let view: UIVisualEffectView = { + #if !os(tvOS) if #available(iOS 13.0, *) { return UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial)) } else { return UIVisualEffectView(effect: UIBlurEffect(style: .light)) } + #else + return UIVisualEffectView(effect: UIBlurEffect(style: .light)) + #endif }() view.isUserInteractionEnabled = false return view diff --git a/Sources/AlertKit/Views/AlertAppleMusic17View.swift b/Sources/AlertKit/Views/AlertAppleMusic17View.swift index 50681ea..0cda0f3 100644 --- a/Sources/AlertKit/Views/AlertAppleMusic17View.swift +++ b/Sources/AlertKit/Views/AlertAppleMusic17View.swift @@ -19,11 +19,15 @@ public class AlertAppleMusic17View: UIView { private lazy var backgroundView: UIVisualEffectView = { let view: UIVisualEffectView = { + #if !os(tvOS) if #available(iOS 13.0, *) { return UIVisualEffectView(effect: UIBlurEffect(style: .systemThickMaterial)) } else { return UIVisualEffectView(effect: UIBlurEffect(style: .light)) } + #else + return UIVisualEffectView(effect: UIBlurEffect(style: .light)) + #endif }() view.isUserInteractionEnabled = false return view