Created
May 25, 2015 06:51
-
-
Save slav123/c124337677aa5ea77241 to your computer and use it in GitHub Desktop.
show swipe options in tableview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swipe actions | |
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? { | |
/*var superAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Contact:", handler: { (action: UITableViewRowAction!, indexPath: NSIndexPath!) -> Void in | |
let callMenu = UIAlertController(title: nil, message: "Contact using", preferredStyle: .ActionSheet) | |
let phoneAction = UIAlertAction(title: "Phone", style: UIAlertActionStyle.Default, handler: nil) | |
let messageAction = UIAlertAction(title: "Message", style: UIAlertActionStyle.Default, handler: nil) | |
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil) | |
callMenu.addAction(phoneAction) | |
callMenu.addAction(messageAction) | |
callMenu.addAction(cancelAction) | |
self.presentViewController(callMenu, animated: true, completion: nil) | |
})*/ | |
let call = UITableViewRowAction(style: .Normal, title: "Call") { action, index in | |
println("calling") | |
} | |
let message = UITableViewRowAction(style: .Normal, title: "Msg") { action, index in | |
println("msg") | |
} | |
return [call, message] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment