Apple just announced a new framework SwiftUI that uses a "declarative syntax", and includes features in Xcode that allow editing source code and seeing the user interface changes live (it's not clear to me yet whether that can be done while the application is running, or only with a non-interactive preview of the UI) https://developer.apple.com/xcode/swiftui/
06/03/2019, 8:57 PM
This was rumoured over a year ago under the codename "Amber"
At first glance, I think the editor tool features look more exciting than the framework, but there's not much information yet. Will be curious to see what they discuss in the Platforms State of the Union this afternoon.
Looks a bit like flutter - wonder if someone has enough knowledge of both to comment?
06/09/2019, 12:11 PM
I don’t know anything about Flutter, but some things about SwiftUI and Xcode Previews (which works with SwiftUI code, but also “classic” UIKit, AppKit, WatchKit UIs in Swift or Objective-C).
The tooling for previews uses live code injection and rebuilds only the current view while editing. Smaller edits like changing constant strings don’t require a rebuild and are changed directly. Performance looks good, great even, if you’re familiar with the previous Simulator build-run cycle. For developers on the platform, it's a huge productivity leap.
Xcode Previews supports a “Live” mode feature, which switches into full simulation and provides full interactivity, including high-performance graphics rendering and animation.
Haven’t played much with it yet, but judging from the material I watched/read and the early feedback from the developer community, this is a huge step forward for the platform that was lagging behind in its live coding capabilities. It feels like they closed the gap in developer experience to React Native, possibly even more than just that.
There are tons of sessions about it, this one seems to have the most information about Xcode Previews: https://developer.apple.com/wwdc19/233
SwiftUI also seems to be quite thoroughly designed and supports a lot more customization than I was anticipating. Need to spend more time with it, but I have a feeling it was dramatically undersold in the keynote and SOTU. We will likely look back to this year's WWDC as one of the most significant ones. Certainly since the introduction of Swift, possibly even more important than that.
SwiftUI is also significant because it shows Apple's idea of framework and API design when you finally take advantage of all the power designed into the language. So far, they couldn’t really do that because almost all frameworks were still Objective-C based. Clearly, a more declarative approach combined (hehe) with some reactive programming is the direction they’re headed. I’m still trying to wrap my head around property wrappers, a new language feature in Swift 5.1, which seems inspired by pure functional programming (looks very monad-ish) but done in a clever way that gets rid of all the functional or math-y ceremony around it. I’ve said it before and will say it again: Swift is bringing all the functional ideas to imperative programmers without them even noticing.
Here's more about that: https://developer.apple.com/wwdc19/415
Disclaimer: I used to be an Evangelist for Developer Tools at Apple so I'm clearly biased. On the other hand if you’re interested you can ask me anything about it and I’ll be happy to tell you more about it. :-)