Contents

tabPlacement(_:)

Specifies the placement of a tab.

Declaration

nonisolated func tabPlacement(_ placement: TabPlacement) -> some TabContent<Self.TabValue>

Parameters

  • placement:

    The location of the tab.

Discussion

The following example shows a TabView with three tabs where the second tab is pinned to the trailing edge of the top tab bar on iPad.

TabView {
    Tab("Home", systemImage: "house") {
        MyHomeView()
    }

    Tab("Downloads", systemImage: "square.and.arrow.down.fill") {
        MyDownloadsView()
    }
    .tabPlacement(.pinned)

    Tab("Browse", systemImage: "list.bullet") {
        MyBrowseView()
    }
}
.tabViewStyle(.sidebarAdaptable)