在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:YXJSwipeTableViewCell开源软件地址:https://gitee.com/EasySwift/YXJSwipeTableViewCell开源软件介绍:YXJSwipeTableViewCellUITableViewCell左右滑动出现更多按钮,按钮高度自定义 Join Us为了更好的完善EasySwift框架,希望更多对此框架有兴趣的朋友一起加入进来打造最好用最全面扩展最好的swift框架。EasySwift官方QQ群:542916901 Mark先更新Github上的项目,所以最新的项目一定在Github上。 Features
ScreenShotSystem RequirementsiOS 8.0 or above InstallationAs a CocoaPods DependencyAdd the following to your Podfile: pod 'YXJSwipeTableViewCell' VersionV0.0.1 ---- 2016-8-10
Exampleimport UIKitimport YXJSwipeTableViewCellclass ViewController: UITableViewController, YXJSwipeTableViewCellDelegate { override func viewDidLoad() { super.viewDidLoad() } // MARK:table override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 80 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 10 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { weak var cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as? ViewControllerCell cell!.label!.text = "\(indexPath.row)" cell!.setRightUtilityButtons(rightButtons() as [AnyObject], withButtonWidth: (cell?.frame.size.height)!) cell!.delegate = self return cell! } // MAKR:- YXJSwipeTableViewDelegate func rightButtons() -> NSMutableArray { let rightUtilityButtons = NSMutableArray() rightUtilityButtons.YXJ_addUtilityButtonWithColor(UIColor.redColor(), title: "取消关注", titleColor: UIColor.whiteColor(), font: UIFont.systemFontOfSize(15), normalIcon: UIImage(named: "course_noFollow"), selectedIcon: UIImage(named: "course_noFollow"), position: .Top, space: 4) return rightUtilityButtons } func swipeableTableViewCell(cell: YXJSwipeTableViewCell!, didTriggerRightUtilityButtonWithIndex index: Int) { print(">>>>>>>> \(index)") cell.hideUtilityButtonsAnimated(true) } func swipeableTableViewCellShouldHideUtilityButtonsOnSwipe(cell: YXJSwipeTableViewCell!) -> Bool { return true } func swipeableTableViewCell(cell: YXJSwipeTableViewCell!, canSwipeToState state: YXJSwipeCellState) -> Bool { return true } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }} 极致框架
LicenseEasyEmoji is licensed under the Apache License, Version 2.0 License. For more information, please see the LICENSE file. |
请发表评论