You can get light or dark variant of a color declared in assets automatically in SwiftUI by switching on your phone theme. If you choose the dark mode on your phone, the color appearance will be Dark Appearance, if Light, then Light Appearance.
You might also like
Update views on ForEach using StateObject - SwiftUI
public
–
1 min read
One of the beautiful things about SwiftUI is its useful managed state, by using an environment we can have live…
How to ask the user to review your app
public
–
1 min read
iOS 16+
If you import StoreKit into your SwiftUI app, you’ll gain access to an environment key called requestReview,…
Share content using the system share sheet - SwiftUI
public
–
1 min read
iOS 16+
SwiftUI’s ShareLink view makes it easy to share any kind of data from your app, as long…