Coder Social home page Coder Social logo

lysideslipcell's Introduction

LYSideslipCell

高仿微信侧滑效果, 兼容代码和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

lysideslipcell's People

Contributors

louis-ly avatar

Stargazers

 avatar rey avatar  avatar  avatar Mortar avatar  avatar 微信 avatar  avatar  avatar xiaohengdd avatar  avatar liqingnan avatar  avatar MelodyK avatar  avatar  avatar Bing_John avatar 一笑咯咯哒 avatar sunflowerseat avatar Prefrence avatar 红色小星 avatar zhouyu avatar 重案组曹达华 avatar LaiYoung_ avatar RisingTan avatar  avatar MisterDeng avatar  avatar 王鹏飞 avatar  avatar  avatar 任逍遥 avatar 纪健雄 avatar  avatar  avatar  avatar  avatar EricLee avatar Sheldon_Ru.Xie avatar Brook MK avatar

Watchers

 avatar  avatar

lysideslipcell's Issues

cell无法回复到初始状态

继承LYSideslipCell,用代码重写- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier方法,左滑后,无法回复到初始状态,有10左右的偏差
2017-02-16 3 52 55

cell无响应

原来有一条数据,删除,
然后新增一条数据,
刷新,侧滑cell无响应.
会是哪里出问题了?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.