Live data from Hacker News

Should I use SwiftUI in production? A code-to-code comparison to help you decide

triplebyte.com

31–40 of 76 posts

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#33
post #24
post #9

I've been working full time on an app in SwiftUI for the past 8 months or so. I'll sum it up this way: I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life". I can't comment on the documentation, because there isn't any. The closest thing you get is the WWDC videos from the past few years wh…

I don’t understand why Apple doesn’t just document this. Is the team responsible for it just pro-UIKit and doesn’t actually want people to use SwiftUI or something? Because the lack of documentation for so long really does give me the impression that they actually don’t want people to use it. It’s hard to believe it could just be incompetence.

For what it's worth, I've been getting plenty of Feedback Assistant responses from Apple to requests related to SwiftUI and its documentation. And Josh Schaffer who led UIKit also leads SwiftUI now.

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#34
post #9

I've been working full time on an app in SwiftUI for the past 8 months or so. I'll sum it up this way: I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life". I can't comment on the documentation, because there isn't any. The closest thing you get is the WWDC videos from the past few years wh…

> Don't count on the "live preview" though. That thing never works for anything other than the most trivial of examples.

this was the one thing i would have hoped they would have finally fixed... wether its with xib/storyboards or swiftui, not getting realtime feedback on layouts is infuriating...

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#35
post #9

I've been working full time on an app in SwiftUI for the past 8 months or so. I'll sum it up this way: I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life". I can't comment on the documentation, because there isn't any. The closest thing you get is the WWDC videos from the past few years wh…

I've had these problems for everything Apple since before Swift was even a thing, documentation is basically 'Google things up and pray you find something that's not only relevant, but recent', since every September you're basically forced to migrate breaking changes of everything. But SwiftUI really is the right move.

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#36
post #9

I've been working full time on an app in SwiftUI for the past 8 months or so. I'll sum it up this way: I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life". I can't comment on the documentation, because there isn't any. The closest thing you get is the WWDC videos from the past few years wh…

> Don't count on the "live preview" though. That thing never works for anything other than the most trivial of examples. this was the one thing i would have hoped they would have finally fixed... wether its with xib/storyboards or swiftui, not getting realtime feedback on layouts is infuriating...

It works for me for a few not-quite-trivial views (e.g. a plot). It got a lot better with Xcode 12. The main thing now is if it doesn't work the error messages are basically useless, so you have to be very careful in setting it up. At least for me, the error message often made it seem like a random issue with Live Preview but it actually boiled down to some mistake in my code.

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#37
> Even if you use a LazyHStack, introduced in iOS 14, views will not be loaded until they appear, but they'll remain in memory thereafter.

well, thats a dealbreaker if i ever saw one... i wonder if this is "just a bug" and gets fixed in an ios 14.x update...

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#38

Earlier quoted context omitted.

> Don't count on the "live preview" though. That thing never works for anything other than the most trivial of examples. this was the one thing i would have hoped they would have finally fixed... wether its with xib/storyboards or swiftui, not getting realtime feedback on layouts is infuriating...

It works for me for a few not-quite-trivial views (e.g. a plot). It got a lot better with Xcode 12. The main thing now is if it doesn't work the error messages are basically useless, so you have to be very careful in setting it up. At least for me, the error message often made it seem like a random issue with Live Preview but it actually boiled down to some mistake in my code.

> boiled down to some mistake in my code.

yes, this is the hard part i think, and it was a similar issue with even storyboards/xib... since everything is in the same module, an issue somewhere else prevents compilation and hence the preview dies*

* maybe that is a reason until recently, declarative xml layout was used for a long time, no need to worry about compilation failure to get previews (in theory anyways)

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#39
post #4

> As of June 2020, Apple Reports that 92% of devices introduced in the last 4 years use iOS 13, while 81% of all devices (including the oldest) use iOS 13. Some businesses are not willing to part with that remaining 8%-19% of users. I'm surprised that so many people have the latest iOS. I was reluctant to use SwiftUI because I thought that more people have older iPhones which wouldn't support it.

As per this Wikipedia article[1], more than 2 billion iOS devices were sold by September 2018. 19% of 2B is 380M devices. So by going iOS 13 only quite a few potential users are left out. [1] https://en.wikipedia.org/wiki/List_of_iOS_and_iPadOS_devices

iOS users who don’t upgrade to the latest iOS versions are far less likely to spend money on APIs than iOS 13 & 14 users. That 19% accounts for closer to 5% of actual App Store sales and subscriptions.

Re: Should I use SwiftUI in production? A code-to-code comparison to help you decide

#40
post #9

I've been working full time on an app in SwiftUI for the past 8 months or so. I'll sum it up this way: I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life". I can't comment on the documentation, because there isn't any. The closest thing you get is the WWDC videos from the past few years wh…

> I frequently oscillate between thinking "This is amazing, it truly is a joy to work with SwiftUI" and "Holy FUCK this is the most infuriating thing I've ever experienced in my life".

Definitely, but I'm more on the side of "This is amazing."

Most of the things that I find really frustrating are just me misunderstanding how it works and now that I understand it better, everything goes way smoother.

Even going back in time, I'd make the SwiftUI choice. It's the clear future and it's so much fun to build stuff in.

Post reply on HN