Merge pull request #5 from darrarski/fix/navigationview-embedded-content Improvements for content embedded in NavigationView
Merge pull request #5 from darrarski/fix/navigationview-embedded-content
Improvements for content embedded in NavigationView
SwiftUI tabbed interface. Customizable replacement for SwiftUI.TabView.
SwiftUI.TabView
SwiftUI
Add as a dependecy to your project using Swift Package Manager.
Embed in your SwiftUI view:
import SwiftUITabsView struct ContentView: View { var body: some View { TabsView( tabs: /* [Tab] */, selectedTab: /* Binding<Tab> */, barPosition: /* ToolbarPosition */, ignoresKeyboard: /* Bool */, frameChangeAnimation: /* Animation? */, tabsBar: /* @ViewBuilder @escaping ([Tab], Binding<Tab>) -> TabsBar */, content: /* @ViewBuilder @escaping (Tab) -> TabContent */ ) } }
Check out documentation comments and the included example app.
If your tab’s content view is embedded in NavigationView, use tabsBarSafeAreaInset modifier to apply safe area insets that matches the tabs bar:
NavigationView
TabsView( /* ... */ content: { tab in NavigationView { ContentView(for: tab) .tabsBarSafeAreaInset() } } )
Open SwiftUITabsView.xcworkspace in Xcode (≥13.1) for development.
SwiftUITabsView.xcworkspace
Use ExampleApp-iOS scheme to build and run the iOS example application.
ExampleApp-iOS
Use ExampleApp-macOS scheme to build and run the macOS example application.
ExampleApp-macOS
Consider supporting further development and buy me a coffee.
Copyright © 2022 Dariusz Rybicki Darrarski
License: MIT
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SwiftUI Tabs View
SwiftUI tabbed interface. Customizable replacement for
SwiftUI.TabView
.SwiftUI
(no external dependencies).SwiftUI.TabView
.SwiftUI.TabView
.▶️ Usage
Add as a dependecy to your project using Swift Package Manager.
Embed in your SwiftUI view:
Check out documentation comments and the included example app.
If your tab’s content view is embedded in
NavigationView
, use tabsBarSafeAreaInset modifier to apply safe area insets that matches the tabs bar:🛠 Development
Open
SwiftUITabsView.xcworkspace
in Xcode (≥13.1) for development.Use
ExampleApp-iOS
scheme to build and run the iOS example application.Use
ExampleApp-macOS
scheme to build and run the macOS example application.☕️ Do you like the project?
Consider supporting further development and buy me a coffee.
📄 License
Copyright © 2022 Dariusz Rybicki Darrarski
License: MIT