TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2015 |
SPMSupports SPM | ✗ |
Maintained by nelanelanela.
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.
Here are the steps:
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:
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
Stay tuned! This library is not left here on it’s own. More features and customisations will come! Please submit issues with you suggestions :-)
Supports iOS 8 and above. Xcode 7.0 is required to build the latest code written in Swift 2.0
Copyright © 2015 ImaginaryCloud, imaginarycloud.com. This library is licensed under the MIT license.