ICSwipeActionsTableCell 0.2

ICSwipeActionsTableCell 0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2015
SPMSupports SPM

Maintained by nelanelanela.




  • By
  • Natalia Terlecka

ICSwipeActionsTableCell

This is a simple Swift class that lets you add as many additional buttons to a table view cell as you like :-) It’s written in Swift 2.0 and takes full advantage of it’s features, making it super simple tu use. Checkout the demo app to see how it works. And below are the steps needed to add it to your project.

alt tag

Here are the steps:

How to use

You just subclass you own cell with ICSwipeActionsTableCell:

class ICDemoTableViewCell: ICSwipeActionsTableCell

Provide the button titles you want to show (there are right buttons and left buttons options available):

cell.rightButtonsTitles = ["MORE", "DELETE"] 
cell.leftButtonsTitles = ["MORE", "DELETE"] 

And the delegate to forward the calbacks:

cell.delegate = self

You’re done with the basic setup, but if you want more then that you can go much further:

Customisations

It uses differen tuple types to set multiple parameters on the buttons for ex:

cell.rightButtonsTitles = [(title:"FROG", color:UIColor.greenColor(), textColor:UIColor.whiteColor())] 
cell.leftButtonsTitles = [(title:"FROG", color:UIColor.greenColor()), (title:"LION", color:UIColor.yellowColor())] 

It’ll automatically check for the provided type so all you have to worry about is choosing one you like.

You can also change default buttons side margins

cell.buttonsSideMargins = 5

If you want all buttons to be the same width, set buttonsEqualSize flag true.

cell.buttonsEqualSize = true

alt tag

Stay tuned! This library is not left here on it’s own. More features and customisations will come! Please submit issues with you suggestions :-)

Support

Supports iOS 8 and above. Xcode 7.0 is required to build the latest code written in Swift 2.0

License

Copyright © 2015 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license.