Earlier quoted context omitted.
Single-expression functions can now return a value without the “return” keyword: https://github.com/apple/swift-evolution/blob/master/proposa...
Yeah but the example code looks like multiple expressions?
SwiftUI
131–140 of 394 posts
Re: SwiftUI
#132Earlier quoted context omitted.
SwiftUI running through Catalyst, surely?
SwiftUI isn't confined to Catalyst. It's available to native Mac AppKit apps as well as UIKit apps. (At least it appears that way, going by the WWDC session descriptions. We'll know more in a couple of hours)
Re: SwiftUI
#133What has changed?
Re: SwiftUI
#134Re: SwiftUI
#135Re: SwiftUI
#136Apple developers will be glad they get to rewrite their entire application with a new UI framework and paradigm or risk their apps looking garbage on the platform (and stop working by next release). This must be the .. fifth entirely new UI framework from Apple?
This isn't true at all. Since iOS launched there has been UIKit and then this SwiftUI.
This isn't true at all. Since iOS launched there has been UIKit and then this SwiftUI.
They didn't say anything about iOS. There have been lots of UI frameworks from Apple, some abandoned before they were even finished:
QuickDraw, Quickdraw GX, HIToolbox, AppKit, Cocoa Touch/UIKit, Playgrounds/IB, SwiftUI
The constantly changing frameworks and languages are a useful strategy from platform vendors - they do help provide platform lockin, and make it very very difficult to provide cross platform apps. That is a real threat to Apple with offerings like flutter from Google. Of course there are other reasons to make a clean break with the past, but there is a lot of work just to stand still in developing for a platform like Mac OS or IOS - they don't highly value backwards compatibility and often introduce sweeping changes. Constant change is in the platform vendor's financial interest, and I don't think it's unfair to point that out.
Just to take one example - apps built for the original iOS are now almost entirely obsolete, and it's not worth reusing any of their code in a modern swift app.
Re: SwiftUI
#137Personally, as an iOS developer, this is by far the biggest announcement. Haven’t had the chance to dig deeper, but the comparison between the UITableViewController and that snippet containing just declarative code looks absolutely promising. The only downside is that we’ll have to wait one or two years before we can use it if older iOS versions still need to be supported. Let’s hope for extra quick adoption of iOS 1…
Re: SwiftUI
#138Personally, as an iOS developer, this is by far the biggest announcement. Haven’t had the chance to dig deeper, but the comparison between the UITableViewController and that snippet containing just declarative code looks absolutely promising. The only downside is that we’ll have to wait one or two years before we can use it if older iOS versions still need to be supported. Let’s hope for extra quick adoption of iOS 1…
Re: SwiftUI
#139.color(.gray)) What object is .gray acting on?
That syntax is a shortcut for UIColor.gray, so this is really: .color(UIColor.gray)
https://developer.apple.com/documentation/swiftui/color/3049...
Re: SwiftUI
#140To me this looks very similar to what Google is doing with Flutter.