iPhone Duo SwiftUI examples

Explore SwiftUI APIs, components, and modifiers on iPhone Duo. Compare portrait and landscape layouts in closed, partially open, and fully open states, with Swift code and Apple documentation.

TabView

TabView Bottom Accessory Placement

A placement of the bottom accessory in a tab view. You can use this to adjust the content of the accessory view based on the placement

Explore TabView Bottom Accessory Placement on iPhone Duo in portrait and landscape across closed, partially open, and fully open states, with SwiftUI code and Apple API documentation.

var body: some View {
    TabView {
        Tab("1", systemImage: "1.circle") {
            List {
                ForEach(0 ..< 100, id: \.self) {
                    Text("Item \($0)")
                }
            }
        }

        Tab("2", systemImage: "2.circle") {
            EmptyView()
        }

        Tab("3", systemImage: "3.circle") {
            EmptyView()
        }
    }
    .tabBarMinimizeBehavior(.onScrollDown)
    .tabViewBottomAccessory {
        AccessoryContent()
    }
}

struct AccessoryContent: View {
    @Environment(\.tabViewBottomAccessoryPlacement) var placement

    var body: some View {
        switch placement {
        case .inline:
            Text("Inline")
        case .expanded:
            Text("Expanded")
        case .none:
            Text("")
        }
    }
}
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ tvOS 26.0+ visionOS 26.0+

Every available iPhone Duo screenshot for TabView Bottom Accessory Placement.

6 views