系统自带可以进行表格滑动效果的协议方法,只需要这一步!!
// 允许编辑
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
return YES;
}
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"跟进" handler:^(UITableViewRowAction * action, NSIndexPath * indexPath) {
NSLog(@"跟进");
}];
UITableViewRowAction *rowActionSec = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"快速备忘" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"快速备忘"); // 这里做你自己想要做的事情
}];
rowActionSec.backgroundColor = [UIColor yellowColor];
NSArray *arr = @[rowAction,rowActionSec];
return arr;
}
愿阳光充满每一天!!!!
让tabbar消失分割线
[self.tabBar setClipsToBounds:YES];
如果我们的高度是高于49的话,可以使用
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6)
{
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
}
这样那条黑线就会不见了。