Skip to content

Commit

Permalink
Use actual openURL method in demo (#1573)
Browse files Browse the repository at this point in the history
Fixes the following error on iOS 18:
```
The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO).
```

Related bug: https://youtrack.jetbrains.com/issue/CMP-6699
  • Loading branch information
ASalavei authored Sep 18, 2024
1 parent 620ff7e commit 27fa6f7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import platform.Foundation.NSURL.Companion.URLWithString
import platform.UIKit.UIApplication
import platform.Foundation.NSURL

val AnimationFreezeBug = Screen.Example("AnimationFreezeBug") {
Column(modifier = Modifier.fillMaxSize()) {
var state by remember { mutableStateOf(true) }
Switch(checked = state, onCheckedChange = {
state = it
UIApplication.sharedApplication.openURL(NSURL.URLWithString("app-settings:")!!)
UIApplication.sharedApplication.openURL(
url = URLWithString("app-settings:")!!,
options = emptyMap<Any?, Any>(),
completionHandler = null
)
})
}
}

0 comments on commit 27fa6f7

Please sign in to comment.