Honestly guys, don't even waste your time on SwiftUI prior to version 2.0. It's the most raw and crapiest framework apple has ever released. It only looks good on paper, and drastically misses basic functionality. SwiftUI 2 looks a bit more mature though
I build an app only with SwiftUI from the start. Throughout the year the API changed and some features stopped working (contextMenu on some elements didn’t highlight correctly the element pressed) and after a lot of debugging I concluded that it came from SwiftUI itself. Which was the case, a year after some things have been fixed themselves. Some APIs have been deprecated since last year as well.
Personally I never liked building the interface with interface builder and autolayout.
Creating everything straight in code is really powerful and it’s easier to compare differences with git.
It would’ve been better to release it this year though, more mature with major bugs fixed.
Use switch statements inside SwiftUI? Can't do that (or you'll have to wrap every view into AnyView)
Use `if case let` to conditionally unwrap and show a view? Nope.
Make a customizable tableview? Nope. `List` is all you get. And you can't even remove the separator.
Get the scroll position for the ScrollView or List? Definitely not possible.
Even SwiftUI's TabView is buggy as hell. It resets the view's state as soon as you switch the tab.
Everytime I encounter a bug or an issue in SwiftUI I see a post on Stackoverflow where people say it's not currently possible to do that or it will be in SwiftUI 2.0. I heavily use SwiftUI in my current project, buy 90% of the views are actually wrappers around UIKit, even all of the UITextFields are wrapped because SwiftUI cannot provide basic access to the underlying responders.
this video doesn't make any sense.
It compares the amount of time it takes to type code for a trivial layout. This doesn't make sense for two reasons :
- uikit was shipped with interface builder from day 1. which lets you design trivial interfaces in a wysiwyg way, whithout typing any code at all.
- typing code is never what really takes time. Complex interactions and non-standard UI design is where you spend most of your time.
6 comments
[ 4.3 ms ] story [ 24.9 ms ] threadUse `if case let` to conditionally unwrap and show a view? Nope.
Make a customizable tableview? Nope. `List` is all you get. And you can't even remove the separator.
Get the scroll position for the ScrollView or List? Definitely not possible.
Even SwiftUI's TabView is buggy as hell. It resets the view's state as soon as you switch the tab. Everytime I encounter a bug or an issue in SwiftUI I see a post on Stackoverflow where people say it's not currently possible to do that or it will be in SwiftUI 2.0. I heavily use SwiftUI in my current project, buy 90% of the views are actually wrappers around UIKit, even all of the UITextFields are wrapped because SwiftUI cannot provide basic access to the underlying responders.
So my opinion is to at least wait for 2.0
- uikit was shipped with interface builder from day 1. which lets you design trivial interfaces in a wysiwyg way, whithout typing any code at all.
- typing code is never what really takes time. Complex interactions and non-standard UI design is where you spend most of your time.