1998code / iOS16-Live-Activities

SwiftPizza App for Apple ActivityKit & WidgetKit & Dynamic Island.

Home Page:https://oss.1998.media/doc/live-activities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How you preview the live activity UI on development?

Yggdrasilqh opened this issue · comments

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!

commented

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

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!