How To Initialise a View's Body Property With a Switch (and Why You Probably Shouldn't)
Daily Coding Tip 290
Last tested on Xcode 15 beta 1
After my previous Daily Coding Tip, I was interested to know what the limitations of assigning a value to a property or variable.
The body
in a SwiftUI view is usually a computed property, meaning it’s kinda like a function that returns the opaque type some View
. If you know it’ll be the same …
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.