Open xinzhengzhang opened 6 months ago
Thanks!
@elijah-semyonov, could you look at the suggestions? Let's discuss them next week?
Thanks for the report. Basically what you propose is a way to extend lifetime and have a way to control it explicitly, making it "you will not destroyed earlier, than I tell you". We will consider it because the usage case seems legitimate.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the problem
Discussion on the implementation of CMPViewController
Many system components, such as
UIPageViewController
,UITabViewController
, etc., all use a single ViewController mode, which also means that other ViewControllers that are not on the screen will be moved off the screen. At present, it is checked through a 0.5 second rotation to dispose if they are not there. Regarding this piece, it is actually inconvenient to use in many scenarios. Is this the design so that you want to save the uistate externally to pass it to the ComposeContainer? If not, can there be a better way to deal with it?At present, the poll is started in
viewWillAppear
, which means that at least the page will be dispose with a latency of 0.5 seconds. At the same time, I feel that poll is not a very elegant solution. I do know that there will be many problems with iOS lifecycle, such as incorrect distribution of lifecycles, such as problems that may still exist after viewDidAppear, so can we use some more valid mechanisms and use the current poll as a downgrade solution?Even crashes when container reappeared in window(See video) https://github.com/JetBrains/compose-multiplatform/assets/1487445/b1859760-390d-4ece-816a-12f89258371b
Proposal Increase ability to control lifecycle of ComposeContainer
lifecycleOwner
Affected platforms
Versions
Reproduction steps