dima.avdeev
1 year ago
committed by
GitHub
29 changed files with 246 additions and 147 deletions
@ -0,0 +1,27 @@
|
||||
import SwiftUI |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
TabView { |
||||
ComposeInsideSwiftUIScreen() |
||||
.tabItem { |
||||
Label("Group Chat", systemImage: "rectangle.3.group.bubble.left") |
||||
} |
||||
|
||||
YetAnotherSwiftUIScreen() |
||||
.tabItem { |
||||
Label("Settings", systemImage: "gear") |
||||
} |
||||
|
||||
} |
||||
.accentColor(Color(red: 0.671, green: 0.365, blue: 0.792)).preferredColorScheme(.light) |
||||
} |
||||
} |
||||
|
||||
let gradient = LinearGradient( |
||||
colors: [ |
||||
Color(red: 0.933, green: 0.937, blue: 0.953), |
||||
Color(red: 0.902, green: 0.941, blue: 0.949) |
||||
], |
||||
startPoint: .topLeading, endPoint: .bottomTrailing |
||||
) |
@ -1,30 +1,10 @@
|
||||
import SwiftUI |
||||
|
||||
let gradient = LinearGradient( |
||||
colors: [ |
||||
Color(red: 0.933, green: 0.937, blue: 0.953), |
||||
Color(red: 0.902, green: 0.941, blue: 0.949) |
||||
], |
||||
startPoint: .topLeading, endPoint: .bottomTrailing |
||||
) |
||||
|
||||
@main |
||||
struct iOSApp: App { |
||||
var body: some Scene { |
||||
WindowGroup { |
||||
TabView { |
||||
ComposeInsideSwiftUIScreen() |
||||
.tabItem { |
||||
Label("Group Chat", systemImage: "rectangle.3.group.bubble.left") |
||||
} |
||||
|
||||
YetAnotherSwiftUIScreen() |
||||
.tabItem { |
||||
Label("Settings", systemImage: "gear") |
||||
} |
||||
|
||||
} |
||||
.accentColor(Color(red: 0.671, green: 0.365, blue: 0.792)).preferredColorScheme(.light) |
||||
ContentView() |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,22 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ZStack { |
||||
Color.white.ignoresSafeArea(.all) // status bar color |
||||
ComposeView() |
||||
.ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler |
||||
}.preferredColorScheme(.light) |
||||
} |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
Main_iosKt.MainViewController() |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} |
||||
} |
@ -0,0 +1,21 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ZStack { |
||||
Color(#colorLiteral(red: 0.235, green: 0.247, blue: 0.255, alpha: 1)).ignoresSafeArea(.all) |
||||
ComposeView() |
||||
.ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler |
||||
}.preferredColorScheme(.dark) |
||||
} |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
Main_iosKt.MainViewController() |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} |
||||
} |
@ -0,0 +1,38 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ZStack { |
||||
ComposeView() |
||||
.ignoresSafeArea(.all) // Compose has own keyboard handler |
||||
VStack { |
||||
gradient.ignoresSafeArea(edges: .top).frame(height: 0) |
||||
Spacer() |
||||
} |
||||
}.preferredColorScheme(.dark) |
||||
} |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
let controller = Main_iosKt.MainViewController() |
||||
controller.overrideUserInterfaceStyle = .light |
||||
return controller |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { |
||||
} |
||||
} |
||||
|
||||
let gradient = LinearGradient( |
||||
colors: [ |
||||
Color.black.opacity(0.6), |
||||
Color.black.opacity(0.6), |
||||
Color.black.opacity(0.5), |
||||
Color.black.opacity(0.3), |
||||
Color.black.opacity(0.0), |
||||
], |
||||
startPoint: .top, endPoint: .bottom |
||||
) |
@ -1,41 +1,10 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
let gradient = LinearGradient( |
||||
colors: [ |
||||
Color.black.opacity(0.6), |
||||
Color.black.opacity(0.6), |
||||
Color.black.opacity(0.5), |
||||
Color.black.opacity(0.3), |
||||
Color.black.opacity(0.0), |
||||
], |
||||
startPoint: .top, endPoint: .bottom |
||||
) |
||||
|
||||
@main |
||||
struct iOSApp: App { |
||||
var body: some Scene { |
||||
WindowGroup { |
||||
ZStack { |
||||
ComposeView() |
||||
.ignoresSafeArea(.all) // Compose has own keyboard handler |
||||
VStack { |
||||
gradient.ignoresSafeArea(edges: .top).frame(height: 0) |
||||
Spacer() |
||||
} |
||||
}.preferredColorScheme(.dark) |
||||
} |
||||
} |
||||
ContentView() |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
let controller = Main_iosKt.MainViewController() |
||||
controller.overrideUserInterfaceStyle = .light |
||||
return controller |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { |
||||
} |
||||
} |
||||
|
@ -0,0 +1,17 @@
|
||||
import SwiftUI |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
TabView { |
||||
ComposeInSwiftUIScreen() |
||||
.tabItem { |
||||
Label("Compose in SwiftUI", systemImage: "star.fill") |
||||
} |
||||
|
||||
YetAnotherSwiftUIScreen() |
||||
.tabItem { |
||||
Label("SwiftUI", systemImage: "gear") |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
import SwiftUI |
||||
import shared |
||||
import UIKit |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ComposeViewControllerRepresentable() |
||||
.ignoresSafeArea(.all) |
||||
} |
||||
} |
@ -1,13 +1,10 @@
|
||||
import SwiftUI |
||||
import shared |
||||
import UIKit |
||||
|
||||
@main |
||||
struct iOSApp: App { |
||||
var body: some Scene { |
||||
WindowGroup { |
||||
ComposeViewControllerRepresentable() |
||||
.ignoresSafeArea(.all) |
||||
ContentView() |
||||
} |
||||
} |
||||
} |
||||
|
@ -0,0 +1,19 @@
|
||||
import SwiftUI |
||||
import shared |
||||
import UIKit |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ComposeViewControllerToSwiftUI() |
||||
.ignoresSafeArea(.all) |
||||
} |
||||
} |
||||
|
||||
struct ComposeViewControllerToSwiftUI: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
return Main_iosKt.ComposeEntryPoint() |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ComposeView() |
||||
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler |
||||
} |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
Main_iosKt.MainViewController() |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { |
||||
} |
||||
} |
@ -0,0 +1,19 @@
|
||||
import UIKit |
||||
import SwiftUI |
||||
import shared |
||||
|
||||
struct ContentView: View { |
||||
var body: some View { |
||||
ComposeView() |
||||
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler |
||||
} |
||||
} |
||||
|
||||
struct ComposeView: UIViewControllerRepresentable { |
||||
func makeUIViewController(context: Context) -> UIViewController { |
||||
Main_iosKt.MainViewController() |
||||
} |
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { |
||||
} |
||||
} |
Loading…
Reference in new issue