Set SwiftUI backgroundColor the same way as foregroundColor
Daily Coding Tip 009
It’s useful that SwiftUI has a modifier called .background() so that you can add any kind of view behind the current view. Instead of being limited to colour, your background could be an image or a more complicated shape. But when I use the .foregroundColor() modifier, I take advantage of the fact that a Color is expected by g…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.


