-
Notifications
You must be signed in to change notification settings - Fork 105
Refactor compose container lifecycle delegate #2580
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
base: jb-main
Are you sure you want to change the base?
Conversation
compose/ui/ui-uikit/src/uikitMain/objc/CMPUIKitUtils/CMPUIKitUtils/CMPView.m
Show resolved
Hide resolved
| switch (self->_lifecycleState) { | ||
| case CMPComposeContainerLifecycleStateInitialized: | ||
| case CMPComposeContainerLifecycleStateStopped: | ||
| assert(false); |
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.
maybe we could either add a short comment on why these cases uses assert, or consider using NSAssert with an explanation? For the maintainability
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.
Good catch. That's actually an incorrect assertion. It should check only the Initialized because Stopped is a valid state here because we're not canceling the scheduled work item.
Preliminary refactoring before the https://youtrack.jetbrains.com/issue/CMP-8478/Implement-UIView-based-compose-injection-API
CMPViewControllerLifecycleDelegatetoCMPComposeContainerLifecycleDelegateas well as correspondingComposeContainerLifecycleDelegatein Kotlin code.CMPViewthat able to track visibility based on superview + window combination, similar to theCMPViewController.userInterfaceStyleDidChangeto monitor changes for various iOS versionsRelease Notes
N/A