首页 > 编程语言 > 详细

swift中editingStyleForRowAtIndexPath的写法

时间:2017-01-05 16:55:03      阅读:300      评论:0      收藏:0      [点我收藏+]

效果图:

技术分享

首先要实现这句tableView.setEditing(true, animated: true)才能弹出左侧的小圆圈

然而在oc中tableview删除的写法百度一下很常见但是swift中包的很严实:

override func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {

        return UITableViewCellEditingStyle(rawValue: UITableViewCellEditingStyle.Delete.rawValue | UITableViewCellEditingStyle.Insert.rawValue)!

    }

这样选择的时候才会变成对号。

swift中editingStyleForRowAtIndexPath的写法

原文:http://www.cnblogs.com/caodedi-88/p/6252599.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!