Latest 0.1.0
Homepage https://github.com/ethanbing/YBookmarkView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'YBookmarkView'

Usage

1、创建初始化BookmarkView

- (YBookmarkView *)bookmarkView
{
    if (!_bookmarkView) {
        _bookmarkView = [[YBookmarkView alloc] initWithFrame:self.view.frame];
        _bookmarkView.dataSource = self;
        _bookmarkView.delegate = self;
        _bookmarkView.topMarkHeight = 50;
        _bookmarkView.titleSelectFont = [UIFont systemFontOfSize:17];
//        _bookmarkView.fixedTitleWidth = 100; //如果标题是固定宽度设置
        //还有很多参数可以设置,自己体会吧 😊
    }
    return _bookmarkView;
}

2、实现几个DataSource方法

/**
 bookMarkView 数据来源

 @param bookMarkView bookMarkView
 @return 控制器数量
 */
- (NSInteger)numberOfItemInBookMarkView:(YBookmarkView *)bookMarkView;

/**
 top title 标签

 @param bookMarkView bookMarkView
 @param index 第几个标签
 @return title
 */
- (NSString *)bookMarkView:(YBookmarkView *)bookMarkView titleAtIndex:(NSInteger)index;

/**
 控制器  数据来源
 说明:每个控制器不会重复调用
 @param bookMarkView bookMarkView
 @param index 第几个标签
 @param viewRect 控制器的CGRect 大小
 @return 控制器
 */
- (UIViewController *)bookMarkView:(YBookmarkView *)bookMarkView viewAtIndex:(NSInteger)index viewRect:(CGRect)viewRect;

3、装载数据

[self.bookmarkView reloadData];

4、YBookMarkViewDelegate 回调

//** 点击 title 回调 */
- (void)bookMarkView:(YBookmarkView *)bookMarkView didSelectTitleAtIndex:(NSInteger)index;
//** 滚动到第几个标签回调 */
- (void)bookMarkView:(YBookmarkView *)bookMarkView didScrollToIndex:(NSInteger)index;
//** bottomMark 滑动结束 回调*/
- (void)bookMarkView:(YBookmarkView *)bookMarkView didEndDecelerating:(NSInteger)index;
- (void)bookMarkView:(YBookmarkView *)bookMarkView updateLayoutIndex:(NSInteger)index viewController:(UIViewController *)vc;
//** bottomMark 将要显示 回调*/
- (void)bookMarkView:(YBookmarkView *)bookMarkView bottomMarkWillDisplayCell:(UICollectionViewCell *)cell atIndex:(NSInteger)index;
//** 第index个子控制器 将要显示 回调*/
- (void)bookMarkView:(YBookmarkView *)bookMarkView willDisplayingVC:(__kindof UIViewController *)vc index:(NSInteger)index;
//** 第index个子控制 结束显示 回调*/
- (void)bookMarkView:(YBookmarkView *)bookMarkView didEndDisplayingVC:(__kindof UIViewController *)vc index:(NSInteger)index;

Author

Ethanbing, [email protected]

License

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

Latest podspec

{
    "name": "YBookmarkView",
    "version": "0.1.0",
    "summary": "YBookmarkView u662fu7c7bu4f3cu65b0u95fbu7684u4e66u7b7eu9875u9762u5f62u5f0f",
    "description": "YBookmarkView u662fu7c7bu4f3cu65b0u95fbu7684u4e66u7b7eu9875u9762u5f62u5f0fuff0cu5927u90e8u5206u9879u76eeu90fdu9700u8981u7528u5230uff0cu73b0u5728u8d21u732eu51fau6765uff0cu65b9u4fbfu5927u5bb6u4f7fu7528u65b9u4fbf",
    "homepage": "https://github.com/ethanbing/YBookmarkView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ethanbing": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ethanbing/YBookmarkView.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YBookmarkView/Classes/**/*"
}

Pin It on Pinterest

Share This