YXJSwipeTableViewCell 0.0.1

YXJSwipeTableViewCell 0.0.1

测试已测试
语言语言 Obj-CObjective-C
许可证 Apache 2
版本最新版本2016年8月

1219721814yxj 维护。




  • stubbornness1219

UITableViewCell 左右滑动显示更多按钮,按钮高度自定义

加入我们

为了更好地完善 EasySwift 框架,希望更多对此框架有兴趣的朋友一起加入进来打造最好用最全面扩展最好的 Swift 框架。《easySwift》官方 QQ 群:542916901

标记

首先更新 Github 上的项目,所以最新的项目一定在Github上。

特色功能

  • 微信,QQ 首页右上角完全一样的菜单效果

屏幕截图

image

系统要求

iOS 8.0 或更高版本

版本

V0.0.1 ---- 2016-8-10

  • 首次发行

示例

import UIKit
import YXJSwipeTableViewCell

class 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()
    }
}

极致框架

  • EasySwift 是从 2014 年开始打造的贯穿整个 Swift 开发的整套解决方案,只为最简单,最高效,最全面,高扩展性,包涵最前沿的架构,思想在其中 EasySwift

许可证

EasyEmoji 使用 Apache License,Version 2.0 许可协议。更多信息,请参阅 LICENSE 文件。