4 ms·
It sounds like SwiftUI is capable, but not performant for his use case. Fair enough.
by solarmist 4y ago
It sounds like SwiftUI is capable, but not performant for his use case. Fair enough.
- nishs 4y agoIt's also not capable right now (macOS 12/iOS 15/Xcode 13) for some parts. For example, there is no simple way to declare initial focus for a text field in a view. One has to resort to "onAppear" hacks, such as: .onAppear { // 0.05 is a guess. anything lower seems to run too early // and does not have the desired effect. DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { focusTextField = true } } Similarly, dismissing text field focus & on-screen keyboard upon scrolling/tapping away is a source of programming pain. It seemingly was bad in the old APIs. It is worse in SwiftUI in my limited experience. Same for scrolling a view such that an active text field isn't covered by the on-screen keyboard.
- solarmist 4y agoSure, I didn't necessarily mean it in a fully general way, just for the project being described. That is the obvious (comparatively) way it is still incomplete.