YBImageBrowser的Delegate随笔

#pragma YBimageBowerDelegate
// 实现  协议方法配置数据源
- (NSUInteger)yb_numberOfCellForImageBrowserView:(YBImageBrowserView *)imageBrowserView {
    return _pictureList.count;
}
- (id)yb_imageBrowserView:(YBImageBrowserView *)imageBrowserView dataForCellAtIndex:(NSUInteger)index {
    YBImageBrowseCellData *data = [YBImageBrowseCellData new];
    data.url = [NSURL URLWithString:_pictureList[index].url];
//    data.sourceObject = _pictureList[index].;
    return data;
}
// 实现 
- (void)yb_imageBrowser:(YBImageBrowser *)imageBrowser respondsToLongPress:(UILongPressGestureRecognizer *)longPress {
    
    [MMSheetViewConfig globalConfig].defaultTextCancel = @"取消";
    [MMPopupWindow sharedWindow].touchWildToHide = YES;
    MMPopupItemHandler block = ^(NSInteger index) {
        if (index == 0) {
            [imageBrowser hide];
            [self deleteAlbumWithIndex:imageBrowser.currentIndex];
        }
    };
    NSArray *items =
    @[MMItemMake(@"删除", MMItemTypeNormal, block)];
    MMSheetView *view = [[MMSheetView alloc] initWithTitle:@"其他操作" items:items];
    view.attachedView = imageBrowser.view;
    [view show];
}

你可能感兴趣的:(YBImageBrowser的Delegate随笔)