Skip to content

Commit

Permalink
Merge pull request #48 from RomanPodymov/v5
Browse files Browse the repository at this point in the history
tvOS
  • Loading branch information
ivanvorobei authored Jul 7, 2023
2 parents cdefb28 + 7d51d4d commit 465ffbf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
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

0 comments on commit 465ffbf

Please sign in to comment.