Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lorenzofiamingo/swiftui-vertical-tab-view

VerticalTabView is a native way to display paged vertical content in SwiftUI.
https://github.com/lorenzofiamingo/swiftui-vertical-tab-view

swift swiftui tabview

Last synced: 6 days ago
JSON representation

VerticalTabView is a native way to display paged vertical content in SwiftUI.

Awesome Lists containing this project

README

        

# SwiftUI VerticalTabView πŸ”
`VTabView` is a native way to display paged vertical content in SwiftUI.

To work it makes use of the new iOS 14 `TabView` `PageTabViewStyle`.

## Usage

Use like any other TabView:

```swift
import SwiftUI
import VTabView

VTabView {
Text("The First Tab")
.tabItem {
Image(systemName: "square.fill")
}
Text("Another Tab")
.tabItem {
Image(systemName: "circle.fill")
}
Text("The Last Tab")
.tabItem {
Image(systemName: "triangle.fill")
}
}
.tabViewStyle(PageTabViewStyle())
```

You can also move index to the right
```swift
VTabView(indexPosition: .trailing) {
...
}
.tabViewStyle(PageTabViewStyle())
```
or remove it
```swift
VTabView {
...
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
```

## Limitation

`TabView` bounces in all directions by default.

`VTabView` is meant to be used with `.tabViewStyle(PageTabViewStyle())` but you can also use `DefaultTabViewStyle`.
Only remember that tab items will not have the orientation you would probably like to obtain.
A workaround for this would be in tabItem to not use `Text` but only an `Image` correctly transformed.

## Installation

1. In Xcode, open your project and navigate to **File** β†’ **Swift Packages** β†’ **Add Package Dependency...**
2. Paste the repository URL (`https://github.com/lorenzofiamingo/swiftui-vertical-tab-view`) and click **Next**.
3. Click **Finish**.

## Other projects

[SwiftUI VariadicViews πŸ₯ž](https://github.com/lorenzofiamingo/swiftui-variadic-views)

[SwiftUI AsyncButton πŸ–²οΈ](https://github.com/lorenzofiamingo/swiftui-async-button)

[SwiftUI MapItemPicker πŸ—ΊοΈ](https://github.com/lorenzofiamingo/swiftui-map-item-picker)

[SwiftUI PhotosPicker πŸŒ‡](https://github.com/lorenzofiamingo/swiftui-photos-picker)

[SwiftUI CachedAsyncImage πŸ—ƒοΈ](https://github.com/lorenzofiamingo/swiftui-cached-async-image)

[SwiftUI SharedObject 🍱](https://github.com/lorenzofiamingo/swiftui-shared-object)