Merge pull request #48 from RomanPodymov/v5

tvOS
This commit is contained in:
Ivan Vorobei
2023-07-07 11:25:57 +03:00
committed by GitHub
5 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -5,7 +5,8 @@ import PackageDescription
let package = Package(
name: "AlertKit",
platforms: [
.iOS(.v13)
.iOS(.v13),
.tvOS(.v13)
],
products: [
.library(
+1
View File
@@ -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'
+2
View File
@@ -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
}
}
@@ -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
@@ -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