Here's a prime example of what developers mean when they question "is SwiftUI ready for production?”

A simple menu. Left iOS 16.4. Right iOS 17.0.

One works. One fails. Same code.

I love SwiftUI, but it's this kind of thing that make me lose confidence in it.

gist.github.com/phillipcaudell

No doubt you can ship amazing things with SwiftUI. I see many great examples of it.

But I also see many examples of developers pulling their hair out trying to understand why their app isn't behaving as expected.

Things that once worked now don't because of an OS update. Or some modifier begins interacting with something in an unexpected way. Or something isn't clearly documented.

Airbnb's recent article highlighted something I think about a lot:

"While Swift and its surrounding foundation have been open sourced, SwiftUI’s implementation remains a black box. If SwiftUI were open sourced, we could better understand the framework and debug more effectively.”

I don't think Apple will ever do it, but boy that would go a long way in fixing many of the issues SwiftUI has today.

(The whole article is great read, btw)

medium.com/airbnb-engineering/

@phill @objc anytime I look at SwiftUI stack traces when troubleshooting they involve the C++ AGGraph that does not look feasible to debug in a reasonable amount of time.

Changes to the backing layer that sometimes are not even UIKit anymore also do not help, and even if it was UIKit, that’s closed source too.

The Swift language may be open source, but when I run into a compiler issue I’m unlikely to be able to fix it in source. I think this would be a similar case for non-large teams.

@giladronat @objc all very true and excellent points.

But I imagine just like Swift itself, you wouldn’t need to understand the source to benefit. Countless contributions from the community make it less likely for you to experience issues in the first place, either by direct fixes to the lang, or through the dissemination of knowledge.

@phill @objc definitely, and I agree that it _would_ be nice, and even personally I’m more keen to learn to contribute to a UI framework than I am to a compiler. I just don’t think it would have a significant impact on day to day development.

@phill @objc I also suspect from reverse engineering the framework throughout its iterations that Apple has been making sweeping changes to it fairly frequently. These changes would not fly easily in an open source environment without RFCs, suggestions, or disclosing the direction of the framework. I can imagine it would be a big commitment for them to reveal all future cards.

I’m optimistic for better debugging tools in the future, but not for open sourcing.

Follow

@giladronat 100%

Like I said I don't think it's something they would do. It's just hard not to draw comparisons to Apple's other OS efforts where it's been working out so well for everyone.

But who knows: they've surprised us before 😛

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.