-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Examples] Declare store as static to avoid interference with Xcode previews #3618
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
[Examples] Declare store as static to avoid interference with Xcode previews #3618
Conversation
…ce with Xcode previews
stephencelis
left a comment
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.
@meltsplit Thanks for the PR! I think we'd definitely take the static change but I've made a few suggestions in one of the examples. Want to apply them to the rest? Then we'll be happy to merge your contributions 😄
|
|
||
| @MainActor |
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.
I don't believe this is needed since the App protocol is @MainActor.
| @MainActor |
| if isTesting { | ||
| EmptyView() | ||
| } else { | ||
| SearchView(store: Self.store) | ||
| } |
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.
Since we're not doing UI tests I think we can simplify:
| if isTesting { | |
| EmptyView() | |
| } else { | |
| SearchView(store: Self.store) | |
| } | |
| SearchView(store: Self.store) |
e63ad43 to
0b11dff
Compare
|
Thanks. @stephencelis I also removed |
Examples/SpeechRecognition/SpeechRecognition/SpeechRecognitionApp.swift
Outdated
Show resolved
Hide resolved
|
Thanks! |
|
@stephencelis |
Hi!
I am studying the example apps by referring to the tutorial.
I standardized the App.swift file.
Changes made:
I hope this change will help developers understand the testing and preview mechanisms better.