Skip to content

SwipeView to recreate the UITableViewRowAction on every view

License

Notifications You must be signed in to change notification settings

Tokta/SwipeableView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwipeableView

SwipeableView to recreate the UITableViewRowAction. You can customize every action with backgroundColor and UIImage easily.

Example

Create SwipeableView and add an action:

let cell = SwipeableView(frame: CGRect(x: 0, y: 0, width: self.frame.size.width, height: 50), backgroundColor: .white)

cell.addAction(title: "Dog",
image: UIImage(named: "dog") ?? UIImage(),
backgroundcolor: UIColor.red) {
self.showAlert("Dog \(num)")
}

For futher instructions see the project demo.

NOTE: SwipeableView works on UITableViewCell as subview and also on UIScrollView. To use it on UITableView Header and Footer use it as subview of Header or Footer, do not pass it directly because it will be resized automatically and the swipe will broke.