All Projects → lengningLN → LNSwipeCell

lengningLN / LNSwipeCell

Licence: MIT license
一套友好的、方便集成的针对cell的左滑编辑功能!

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to LNSwipeCell

learningspoons
nlp lecture-notes and source code
Stars: ✭ 29 (+81.25%)
Mutual labels:  attention
db-safedelete
Attempts to invoke force delete, if it fails - falls back to soft delete
Stars: ✭ 16 (+0%)
Mutual labels:  delete
gqa-node-properties
Recalling node properties from a knowledge graph
Stars: ✭ 19 (+18.75%)
Mutual labels:  attention
free-lunch-saliency
Code for "Free-Lunch Saliency via Attention in Atari Agents"
Stars: ✭ 15 (-6.25%)
Mutual labels:  attention
Hierarchical-Word-Sense-Disambiguation-using-WordNet-Senses
Word Sense Disambiguation using Word Specific models, All word models and Hierarchical models in Tensorflow
Stars: ✭ 33 (+106.25%)
Mutual labels:  attention
Erasure
Chrome extension for deleting your YouTube comment history.
Stars: ✭ 48 (+200%)
Mutual labels:  delete
h-transformer-1d
Implementation of H-Transformer-1D, Hierarchical Attention for Sequence Learning
Stars: ✭ 121 (+656.25%)
Mutual labels:  attention
transformer
A PyTorch Implementation of "Attention Is All You Need"
Stars: ✭ 28 (+75%)
Mutual labels:  attention
Linear-Attention-Mechanism
Attention mechanism
Stars: ✭ 27 (+68.75%)
Mutual labels:  attention
aws-s3-bucket-purger
A program that will purge any AWS S3 Bucket of objects and versions quickly
Stars: ✭ 18 (+12.5%)
Mutual labels:  delete
Attentive-Neural-Process
A Pytorch Implementation of Attentive Neural Process
Stars: ✭ 60 (+275%)
Mutual labels:  attention
chatbot
一个基于深度学习的中文聊天机器人,这里有详细的教程与代码,每份代码都有详细的注释,作为学习是美好的选择。A Chinese chatbot based on deep learning.
Stars: ✭ 94 (+487.5%)
Mutual labels:  attention
jeelizGlanceTracker
JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.
Stars: ✭ 68 (+325%)
Mutual labels:  attention
rmfr
Node.js implementation of rm -fr – recursive removal of files and directories
Stars: ✭ 23 (+43.75%)
Mutual labels:  delete
datastories-semeval2017-task6
Deep-learning model presented in "DataStories at SemEval-2017 Task 6: Siamese LSTM with Attention for Humorous Text Comparison".
Stars: ✭ 20 (+25%)
Mutual labels:  attention
EBIM-NLI
Enhanced BiLSTM Inference Model for Natural Language Inference
Stars: ✭ 24 (+50%)
Mutual labels:  attention
classifier multi label seq2seq attention
multi-label,classifier,text classification,多标签文本分类,文本分类,BERT,ALBERT,multi-label-classification,seq2seq,attention,beam search
Stars: ✭ 26 (+62.5%)
Mutual labels:  attention
django-paranoid-model
Django abstract model with paranoid behavior
Stars: ✭ 17 (+6.25%)
Mutual labels:  delete
gnn-lspe
Source code for GNN-LSPE (Graph Neural Networks with Learnable Structural and Positional Representations), ICLR 2022
Stars: ✭ 165 (+931.25%)
Mutual labels:  attention
torch-multi-head-attention
Multi-head attention in PyTorch
Stars: ✭ 93 (+481.25%)
Mutual labels:  attention

LNSwipeCell

一套友好的、方便集成的针对cell的左滑编辑功能! 实现一个类似微信聊天列表的左滑编辑功能。

本次优化

  1. 解决删除cell是越界的问题
  2. 对cell关闭做优化
  3. 新增当手指接触到tableView空白处能关闭cell
  4. 打开、关闭cell时,完全实现和微信聊天列表页的cell一样的动画效果
  5. Demo中实现不同cell不同数量的编辑model,并实现置顶等功能

