Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It'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.


Sure, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: