4 ms·
I was really excited about SwiftUI after having done a lot of React development recently. The declarative style is so much nicer than the MVC/procedural code th
by erikrothoff 7y ago
I was really excited about SwiftUI after having done a lot of React development recently. The declarative style is so much nicer than the MVC/procedural code that regular UIKit code becomes.
After 30 minutes of updating Xcode I was able to start writing SwiftUI code. Then another 2 hours upgrading our Swift project to the latest version of Swift. I googled for documentation, found barely anything and the code samples on developer.apple.com were already outdated. I finally got something up and running, but _nothing_ in the semantics worked as expected. Getting a button to render nicely was insanely complex (which view should have the background color? font? trying different things didn't work at all). Oh and recompiling took a minimum of 30 seconds each time.
All this prompted me to finally give react-native a try. In under 15 minutes I had a working example. After making a change I saved the file, alt-tabbed to the simulator and the changes were already applied. And it works instantly on Android, I can try it out on my phone using expo without any hassle.
I just can't comprehend if and how Apple will catch up with that experience?
- Someone 7y ago”after having done a lot of React development recently […] All this prompted me to finally give react-native a try. In under 15 minutes I had a working example“ I agree SwiftUI is poorly documented and (from what others say), probably, not quite production ready, but I also guess that comparison is a bit unfair. Or are react and react-native completely different beasts?
- erikrothoff 7y agoI'm not a die-hard follower of Apple developer news, but it being released in June 2019 made it feel at least somewhat mature to try out. There's nothing AFAICS on the SwiftUI documention mentioning that it's not quite production ready. > Or are react and react-native completely different beasts? The language is the same, and the core concepts are the same, but the SDK's are completely different. You are using different build tools, different API's, different platforms. It's not HTML-in-JS. So a React developer is not going to be fluent in react-native by default.
- kenshi 7y agoI suspect Apple knows the developer experience for Swift is terrible (even if the Apple developer community at large is in mass denial about this). The number 2 item on Swift Core Teams goals for Swift 6 is "Create a fantastic development experience". See: https://forums.swift.org/t/on-the-road-to-swift-6/32862 https://forums.swift.org/t/on-the-road-to-swift-6/32862 Whether anyone at Apple cares about documentation any more is another matter. A really sad state of affairs, because once upon a time, Apple had some of the best documentation out there. Of course, that was when they actively needed to court a developer community, and couldn't just announce something half-baked at WWDC and get mass adoption from enthusiastic developers.
- hombre_fatal 7y agoEven iOS programming communities will admit you're brave for using SwiftUI right now. It's brand new, has a lot of issues like being completely unable to show you a coherent type-error message (like if you have an error inside a ForEach view). It's just cutting edge tech.
- jamil7 7y agoI don't know, maybe some of the die hards are in denial. I really enjoy the language and the platforms but I'd readily admit it's pretty far behind in terms of DX. I think at this point Apple is going to have to make this a really big priority if they want to remain relevant and it's going to take a lot of effort on their part.
- chipotle_coyote 7y agoWhile I certainly can't speak for all diehards, I hear a lot of complaints about the state of Apple's documentation from long-time developers these days. (In my experience, the true Apple diehards are often very critical of the company, but they tend to have specific trenchant critiques.)
- ogre_codes 7y ago> ... after having done a lot of React development recently ... All this prompted me to finally give react-native a try. In under 15 minutes I had a working example. The fact that you, a React developer with lots of experience with React were able to come up to speed vastly quicker on React Native shouldn't be surprising, that's a feature of the platform. You are the exact sort of person React Native was designed to make productive. Of course you struggled, to pick up Swift UI, you needed to learn a new, vastly different language, and a new DSL that sits atop that language. Even with good documentation and years of community expertise built up, this would have been an uphill comparison, but SwiftUI is relatively new—essentially in beta—there is very community around it and as you noticed, very little documentation... all of these last issues are pretty well known. All of them take time to overcome. I'm not sure if SwiftUI is going to be the next big thing or not, but your comparison is a bit lopsided here.
- erikrothoff 7y agoSorry if it wasn't clear enough. I'm by no means a React-developer with lots of React experience. I'd say I have more iOS-development experience than React. The app I wanted to port is already fully written in Swift. I've written and launched a couple of apps in Swift over the years, and also a couple of apps in Objective-c.
- ogre_codes 7y agoFair enough. I think time is the big decider here. Swift is new and given Apple's relatively slow update cycle (annually versus quarterly or more often for open source projects), it'll be a few years before SwiftUI really matures and (hopefully) a community builds up around it. This year's Apple Dev Conference (If it happens) should push things forward and hopefully increase the quality and quantity of documentation at the least.
- jamil7 7y ago> Oh and recompiling took a minimum of 30 seconds each time. For a simple hello world SwiftUI app? I just checked a project I had open in xcode and it recompiled in under 1s. Thats on a mid range 2013 MBP. > After making a change I saved the file, alt-tabbed to the simulator and the changes were already applied. I guess Apple is aiming to get something like this experience through previews, which are a little broken right now. Edit: formatting
- erikrothoff 7y agoSorry if I wasn't being clear. We have an iOS app and my plan was to try out migrating an existing Viewcontroller to SwiftUI (the login screen).
- bsaul 7y agoI’m a 10 years ios developer, and i also gave up tryin to write a small app in swiftui after having tried for an hour. It’s just impossible with the current level of documentation. I think the picture is darker than what you’re describing : as long as apple doesn’t provide a real cross-platform environment (like google does with flutter, or facebook with react) then it doesn’t really matter what they end up doing with swift UI. My intuition is that they know it, and that they’re working on something pretty big in that field, maybe as an improved , cross-platform version of swift ui. That would explain the lack of documentation (why document something that’s only a temporary version of a tech). But maybe i’m dreaming and everybody at apple live in its own bubble...