测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布上次发布 | 2017年4月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由Taiki Suzuki维护。
您可以通过在 UITableView
中滑动中间来更改标签内容!!
UITableView
中改变标签中间。MartyJunior可通过CocoaPods获得。要安装,只需将以下行添加到您的 Podfile
pod "MartyJunior"
如果您从 cocoapods 安装,您必须编写 import MartyJunior
。
viewDidLoad
-> viewWillSetupForMartyJunior
-> viewDidSetupForMartyJunior
您必须像这样在 viewWillSetupForMartyJunior
中设置 delegate
、dataSource
等。
override func viewWillSetupForMartyJunior() {
super.viewWillSetupForMartyJunior()
delegate = self
dataSource = self
registerNibToAllTableViews(ProfileTweetCell.nib, forCellReuseIdentifier: ProfileTweetCell.ReuseIdentifier)
registerNibToAllTableViews(ProfileUserCell.nib, forCellReuseIdentifier: ProfileUserCell.ReuseIdentifier)
tabView.delegate = self
title = "@szk-atmosphere"
}
您必须像这样在 viewDidSetupForMartyJunior
中设置 NavigationView
等。
override func viewDidSetupForMartyJunior() {
super.viewDidSetupForMartyJunior()
navigationView?.titleLabel.alpha = 0
navigationView?.rightButton = UIButton(type: .InfoDark)
navigationView?.rightButton?.tintColor = .white
}
// Return number of tabs
func mjViewControllerNumberOfTabs(viewController: MJViewController) -> Int
// Return UIView you want to display as top content
func mjViewControllerContentViewForTop(viewController: MJViewController) -> UIView
// Return TabView if you want to display as custom view
optional func mjViewControllerTabViewForTop(viewController: MJViewController) -> UIView
基于 UITableViewDataSource
的协议。它有一个 targetIndex
参数用于分配相关的 tableView
。
optional func mjViewController(viewController: MJViewController, targetIndex: Int, numberOfSectionsInTableView tableView: UITableView) -> Int
// Celled when selected tab index was changed
optional func mjViewController(viewController: MJViewController, didChangeSelectedIndex selectedIndex: Int)
基于 UITableViewDelegate
的协议。它有一个 targetIndex
或 selectedIndex
参数用于分配相关的 tableView
。
optional func mjViewController(viewController: MJViewController, targetIndex: Int, tableView: UITableView, didSelectRowAtIndexPath indexPath: IndexPath)
optional func mjViewController(viewController: MJViewController, selectedIndex: Int, scrollViewDidScroll scrollView: UIScrollView)
此项目的示例使用
铃木大樹,[email protected]
MartyJunior 遵循 MIT 许可协议。更多信息请参阅 LICENSE 文件。