Skip to Content
An iOS Developer's Guide to SwiftUI
book

An iOS Developer's Guide to SwiftUI

by Michele Fadda
May 2024
Beginner to intermediate content levelBeginner to intermediate
446 pages
10h 33m
English
Packt Publishing
Content preview from An iOS Developer's Guide to SwiftUI

4

Iterating Views, Scroll Views, FocusState, Lists, and Scroll View Reader

In this chapter, we will look at how to display lists in SwiftUI, in particular, views that have scrollable contents, either with scroll views or lists. We will also add a bit more functionality to our text fields by allowing the system keyboard to be shown or hidden on iOS. We will briefly touch on the topic of NavigationView, in order to display the titles of views.

In this chapter, we are going to cover the following main topics:

  • Iterating views
  • Hiding or showing the keyboard in a form using @FocusState
  • @SwiftUIBuilder and the limit of only 10 views
  • Controlling scrolling programmatically using ScrollViewReader

Technical requirements

You will find the code related ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SwiftUI - The Complete iOS 17 Reference Library of Code

SwiftUI - The Complete iOS 17 Reference Library of Code

Stephen DeStefano
Developing Apps with GPT-4 and ChatGPT

Developing Apps with GPT-4 and ChatGPT

Olivier Caelen, Marie-Alice Blete

Publisher Resources

ISBN: 9781801813624Supplemental Content