~/talk

Building REUSABLE SwiftUI components

Talkat Swift Heroes 2023 · 2023-05-04..05-05· [ios, component-design]
slides:none on file

Shows building a reusable SwiftUI text input that acts as a drop-in replacement for TextField with a floating label, clear button, focus handling and animation. Implements validation: mandatory flag plus custom validation closures registered via SwiftUI environment keys and exposes validity as a Binding so forms can enable submit buttons. Demonstrates refactorings (extract subview/local function), packaging into a Swift Package and Xcode LibraryContentProvider, and uses it in a Firebase-authenticated app where login and Firestore sync work.

AI-written summary · about

  1. 0:00intro
  2. 2:56The best way to build an app is with…
  3. 3:50Hello world
  4. 6:01Useful SwiftUI Refactorings
  5. 7:52Peter’s Wishlist
  6. 12:26Building a Reusable Text Input Field
  7. 14:04Drop-in replacement for TextField
  8. 17:29Customising Views
  9. 20:41View Styling
  10. 22:09Focus handling
  11. 22:42Validation handling
  12. 24:56Exposing inner state
  13. 26:24Custom Validation
  14. 27:14How to register Closures / Callbacks
  15. 28:04Reusing the Component
  16. 31:15Peter’s Wishlist
  17. 32:31Live code Drop-in Replacement
  18. 36:38Building a Reusable Text Input Field
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.