Michael Paus
10/27/2022, 1:06 PMdefaultUIKitMain
.
I tried to apply that to my application too but I failed to get at the UIApplication
object in this new setup. As far as I understand the API this object is needed, e.g, to
call methods like openURL
which I need for my application. Does anybody know how to get at
the UIApplication
object or knows an alternative?Landry Norris
10/27/2022, 1:13 PMdefaultUIKitMain
seems to be a convenience method for simple use cases. If you need extra functionality, it may be best to do it the old way.Michael Paus
10/27/2022, 1:18 PMdefaultUIKitMain
would just return this important object instead of Unit
? Otherwise this convenience method is not very convenient 😉.Michael Paus
10/27/2022, 1:33 PMUIApplication.sharedApplication
which seems to provide what I need. At least my code is working again now and I can open an URL from my iOS Compose (Canvas) application again.darkmoon_uk
10/27/2022, 10:42 PMimport shared
@main
struct Main {
static func main() {
MainKt.main()
}
}
...and I've seen that others can get that down to a one-liner, even!Michael Paus
10/28/2022, 6:33 PMLandry Norris
10/28/2022, 7:43 PMLandry Norris
10/28/2022, 7:44 PMayodele
10/29/2022, 4:21 PMayodele
10/29/2022, 4:22 PMayodele
10/29/2022, 4:23 PMLandry Norris
10/29/2022, 9:18 PMayodele
10/30/2022, 6:00 AM