Relative Content

Tag Archive for macosswiftuimacos-sonoma

Questions arising out of a crash of a supersimple app in SwiftUI on MacOS (Sonoma)

struct ContentView: View { var body: some View { #if os(macOS) VStack { Button(“Open Window 2”) { Window2().openInWindow(title: “Window 2”, sender: self) } .contextMenu { Button(“window1menuItem”) { // Action for window1menuItem } } Image(systemName: “globe”) .imageScale(.large) .foregroundStyle(.tint) Text(“Hello, world!”) } #endif } } struct Window2: View { var body: some View { Text(“This is Window […]

Crash in SwiftUI on MacOS

struct ContentView: View { var body: some View { #if os(macOS) VStack { Button(“Open Window 2”) { Window2().openInWindow(title: “Window 2”, sender: self) } .contextMenu { Button(“window1menuItem”) { // Action for window1menuItem } } Image(systemName: “globe”) .imageScale(.large) .foregroundStyle(.tint) Text(“Hello, world!”) } #else NavigationView { VStack { NavigationLink(destination: Window2()) { Text(“Go to Detail View”) } } } […]