The swift version of TabPageView in iOS
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 9.0+
- Xcode 9+
- Swift 4.0+
- If you need help, use Stack Overflow. (Tag 'sftabpage')
- If you'd like to ask a general question, use Stack Overflow.
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
TabPageView is available through CocoaPods. CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To install it, simply add the following line to your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'TabPageView'
end
Then, run the following command:
```bash
$ pod install
If you prefer not to use any of the aforementioned dependency managers, you can integrate TabPageView into your project manually.
ShenZhengFang, [email protected]
import UIKit
import TabPageView
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// let titles = ["iPhone", "iOS", "KobeBryant", "Beautiful Girl", "UtoVR", "brianbryant", "JustinBieber", "**", "Taylor Swift"]
let titles = ["我的", "你的", "她的"]
var childVCs = [UIViewController]()
for _ in 0..<titles.count {
let vc = UIViewController()
vc.view.backgroundColor = UIColor.randomColor()
childVCs.append(vc)
}
let style = PageStyle()
style.isScrollEnable = false
let tabPageView = TabPageView(frame: self.view.bounds, style: style, titles: titles, childVCs: childVCs, parentVC: self)
tabPageView.backgroundColor = UIColor.orange
view.addSubview(tabPageView)
view.backgroundColor = UIColor.red
}
}
TabPageView is available under the MIT license. See the LICENSE file for more info.