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}
Post
Replies
Boosts
Views
Activity
Yes it is,
I can't save the color there next to the appicon in the small color square with the white color, while I set the color(any) to the large Universal squares.
One large window underneath is gray and has a warning on it: not assigned. On the other large squares I have marked the color(whatever).
How can I assign color settings to unassigned children so that the custom colors are visible in the app in the font background and foreground ?
Xcode version is 12.3 swift 5.
I'm sure I chose the color as you write. Maybe it needs to type the right command in the terminal ? I named the color and selected the color in color settings, but it doesn't want to color with this color the little square next to appicon color(color name) is still white.
I probably need to assign a color name with swift code 5. The color in the little square next to the appicon is already there.
I solved the problem, thank you.
I am giving up on notifications, instead I would like to remove the code error: cannot use instance member 'number' within property initializer; property initializers run before 'self' is available from code:
let number = "same number"
let absolute = abs(number)
At first I want to check without code if it works. after removing this error it should work on a blank screen.
Defining struct alone did not help, the error still occurs.
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()
}
}
After correcting the error, this error appeared:
Cannot find '$contentData' in scope
Can you give me an example of an argument ?
The body is already defined,