Browse Source

Small changes in iOS interop examples (#3813)

This changes was requested by technical writers team
bench_with_kwasm
dima.avdeev 7 months ago committed by GitHub
parent
commit
1e89d23964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/interop/ios-compose-in-swiftui/README.md
  2. 2
      examples/interop/ios-compose-in-swiftui/iosApp/iosApp/ComposeViewControllerInSwiftUI.swift
  3. BIN
      examples/interop/ios-compose-in-swiftui/screenshot.png
  4. 4
      examples/interop/ios-compose-in-uikit/README.md
  5. 2
      examples/interop/ios-compose-in-uikit/iosApp/iosApp/AppDelegate.swift
  6. BIN
      examples/interop/ios-compose-in-uikit/screenshot.png
  7. 4
      examples/interop/ios-swiftui-in-compose/README.md
  8. 2
      examples/interop/ios-swiftui-in-compose/iosApp/iosApp/ComposeViewControllerRepresentable.swift
  9. BIN
      examples/interop/ios-swiftui-in-compose/screenshot.png
  10. 2
      examples/interop/ios-swiftui-in-compose/shared/src/iosMain/kotlin/main.ios.kt
  11. 4
      examples/interop/ios-uikit-in-compose/README.md
  12. BIN
      examples/interop/ios-uikit-in-compose/screenshot.png
  13. 2
      examples/interop/ios-uikit-in-compose/shared/src/iosMain/kotlin/main.ios.kt

4
examples/interop/ios-compose-in-swiftui/README.md

@ -1,6 +1,6 @@
# Compose in SwiftUI
# Compose Multiplatform in SwiftUI
This example shows how to use Compose inside an iOS Application written in SwiftUI.
This example shows how to use Compose Multiplatform inside an iOS Application written in SwiftUI.
Entry point is `struct ContentView` in file [ContentView.swift](iosApp%2FiosApp%2FContentView.swift).

2
examples/interop/ios-compose-in-swiftui/iosApp/iosApp/ComposeViewControllerInSwiftUI.swift

@ -5,7 +5,7 @@ import MapKit
struct ComposeLayer: View {
var body: some View {
ScreenTemplate(title: "Compose in SwiftUI") {
ScreenTemplate(title: "Compose Multiplatform in SwiftUI") {
ComposeViewControllerInSwiftUI()
.ignoresSafeArea(.keyboard) // Compose has its own keyboard handler
}

BIN
examples/interop/ios-compose-in-swiftui/screenshot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 71 KiB

4
examples/interop/ios-compose-in-uikit/README.md

@ -1,5 +1,5 @@
# Compose in UIKit
# Compose Multiplatform in UIKit
This example shows how you can set up an interop between Compose and iOS UIKit UIViewController.
This example shows how you can set up an interop between Compose Multiplatform and iOS UIKit UIViewController.
![screenshot.png](screenshot.png)

2
examples/interop/ios-compose-in-uikit/iosApp/iosApp/AppDelegate.swift

@ -11,7 +11,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15)], for: .normal)
let composeViewController = Main_iosKt.ComposeEntryPoint()
composeViewController.title = "Compose inside UIKit"
composeViewController.title = "Compose Multiplatform inside UIKit"
let anotherViewController = UIKitViewController()
anotherViewController.title = "UIKit"

BIN
examples/interop/ios-compose-in-uikit/screenshot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 59 KiB

4
examples/interop/ios-swiftui-in-compose/README.md

@ -1,6 +1,6 @@
# SwiftUI in Compose
# SwiftUI in Compose Multiplatform
This example shows how to use a SwiftUI view in a Compose application.
This example shows how to use a SwiftUI view in a Compose Multiplatform application.
Pay attention to file [main.ios.kt](shared%2Fsrc%2FiosMain%2Fkotlin%2Fmain.ios.kt) and [ComposeViewControllerRepresentable.swift](iosApp%2FiosApp%2FComposeViewControllerRepresentable.swift)
![screenshot.png](screenshot.png)

2
examples/interop/ios-swiftui-in-compose/iosApp/iosApp/ComposeViewControllerRepresentable.swift

@ -8,7 +8,7 @@ struct ComposeViewControllerRepresentable: UIViewControllerRepresentable {
return Main_iosKt.ComposeEntryPointWithUIView(createUIView: { () -> UIView in
SwiftUIInUIView(
content: VStack {
Text("SwiftUI in Compose")
Text("SwiftUI in Compose Multiplatform")
}
)
})

BIN
examples/interop/ios-swiftui-in-compose/screenshot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 53 KiB

2
examples/interop/ios-swiftui-in-compose/shared/src/iosMain/kotlin/main.ios.kt

@ -20,7 +20,7 @@ fun ComposeEntryPointWithUIView(createUIView: () -> UIView): UIViewController =
.windowInsetsPadding(WindowInsets.systemBars),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text("How to use SwiftUI inside Compose")
Text("How to use SwiftUI inside Compose Multiplatform")
UIKitView(
factory = createUIView,
modifier = Modifier.size(300.dp).border(2.dp, Color.Blue),

4
examples/interop/ios-uikit-in-compose/README.md

@ -1,6 +1,6 @@
# UIKit in Compose
# UIKit in Compose Multiplatform
This example shows how to use a UIKitView in a Compose application.
This example shows how to use a UIKitView in a Compose Multiplatform application.
Pay attention to file [main.ios.kt](shared%2Fsrc%2FiosMain%2Fkotlin%2Fmain.ios.kt)
![screenshot.png](screenshot.png)

BIN
examples/interop/ios-uikit-in-compose/screenshot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 224 KiB

2
examples/interop/ios-uikit-in-compose/shared/src/iosMain/kotlin/main.ios.kt

@ -21,7 +21,7 @@ fun ComposeEntryPoint(): UIViewController =
.windowInsetsPadding(WindowInsets.systemBars),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text("How to use UIKitView inside Compose")
Text("How to use UIKitView inside Compose Multiplatform")
UIKitView(
factory = { MKMapView() },

Loading…
Cancel
Save