SkillAgentSearch skills...

TabNavigable

A useful protocol and its extension when you make custom TabBarViewController

Install / Use

/learn @innocarpe/TabNavigable
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

TabNavigable

Swift CocoaPods Build Status Codecov

Example

class CustomTabBarViewController: UIViewController, TabNavigable {
  var containerView: UIView!
  var viewControllers: [UIViewController]! = []
  
  override func viewDidLoad() {
    super.viewDidLoad()
    initViewControllers()
  }
  
  private func initViewControllers() {
    addViewController()
    addViewController()
    addViewController()
    
    changeActiveViewController(index: 0)
  }
  
  private func addViewController() {
    let viewController = YourTabViewController()
    viewControllers.append(viewController)
  }
  
  func tabButtonDidTap(index: Int) {
    changeActiveViewController(index: index)
  }
}

Installation

TabNavigable is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "TabNavigable"

Contribution

For your convenience, execute the line below to generate xcodeproj.

$ swift package generate-xcodeproj

Author

Wooseong Kim, innocarpe@gmail.com

License

TabNavigable is available under the MIT license. See the LICENSE file for more info.

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated2y ago
Forks2

Languages

Swift

Security Score

75/100

Audited on May 30, 2023

No findings