Toolbars are amongst the interesting additions to SwiftUI’s second iteration during WWDC 2020.

Essentially, toolbar is a modifier that lets you place a wrap around a bunch of view controls and set them at desired locations.

By default, SwiftUI can smartly determine and set views at desired locations with the toolbar modifier, but you can also explicitly set it using ToolbarItem.

In the next few sections, we’ll look at:

  • The need for the toolbar modifier
  • Using Toolbar API to automatically set items in the bottom bar and navigation bar
  • Using ToolbarItem for manual placements

#swiftui #mobile #ios #swift

The SwiftUI Toolbar in iOS 14
32.25 GEEK