daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Jan 19th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. override func tableView(_ tableView: UITableView,
  2.                         leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration?
  3. {
  4.     let weightAction = UIContextualAction(style: .normal, title:  "Gewicht", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
  5.         success(true)
  6.     })
  7.     weightAction.image = UIImage(named: "Scale")
  8.     weightAction.backgroundColor = UIColor(red: 0/255, green: 122/255, blue: 255/255, alpha: 1)
  9.     return UISwipeActionsConfiguration(actions: [weightAction])
  10. }
  11.    
  12. override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  13.     if segue.identifier == "detailSegue"{
  14.         let rowClicked = (self.tableView.indexPathForSelectedRow?.row)!
  15.         let destVC = segue.destination as! UINavigationController
  16.         let slideVC = destVC.topViewController as! detailViewController
  17.         slideVC.araKuiken = araKuikens[rowClicked]
  18.     }
  19. }
RAW Paste Data
Top