4 ms·
I love declarative UIs and still long for the days I was writing early front-end React apps nearly a decade ago and how amazing it felt for a UI to behave that
by jb1991 4y ago
I love declarative UIs and still long for the days I was writing early front-end React apps nearly a decade ago and how amazing it felt for a UI to behave that way. Years later, today I work primarily in iOS and would love to do this on that platform, but every time I read an article like this, my head hurts. Workarounds for workarounds, a great many special cases that are quite unexpected. I've gotten very fluent with UIKit and doing all sorts of custom controls and animations, and to abandon that comfort and productivity for another...year?... of a frustrating learning curve does not entice me to give it a try.
But I love the declarative paradigm so much; if only I could easily bring in my toolset of choice, whether it is Elm, Redux, etc, with all the power that native controls on iOS have, that would be awesome. SwiftUI is the only valid answer, but wow, I cannot get motivated to go down that rabbit hole.
- newZWhoDis 4y agoYou won’t throw any of that away, you can structure your app around SwiftUI and drop in to UIKit for custom controls whenever you want. This is a good idea for MapKit and web views at the moment, and probably the camera.
- nodemaker 4y agoOr you can structure your app in UIKit and build custom views and nice animations in SwiftUI. SwiftUI is a nice abstraction but a lot of it is really unnecessarily force fed by Apple because it helps them get more amateur developers into the platform.
- StewardMcOy 4y agoIt's a great solution when it works. MapKit and web views are good examples of it working well, but it can get buggy with anything more complicated, especially when mixing Views and UIViews in the same parent view. The worst part is that the behavior can change based on the OS version. You have to be proactive with testing your apps on the beta OS releases ASAP. Also, and this might have been fixed already, but a couple years ago, there were problems getting updateUIView to run in response to ObservableObject updates. The promise of UIViewRepresentable is a lot like SwiftUI itself. It's great when it works, but there's little you can do when it doesn't.
- solarkraft 4y ago> if only I could easily bring in my toolset of choice, whether it is Elm, Redux, etc, with all the power that native controls on iOS have, that would be awesome. SwiftUI is the only valid answer Time for the obvious question: Why not React Native?
- jb1991 4y agoI’d rather go with SwiftUI than resort to a different set of compromises with React Native.
- akmarinov 4y agoI work with a big pharmaceutical company that you've heard of (one of the vaccines), they have a big React Native app that they use to run their studies. 2 years on, their RN devs can't get the app to compile with M1 macs, so they all use Intel macs. They can't update to a recent RN version (recent, not the latest), because a RN navigation library has an issue with it and they're just sitting around, waiting for someone to fix the open source library... I could go on with the multitude of dependency hell issues they're having. It's a huge pain.
- deergomoo 4y agoI only have a passing familiarly with iOS development, but I wonder if it would be possible to lay a declarative-ish data binding layer over the top of UIKit? I mean I guess that’s sorta what React Native does, so it must be.