-
Notifications
You must be signed in to change notification settings - Fork 44
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
[WIP] WorkflowSwiftUI without ObservedObject #253
[WIP] WorkflowSwiftUI without ObservedObject #253
Conversation
import WorkflowUI | ||
|
||
public extension Screen where Self: View { | ||
func viewControllerDescription(environment: ViewEnvironment) -> ViewControllerDescription { |
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.
Clever!
Update: @mjohnson12 tested under iOS 15 and found the same broken animation for iOS.15.2.mp4 |
Experiment to see if this affects the iOS 15 issue[1]. It doesn't. [1]: #253 (comment)
9f3c49d
to
1997b06
Compare
…are/workflow-swift into tomb/swiftui-no-observableobject * 'tomb/swiftui-testbed-workflowswiftui' of github.com:square/workflow-swift: add animation(_:value:) modifier
Experiment:
SwiftUIScreen
protocol. SwiftUI View conforms directly toScreen
ObservableValue
. SwiftUI View has multiple, plain, value-typed properties instead of a single@ObservedObject
modelUIHostingController.rootView
This approach previously resulted in animation issues documented in Binding SwiftUI Views to Workflow Renderings and 2020's WorkflowView, but I saw none in the SwiftUITestbed app under Xcode 14 and iOS 16.
This approach might lead to more view body evaluations, but after my performance noodling last month, I think those evaluations are cheap as long as they don't trigger additional work in the Core Animation commit phase.