选项卡式视图 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:

  1. Implement reorganizing and dragging of tabs
  2. Add animations for selecting a tab

If any feedback please reach out to my email zacsoles@gmail.com

GitHub

点击跳转