选项卡式视图 SwiftUI 包
TabView Swift Package
此软件包的目的是为所有 SwiftUI 应用程序添加选项卡式功能。
下面是功能的图像。
下面是选项卡的示例实现的快照。
选项卡界面如下所示
Required Vars
-
The tabs var takes in an array of strings, this is used to display each tab
-
The selectedTabIndex var is a @Binding var, changing dependent on the tab that is selected. This is also used within the example to display different views dependent on the selected tab.
Optional Vars
-
activeColor, inactiveColor change the the color of the selected/ not selected tab’s text. This is currently set to the device’s accent color if no value is passed through to the view.
-
activeTabColor, inactiveTabColor change the color of the underline of the tab. This is currently set to the device’s accent color as well if no value is passed through to the view.
ToDo:
- Implement reorganizing and dragging of tabs
- Add animations for selecting a tab
If any feedback please reach out to my email zacsoles@gmail.com