Latest 1.1.1
Homepage https://github.com/louis-ly/LYSideslipCell
License MIT
Platforms ios 6.0, requires ARC
Frameworks UIKit
Authors

高仿微信侧滑效果, 兼容代码和xib创建, 屏幕翻转.

首页消息Cell

image

联系人Cell

image

收藏Cell

image

Podfile

支持CocoaPods. 只要在Podfile文件中加入一行代码

pod 'LYSideslipCell'

接着在终端输入pod install即可

How to use

1.继承该类

@interface LYHomeCell : LYSideslipCell
@end

2.在tableView:cellForRowAtIndexPath:方法中设置代理:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    LYHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(LYSideslipCell.class)];
    if (!cell) {
        cell = [[LYHomeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(LYSideslipCell.class)];
        cell.delegate = self;
    }
    return cell;
}

3.实现LYSideslipCellDelegate协议sideslipCell:editActionsForRowAtIndexPath:方法,返回侧滑按钮事件数组。

#pragma mark - LYSideslipCellDelegate
- (NSArray<LYSideslipCellAction *> *)sideslipCell:(LYSideslipCell *)sideslipCell editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    LYSideslipCellAction *action = [LYSideslipCellAction rowActionWithStyle:LYSideslipCellActionStyleNormal title:@"备注" handler:^(LYSideslipCellAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
        [sideslipCell hiddenAllSideslip];
    }];
    return @[action];
}

4.更多细节请看demo

Latest podspec

{
    "name": "LYSideslipCell",
    "version": "1.1.1",
    "summary": "A tableViewCell like WeChat",
    "homepage": "https://github.com/louis-ly/LYSideslipCell",
    "license": "MIT",
    "frameworks": "UIKit",
    "platforms": {
        "ios": "6.0"
    },
    "authors": {
        "louisly": "[email protected]"
    },
    "source": {
        "git": "https://github.com/louis-ly/LYSideslipCell.git",
        "tag": "1.1.1"
    },
    "source_files": "LYSideslipCell/Classes/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This