When you create a SwiftUI view, the protocol defines that we need to return “some View”. The word “some” means that we are dealing with an opaque result type. This is a new feature added added in Swift 5.1. An opaque result type means that we must return one, and only one, of the specified type, in this case something that conforms to the “View” protocol.
This highlights a problem. Imagine if our view, ie… the part that the user interacts with on screen, was only able to show one Text field or perhaps one button, then interfaces would be incredibly boring.
[Read more…]