@@ -44,14 +44,14 @@ This behavior distinguishes CustomTabView from common custom tab view implementa
44
44
Add this repository as a dependency in your [ ` Package.swift ` ] ( https://developer.apple.com/documentation/swift_packages/package ) :
45
45
46
46
``` swift
47
- // swift-tools-version:5 .0
47
+ // swift-tools-version: 6 .0
48
48
49
49
import PackageDescription
50
50
51
51
let package = Package (
52
52
... ,
53
53
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" ))
55
55
],
56
56
...
57
57
)
@@ -61,7 +61,7 @@ let package = Package(
61
61
Select File \> Swift Packages \> Add Package Dependency, then enter the following URL:
62
62
63
63
```
64
- https://github.com/NicFontana/SwiftUI-CustomTabView .git
64
+ https://github.com/nomasystems/swiftui-custom-tab-view .git
65
65
```
66
66
67
67
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:
72
72
73
73
#### 1. Create your custom tab bar:
74
74
``` swift
75
+ import CustomTabView
76
+
75
77
enum Tab : String , Hashable , CaseIterable {
76
78
case home , explore , favourites , other
77
79
}
@@ -92,6 +94,7 @@ struct SampleTabBarView: View {
92
94
}
93
95
}
94
96
}
97
+ .anchorPreference (key : TabBarBoundsForSafeAreaKey.self , value : .bounds , transform : { $0 })
95
98
}
96
99
97
100
private func tabBarItem (for tab : Tab) -> some View {
@@ -148,18 +151,20 @@ struct CustomTabViewExampleApp: App {
148
151
The order of the views ** must** be reflected in the provided tab bar.
149
152
150
153
#### 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 ` :
152
155
153
156
``` swift
154
157
CustomTabView (tabBarView : tabBarView, tabs : Tab.allCases , selection : selectedTab) {
155
158
...
156
159
}
157
- .tabBarPosition (. edge (. bottom ) )
160
+ .tabBarEdge (. bottom )
158
161
```
159
162
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
+ ```
163
168
164
169
## Contributions and Issues
165
170
0 commit comments