This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| @main | |
| struct SplitMREApp: App { | |
| var body: some Scene { | |
| WindowGroup { | |
| ContentView() | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| @State private var isSheetPresented = false | |
| var body: some View { | |
| NavigationStack { | |
| Button("Present sheet") { | |
| isSheetPresented = true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| Button("increment") { | |
| Task { | |
| await CountActor.shared.increment() | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ContentView: View { | |
| @State private var translationWidth = 0.0 | |
| var body: some View { | |
| VStack { | |
| List(0...1000, id: \.self) { | |
| Text("\($0)") | |
| } | |
| Text("\(translationWidth)") | |
| .padding(16) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import Observation | |
| struct ContentView: View { | |
| @State var member = Member(name: "Swift") | |
| var body: some View { | |
| VStack(spacing: 24) { | |
| Text("\(member.name)") | |
| Text("\(member.subscription ? "Member" : "Guest")") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
| var window: UIWindow? | |
| func scene( | |
| _ scene: UIScene, | |
| willConnectTo session: UISceneSession, | |
| options connectionOptions: UIScene.ConnectionOptions | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| VStack { | |
| Text("Drag me") | |
| .font(.largeTitle) | |
| .padding() | |
| .frame(maxWidth: .infinity, idealHeight: 200) | |
| .border(.blue) |