SwiftUI lets us build declarative user interfaces in Swift. There's a new declarative UI structure that defines how our layouts look and work. Updating the UI preview automatically generates new Swift code, and changing the Swift code updates the UI preview.
I am not sure if these are the best practises to do things in SwiftUI. I removed all the preview code as i was running MacOS Mojave and there's no preview available yet.
Swift 5, iOS 13, Xcode 11 beta