Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creating forms with SwiftUI

Avatar for rodriar rodriar
November 29, 2019

Creating forms with SwiftUI

A basic rundown of SwiftUI and some thoughts on where it stands at the moment

Avatar for rodriar

rodriar

November 29, 2019

Other Decks in Technology

Transcript

  1. Xmartlabs 2019 Handling state • State: Private properties of primitive

    types (Int, String, etc). • ObservedObject: Complex (reference) types, like a class, of which we want to observe its variables. Might be shared with other views. • EnvironmentObject: shared data that is made available application-wide. Variables of these types will automatically refresh the view when changed.
  2. Xmartlabs 2019 UIKit <-> SwiftUI UIKit views and view controllers

    can be used in Swift UI • By conforming to UIViewControllerRepresentable or UIViewRepresentable SwiftUI views can be used in UIKit • By wrapping them in UIHostingController
  3. Xmartlabs 2019 A few limitations • No way to change

    content offset in a Form • No way to set a TextField to be first responder • SecureField does not have `onEditingChanged`
  4. Xmartlabs 2019 For building simple forms, SwiftUI works well. You

    can make these forms very quickly and with nice code. Also, it has great potential to compartmentalize. If you need to dig deeper, then it becomes complicated as there are many basic features not supported out of the box and some of them are hard to workaround. Conclusion