feat: update demo

This commit is contained in:
2024-01-02 11:12:19 +08:00
parent 70e79cc3b3
commit b7a8fd1744
6 changed files with 22 additions and 40 deletions

View File

@@ -0,0 +1,15 @@
import UIKit
import shared
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = App_iosKt.createUIViewController()
window?.makeKeyAndVisible()
return true
}
}

View File

@@ -1,19 +0,0 @@
import UIKit
import SwiftUI
import shared
struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let viewController = App_iosKt.createUIViewController()
return viewController
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
var body: some View {
ComposeView()
.ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler
}
}

View File

@@ -1,10 +0,0 @@
import SwiftUI
@main
struct iOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}