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

How you preview the live activity UI on development? #2

Closed
Yggdrasilqh opened this issue Jul 30, 2022 · 3 comments
Closed

How you preview the live activity UI on development? #2

Yggdrasilqh opened this issue Jul 30, 2022 · 3 comments

Comments

@Yggdrasilqh
Copy link

It's a helpful and amazing demo!

but I don't see any preview code on this demo. I wanna know how to preview the activity widget use the PreviewProvider ? or you just run entire app to preview the UI?

struct live_activities_Previews: PreviewProvider {
    static var previews: some View {
        live_activitiesEntryView(context: !how to create this!)
            .previewContext(WidgetPreviewContext(family: .systemSmall))
    }
}

Thanks!

@1998code
Copy link
Owner

1998code commented Jul 30, 2022

Hi. I cannot find how to preview the live activities widget in Apple Developer Documentation.
The thing is still in beta. So, I simply run the app to preview the UI.

Or you may preview the widget design first, then copy the code back to the Live Widget(s).
CleanShot 2022-07-30 at 23 46 10@2x

Hope help :) @Yggdrasilqh

@Yggdrasilqh
Copy link
Author

Hi. I cannot find how to preview the live activities widget in Apple Developer Documentation. The thing is still in beta. So, I simply run the app to preview the UI.

Or you may preview the widget design first, then copy the code back to the Live Widget(s). CleanShot 2022-07-30 at 23 46 10@2x

Hope help :) @Yggdrasilqh

Oh, that's a good idea!
thanks for your reply. have a good day!

@1998code
Copy link
Owner

1998code commented Jan 16, 2023

@Yggdrasilqh Sample is updated with preview (iOS 16.2 or above)
https://github.com/1998code/iOS16-Live-Activities#xcode-preview-ios-162-or-above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants