Post

Replies

Boosts

Views

Activity

Reply to Custom color management
Hi, this is my code : import SwiftUI struct ColorManager { // create static variables for custom colors static let spotifyGreen = Color("SpotifyGreen") //... add the rest of your colors here} // Or you can use an extension// this will allow you to just type .spotifyGreen and you wont have to use ColorManager.spotifyGreenextension Color { static let spotifyGreen = Color("SpotifyGreen") // ... add the rest of your colors here}
Jan ’21
Reply to Closure containing a declaration cannot be used with result builder 'ViewBuilder'
Again, the error appears : Closure containing a declaration cannot be used with result builder 'ViewBuilder' : struct ContentView_Previews: PreviewProvider { // <- error Closure containing a declaration cannot be used with result builder 'ViewBuilder' and  Struct 'ViewBuilder' declared here (SwiftUI.ViewBuilder)     static var previews: some View {         ContentView()     } }     static var previews: some View {         ContentView()     }        }
Sep ’21