Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deprecate defaultUIKitMain() in order to remove it #1585

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@

package androidx.compose.ui.main

import kotlinx.cinterop.*
import platform.UIKit.*
import platform.Foundation.*
import kotlinx.cinterop.ObjCObjectBase
import kotlinx.cinterop.autoreleasepool
import kotlinx.cinterop.cstr
import kotlinx.cinterop.memScoped
import kotlinx.cinterop.toCValues
import platform.Foundation.NSStringFromClass
import platform.UIKit.UIApplication
import platform.UIKit.UIApplicationDelegateProtocol
import platform.UIKit.UIApplicationDelegateProtocolMeta
import platform.UIKit.UIApplicationMain
import platform.UIKit.UIResponder
import platform.UIKit.UIResponderMeta
import platform.UIKit.UIScreen
import platform.UIKit.UIViewController
import platform.UIKit.UIWindow

private var _rootViewController: UIViewController? = null

@Deprecated(
"Crashes app under some circumstances. Will be removed in the upcoming release.",
ReplaceWith("Create UIApplication on your own if needed.")
)
fun defaultUIKitMain(executableName: String, rootViewController: UIViewController) {
_rootViewController = rootViewController
val args = emptyArray<String>()
Expand All @@ -34,6 +50,10 @@ fun defaultUIKitMain(executableName: String, rootViewController: UIViewControlle
}
}

@Deprecated(
"Will be removed in the upcoming release.",
ReplaceWith("Implement UIApplicationDelegate on your own if needed.")
)
class DefaultIOSAppDelegate : UIResponder, UIApplicationDelegateProtocol {
companion object Companion : UIResponderMeta(), UIApplicationDelegateProtocolMeta

Expand Down