Created
April 9, 2021 17:52
-
-
Save OskarGroth/75674187041c09b36ffbf297c16706d4 to your computer and use it in GitHub Desktop.
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 SwiftApp: App { | |
@State var someState = false | |
var body: some Scene { | |
WindowGroup { | |
Rectangle() | |
.foregroundColor(someState ? .blue : .secondary) | |
.frame(width: 200, height: 200) | |
.padding(50) | |
.onTapGesture { | |
someState = !someState | |
} | |
.navigationTitle("SwiftUI Title") | |
.onAppear { | |
DispatchQueue.main.async { | |
NSApp.windows.first?.title = "Overridden Title" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment