SwiftUI looks like it can bridge that final gap I’ve had with my Metal and SpriteKit projects, which were almost entirely cross platform. There will still likely be distinctions in touch handling vs mouse — I haven’t had time to fully explore SwiftUI yet — but I’m looking forward to simplifying the code even further.
Cross-platform Metal and SpriteKit? Wouldn't it be better to code against Vulkan (== MoltenVK) or OpenGL if being cross platform is the goal?
Or do you mean "cross platform" as for example Microsoft has often done. Within their platforms.
Current difficulty of developing native cross platform projects is depressing. You have to use domain specific tools like Unity, React Native, etc. Or just target the web browsers.
Mac OS / iOS / tvOS / WatchOS are certainly different platforms. The iPhone and the Mac are very different products with very different use cases, so of course they are different platforms.
It's not "all-platform", but this is definitely "cross-platform".
There's far more to building a cross platform app than making sure the UI fits on both screens. I might have missed it but does Apple plan to consolidate things like file system, networking, installation lifecycle, and notifications?
The core APIs are the same, so you get most things for free — file system, networking, media recording/playback, graphics, and more.
Installation takes place before the app gets to run any code. Notifications are similar enough to be hidden under a tiny abstraction (macOS even supports Push notifications, although I’m not aware of any app that uses them).
Really, UI was the only area where you could feel like you’re developing for different operating systems.
How does SwiftUI help for other platforms? Genuinely curious if this will work on Windows, Linux & Android too? So far it looks like it is entirely targeted at the mac ecosystem (aka we-want-all-our-software-to-look-like-iOS ecosystem)
SwiftUI is just one instance of a new feature in Swift called function builders that allows creating custom DSLs within Swift. As Swift’s cross-platform support grows, two things can happen: SwiftUI can be customized go work with the GUI toolkits of other systems, and other system-specific DSLs can be developed to take advantage of each system’s own unique capabilities and APIs.
I think the likely scenario here would be a swiftUI-like framework which is cross platform. SwiftUI is tightly coupled with Apple’s UI rendering system, and they have no incentive to make it easier to port iOS code to Android for example.