ERSegmentController *pageManager = [[ERSegmentController alloc] init];
pageManager.view.frame = CGRectMake(0, 64, ScreenWidth, ScreenHeight - 64 - 49);
pageManager.segmentHeight = 25;//导航条高度
pageManager.progressWidth = 15;//导航条底横线度宽度
pageManager.progressHeight = 1;//导航条底横线高
pageManager.itemMinimumSpace = 10;//导航条item直接的间距
pageManager.normalTextFont = [UIFont systemFontOfSize:12];//未选中字体大小
pageManager.selectedTextFont = [UIFont systemFontOfSize:16];//已选中字体大小
pageManager.normalTextColor = [UIColor blackColor];//未选中字体颜色
pageManager.selectedTextColor = [UIColor redColor];//已选中字体颜色
pageManager.dataSource = self;//页面管理数据源
pageManager.menuDataSource = self;//菜单管理数据源, 如果不设置改代理则没有菜单按钮
pageManager.editMenuIconIgV.image = [UIImage imageNamed:@"editButtonImage"];//编辑菜单icon (按需设置)
pageManager.delegate = self;//相关事件返回代理
[self.view addSubview:pageManager.view];
[self addChildViewController:pageManager];
@protocol ERPageViewControllerDataSource <NSObject>
@required
/**
返回子控制器总数,类似TableViewDataSource
@param pageViewController self
@return 子控制器总数
*/
- (NSInteger)numberOfControllersInPageViewController:(ERPageViewController *)pageViewController;
/**
返回对应index的ViewController
@param pageViewController self
@param index 当前index
@return 需要展示的ViewController
*/
- (UIViewController *)pageViewController:(ERPageViewController *)pageViewController childControllerAtIndex:(NSInteger)index;
/**
子控制器title
@param pageViewController self
@param index 当前index
@return title
*/
- (NSString *)pageViewController:(ERPageViewController *)pageViewController titleForChildControllerAtIndex:(NSInteger)index;
@end
@protocol ERSegmentMenuControllerDataSource <NSObject>
@required;
/**
已经选择的频道列表信息
@param segmentMenuController self
@return 必须为字典型数组(必须包含一个KEY为@"name"的字符串)
*/
- (NSMutableArray<NSDictionary *> *)selectedChannelLisInSegmentMenuController:(ERSegmentMenuController *)segmentMenuController;
@optional;
/**
未选择的频道列表信息
@param segmentMenuController self
@return 可以为nil ,若不为nil则必须为字典型数组(必须包含一个KEY为@"name"的字符串)
*/
- (NSMutableArray<NSDictionary *> *)unSelectChannelListInSegmentMenuController:(ERSegmentMenuController *)segmentMenuController;
/**
每组标题
@param segmentMenuController segmentMenuController
@param sectionHeaderLabel 组头Label
@param section section
@return title
*/
- (NSString *)segmentMenuController:(ERSegmentMenuController *)segmentMenuController sectionHeaderLabel:(UILabel *)sectionHeaderLabel titleForHeaderInSection:(NSInteger)section;
@end
@protocol ERSegmentControllerDelegte <NSObject>
@optional
/**
导航按钮点击事件回调
@param segmentController self
@param indexPath indexPath
*/
- (void)segmentController:(ERSegmentController *)segmentController didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
/**
导航菜单编辑按钮点击回调
@param segmentController self
@param editMenuButton editMenuButton
*/
- (void)segmentController:(ERSegmentController *)segmentController didSelectEditMenuButton:(UIButton *)editMenuButton;
/**
导航按钮双击事件回调
@param segmentController self
@param indexPath indexPath
*/
- (void)segmentController:(ERSegmentController *)segmentController itemDoubleClickAtIndexPath:(NSIndexPath *)indexPath;
/**
页面切换滚动完成回调
@param pageController superClass
@param fromIndex fromIndex
@param toIndex toIndex
*/
- (void)pageControllerDidScroll:(ERPageViewController *)pageController fromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
@end
DDNews
ZYColumnViewController
LXReorderableCollectionViewFlowLayout
TYPagerController