Когда сцены вводя /p>
Код: Выделить всё
import Foundation
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
}
< /code>
scenedelegate.swift:
import Foundation
import UIKit
import ComposeApp
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else {
return
}
window = UIWindow(frame: windowScene.screen.bounds)
window?.windowScene = windowScene
window?.rootViewController = UINavigationController(rootViewController: MainViewControllerKt.MainViewController())
window?.makeKeyAndVisible()
}
}
< /code>
mainviewcontroller.kt (в Multiplin Multiplyform модуль Kotlin): < /p>
import androidx.compose.ui.window.ComposeUIViewController
fun MainViewController() = ComposeUIViewController { App() }
< /code>
app.kt (в модуле мультиплатформы Kotlin): < /p>
@Composable
@Preview
fun App() {
Box(modifier = Modifier
.fillMaxSize()
.systemBarsPadding()
.background(Color.Yellow)
)
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... op-padding