-
-
Notifications
You must be signed in to change notification settings - Fork 36
Lower deployment target to iOS 16 with availability gating #5
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
|
|
||
| import SwiftUI | ||
|
|
||
| @available(iOS 17, *) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This package is available on other platforms than iOS. You need to check for these platforms too |
||
| private struct StickerEffectViewModifier: ViewModifier { | ||
| @State private var motion: StickerMotion = .init() | ||
|
|
||
|
|
@@ -73,14 +74,15 @@ private struct StickerEffectViewModifier: ViewModifier { | |
| extension View { | ||
| @ViewBuilder | ||
| public func stickerEffect(_ isEnabled: Bool = true) -> some View { | ||
| if isEnabled { | ||
| if isEnabled, #available(iOS 17, *) { | ||
| modifier(StickerEffectViewModifier()) | ||
| } else { | ||
| self | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @available(iOS 17, *) | ||
| #Preview { | ||
| VStack { | ||
| Circle() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| import SwiftUI | ||
| import CoreMotion | ||
|
|
||
| @available(iOS 17, *) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it required here? I don't see any iOS 17+ related API here |
||
| public struct AccelerometerStickerMotionEffect: StickerMotionEffect { | ||
| let intensity: Double | ||
| let maxRotation: Angle | ||
|
|
@@ -45,6 +46,7 @@ public struct AccelerometerStickerMotionEffect: StickerMotionEffect { | |
| } | ||
| } | ||
|
|
||
| @available(iOS 17, *) | ||
| public extension StickerMotionEffect where Self == AccelerometerStickerMotionEffect { | ||
| static var accelerometer: Self { | ||
| .accelerometer() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to drop the macOS version to its iOS 16 equivalent too?