-
Notifications
You must be signed in to change notification settings - Fork 22
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
In example of @StateObject style, WatchShaker has go be inherited with ObservableObject #14
Comments
extension WatchShaker : ObservableObject { }
extension Shake : Equatable {
public static func == (lhs: Shake, rhs: Shake) -> Bool {
lhs.direction == rhs.direction && lhs.sensibility == rhs.sensibility
}
} |
Thanks @szagun , good hint. I tried, and it revert with this when shake is detected. I believe the code itself are not optimized with the @mainactor so to update in main thread and main queue?
|
@lorenzhk This is fixed on the latest commit. Remove the package from your project and re-add it, this time set You should read the package source code, it's really quite simple. Anyways, hf and build something great! |
Cool, thx for the hint @szagun . It did fix the issue above. Besides, i doubt Shake class perhaps need to include |
Beside the captioned issue, looks like "isShakerAvailable" is not the right published variable to look at to detect a Shake? Wonder how the library can be tweaked to support native SwiftUI lifecycle to trigger action given a shake. Thanks.
The text was updated successfully, but these errors were encountered: