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.
https://gist.github.com/phillipcaudell/269e1d9abe1dea1709327fc95560760f
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)
https://medium.com/airbnb-engineering/unlocking-swiftui-at-airbnb-ea58f50cde49
@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 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.
@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 😛
@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.