Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tvOS #48

Merged
merged 2 commits into from
Jul 7, 2023
Merged

tvOS #48

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import PackageDescription
let package = Package(
name: "AlertKit",
platforms: [
.iOS(.v13)
.iOS(.v13),
.tvOS(.v13)
],
products: [
.library(
Expand Down
1 change: 1 addition & 0 deletions SPAlert.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 2 additions & 0 deletions Sources/AlertKit/AlertHaptic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum AlertHaptic {
case none

func impact() {
#if os(iOS)
let generator = UINotificationFeedbackGenerator()
switch self {
case .success:
Expand All @@ -19,5 +20,6 @@ public enum AlertHaptic {
case .none:
break
}
#endif
}
}
4 changes: 4 additions & 0 deletions Sources/AlertKit/Views/AlertAppleMusic16View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Sources/AlertKit/Views/AlertAppleMusic17View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down