Skip to content

Commit 063a6f0

Browse files
committed
doc: Update README
1 parent 93dd70d commit 063a6f0

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ This behavior distinguishes CustomTabView from common custom tab view implementa
4444
Add this repository as a dependency in your [`Package.swift`](https://developer.apple.com/documentation/swift_packages/package):
4545

4646
```swift
47-
// swift-tools-version:5.0
47+
// swift-tools-version: 6.0
4848

4949
import PackageDescription
5050

5151
let package = Package(
5252
...,
5353
dependencies: [
54-
.package(url: "https://github.com/NicFontana/SwiftUI-CustomTabView.git", .upToNextMajor(from: "1.0.0"))
54+
.package(url: "https://github.com/nomasystems/swiftui-custom-tab-view.git", .upToNextMajor(from: "2.0.0"))
5555
],
5656
...
5757
)
@@ -61,7 +61,7 @@ let package = Package(
6161
Select File \> Swift Packages \> Add Package Dependency, then enter the following URL:
6262

6363
```
64-
https://github.com/NicFontana/SwiftUI-CustomTabView.git
64+
https://github.com/nomasystems/swiftui-custom-tab-view.git
6565
```
6666

6767
For more details, see [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).
@@ -72,6 +72,8 @@ To integrate CustomTabView into your project, follow these simple steps:
7272

7373
#### 1. Create your custom tab bar:
7474
```swift
75+
import CustomTabView
76+
7577
enum Tab: String, Hashable, CaseIterable {
7678
case home, explore, favourites, other
7779
}
@@ -92,6 +94,7 @@ struct SampleTabBarView: View {
9294
}
9395
}
9496
}
97+
.anchorPreference(key: TabBarBoundsForSafeAreaKey.self, value: .bounds, transform: { $0 })
9598
}
9699

97100
private func tabBarItem(for tab: Tab) -> some View {
@@ -148,18 +151,20 @@ struct CustomTabViewExampleApp: App {
148151
The order of the views **must** be reflected in the provided tab bar.
149152

150153
#### 3. (Optional) Change the tab bar position
151-
You can change the tab bar position calling the `tabBarPosition(_:)` method on `CustomTabView`:
154+
You can change the tab bar position calling the `tabBarEdge(_:)` method on `CustomTabView`:
152155

153156
```swift
154157
CustomTabView(tabBarView: tabBarView, tabs: Tab.allCases, selection: selectedTab) {
155158
...
156159
}
157-
.tabBarPosition(.edge(.bottom))
160+
.tabBarEdge(.bottom)
158161
```
159162

160-
Supported positions are:
161-
- `edge(Edge)`: to place the tab bar at one edge of the screen
162-
- `floating(Edge)`: to let the tab bar float above the content while staying at one edge of the screen
163+
#### Hiding the tab bar
164+
165+
```swift
166+
.tabBarVisibility(.hidden)
167+
```
163168

164169
## Contributions and Issues
165170

Sources/CustomTabView/CustomTabView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ struct _TabBarLayoutView<TabBarView: View, Subviews>: View where Subviews: Rando
115115
.opacity(tabBarVisibility[selectedTabIndex] == .hidden ? 0 : 1)
116116
.onPreferenceChange(TabBarBoundsForSafeAreaKey.self) {
117117
if let anchor = $0 {
118-
tabBarHeight = proxy[anchor].height }
118+
tabBarHeight = proxy[anchor].height
119119
}
120+
}
120121
})
121122
}
122123
}

0 commit comments

Comments
 (0)