can someone please tell me if I can change the color on below format using Color Set. For example, Instead of .blue, I want to use my own color set such as Color("colorname"). Is this possible
.onAppear {
UITableView.appearance().backgroundColor = .blue
}
3
Answers
UITableView.appearance().backgroundColor = UIColor(named: "your set here")
You could write a static extension for UIColor, like this:
You can then access this value from anywhere within your app just like the pre-defined colors (e.g.
.blue
, but instead of blue you use your custom name).You can create your own color like this:
After you can use it like this: