UIKit is far from being or becoming obsolete. SwiftUI and UIKit will live side by side for the foreseeable future. As a new iOS dev myself, I haven't touched UIKit and am only focussing on SwiftUI (mainly time constraints and the fact that SwiftUI is very close to what I do with React).
Do what feels right to you. If that means going with SwiftUI, that's fine. Expect a few bumps as not all APIs have been implemented in SwiftUI. Last year they pushed it forward a lot so I'm hoping for another big leap this year. We'll see in two weeks :)
Post
Replies
Boosts
Views
Activity
After weeks of trial and error I ended up finding a solution myself! The onAppear() runs, obviously, as soon as the view appears. This is, however, too fast. Adding a 0.01s delay using DispatchQueue like so:
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {...}
There's probably better solutions out there, but this definitely works!
I appreciate the answer and this would have worked, but since Xcode 12 / iOS 14 there is no more AppDelegate file. SwiftUI works with the @main entry wrapper.
This topic is relatively old and relates to the previous version, but I think it would be very helpful to update it or have a separate list that relates to Xcode 12.
@c1sc0 you can use Xcode 12 - https://developer.apple.com/download/ to either port your app or to re-setup the signing. I've found out that the issue is related to Xcode 11 on Big Sur but it works fine in Xcode 12 :)
This topic is so heartwarming. I'm currently employed as a front-end developer and I see this question pop up from time to time on the JS communities and the replies are rarely as friendly as this specific topic.
I'm currently getting my hands on Swift and SwiftUI as I want to expand my skills and hopefully create a few awesome apps along the way, so a lot of the sources in this topic are very helpful!
As far as learning is concerned, I am currently involved in Paul's "100 Days of SwiftUI", as well as Design + Code's SwiftUI course. The former teaches very in-depth things that will help you understand why things are the way they are and how you can utilise them. The latter is really helping me know about all the different modifiers and how to create awesome looking UI's that have a very friendly UX.