Interduce 【简单介绍】

  • 按照苹果官方的MVC的设计模式封装的Cell控件,类似UITableView的实现方式
  • LNSwipeCell的编辑功能的数据由LNSwipeCellDataSource提供
  • LNSwipeCell的编辑功能的事件由LNSwipeCellDelegate提供

Features【能做什么】

  • 实现左滑显示,标为已读、删除、置顶等多个按钮
  • 触摸到已经打开的cell的contentView区域,关闭cell
  • 触模到其他cell,关闭已经打开的cell
  • 滑动tableView,关闭已经打开的cell
  • 触摸到tableView的空白区域,关闭打开的cell
  • 打开和关闭cell时,编辑按钮按照微信一样的动画出现
  • 点击删除按钮,变化为确认删除按钮

目前存在的问题

  1. 😄还没发现哦

Class【使用到的类】

  1. LNSwipeCell -- 封装了左滑编辑的cell

Getting Started【开始使用】

  1. 直接将 LNSwipeCell 拽到工程中使用
  2. 使用cocoapods添加,pod 'LNSwipeCell'

效果演示

文字介绍

  • 把LNSwipeCell类拖进工程中
  • 让你的cell继承LNSwipeCell,因为lNSwipeCell只封装了左滑编辑的逻辑和实现,因此你要根据需求自己绘制cell的UI
  • 接受LNSwipeCellDataSource和LNSwipeCellDelegate
  • 根据需要实现对应的协议方法

代码介绍

  • 创建cell的设置
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    LNSwipeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.swipeCellDelete = self;
    cell.swipeCellDataSource = self;
    
    return cell;
}
  • 需要实现的数据协议
/**
 number of items
 
 @param swipeCell 当前cell
 @return count of items;
 */
- (int)numberOfItemsInSwipeCell:(LNSwipeCell *)swipeCell;

/**
 设置每个可操作的item都为button,把需要设置的属性放到字典中返回
 
 @param swipeCell cell
 @param index   位置自右往左,从0开始
 @return 设置好的item信息:包括字体、颜色、图片、背景色等
 key包括如下字段,根据需要设置
 extern const NSString *LNSWIPCELL_FONT;
 extern const NSString *LNSWIPCELL_TITLE;
 extern const NSString *LNSWIPCELL_TITLECOLOR;
 extern const NSString *LNSWIPCELL_BACKGROUNDCOLOR;
 extern const NSString *LNSWIPCELL_IMAGE;
 */
- (NSDictionary *)dispositionForSwipeCell:(LNSwipeCell *)swipeCell atIndex:(int)index;

/**
 设置每一项的宽度
 
 @param swipeCell cell
 @param index 位置自右往左,从0开始
 @return 宽度
 */
- (CGFloat)itemWithForSwipeCell:(LNSwipeCell *)swipeCell atIndex:(int)index;

  • 可能感兴趣的事件协议
/**
 某一个item被点击后触发的事件
 
 @param swipeCell cell
 @param button button
 @param index 位置
 */
- (void)swipeCell:(LNSwipeCell *)swipeCell didSelectButton:(UIButton *)button atIndex:(int)index;


/**
 cell正在所有滑动,手指还没有离开,不确定是打开还是关闭
 
 @param swipeCell cell
 */
- (void)swipeCellMoving:(LNSwipeCell *)swipeCell;

/**
 当左滑打开后触发该事件
 
 @param swipeCell cell
 */
- (void)swipeCellHadOpen:(LNSwipeCell *)swipeCell;

/**
 cell优化打开时触发该事件
 
 @param swipeCell cell
 */
- (void)swipeCellHadClose:(LNSwipeCell *)swipeCell;

more about 【更多】

  1. 如果有什么问题,请在issues区域提问,我会抽时间改进。
  2. 我的博客
  3. 我的微博
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].