Skip to content

Comments

Deprecate defaultUIKitMain() in order to remove it#1585

Merged
ASalavei merged 4 commits intojb-mainfrom
andrei.salavei/postpone-vc-creation-in-defaultUIKitMain
Sep 30, 2024
Merged

Deprecate defaultUIKitMain() in order to remove it#1585
ASalavei merged 4 commits intojb-mainfrom
andrei.salavei/postpone-vc-creation-in-defaultUIKitMain

Conversation

@ASalavei
Copy link

@ASalavei ASalavei commented Sep 23, 2024

Currently the app crashes on a swipe back gesture, if the root controller is a UINavigationController.
The UIApplication should be initialized before the view controller is being created.
defaultUIKitMain should be moved to the demo app and should not be part of the public API.

Release Notes

Fixes - iOS

  • Deprecate defaultUIKitMain()

Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow template and fix release notes format.

As a follow-up item, it's required to change documentation/tutorials/examples

fun defaultUIKitMain(executableName: String, rootViewController: UIViewController)
= defaultUIKitMain(executableName) { rootViewController }

fun defaultUIKitMain(executableName: String, makeRootViewController: () -> UIViewController) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a final look of this API? Name? Package? Parameters?

Also:

  • No docs for public API

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method marked as deprecated.

@elijah-semyonov
Copy link

elijah-semyonov commented Sep 23, 2024

I think it's an accidental public API during transition to Beta. AFAIK, nobody but us uses it.

@ASalavei ASalavei changed the title Fix Swipe Back crash when app is launched from defaultUIKitMain Deprecate defaultUIKitMain() in order to remove it Sep 27, 2024
@ASalavei
Copy link
Author

@elijah-semyonov , thank for the info. I think we should deprecate it and remove from the public API.

@ASalavei ASalavei requested a review from MatkovIvan September 27, 2024 07:21
@ASalavei ASalavei requested a review from MatkovIvan September 27, 2024 09:24
@ASalavei ASalavei merged commit 0b943e4 into jb-main Sep 30, 2024
@ASalavei ASalavei deleted the andrei.salavei/postpone-vc-creation-in-defaultUIKitMain branch September 30, 2024 14:10
MatkovIvan added a commit that referenced this pull request Nov 18, 2025
Deprecated in #1585 (1.8.0) and had to be removed in 1.9, but it was
missed back then
It's the cause of
[CMP-9273](https://youtrack.jetbrains.com/issue/CMP-9273), so it's
another reason to remove it ASAP.

## Release Notes
### Migration Notes - iOS
- Removed deprecated since 1.8.0 `defaultUIKitMain()`. Please follow
[up-to-date guidelines to create an iOS
application](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants