Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

UITableViewRowAction access button

 override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
    let delete = UITableViewRowAction(style: .Default, title: "u{267A}
 Delete") { action, index in
        print("more button tapped")
        self.tableView(tableView, commitEditingStyle: UITableViewCellEditingStyle.Delete, forRowAtIndexPath: indexPath)
    }
    delete.backgroundColor = UIColor(rgba: "#ef3340")

    let apply = UITableViewRowAction(style: .Default, title: "u{2606}
 Like") { action, index in
        print("favorite button tapped")
        self.tableView(tableView, commitEditingStyle: UITableViewCellEditingStyle.Insert, forRowAtIndexPath: indexPath)
    }
    apply.backgroundColor = UIColor.orangeColor()

    let take = UITableViewRowAction(style: .Normal, title: "u{2605}
 Rate") { action, index in
        print("share button tapped")
        self.tableView(tableView, commitEditingStyle: UITableViewCellEditingStyle.None, forRowAtIndexPath: indexPath)
    }
    take.backgroundColor = UIColor(rgba: "#00ab84")

    return [take, apply, delete]
}
Comment

PREVIOUS NEXT
Code Example
Swift :: how to delete from list tvos swiftui coredata 
Ruby :: see all rails routes in browser 
Ruby :: rails create database only in test 
Ruby :: ruby delete file 
Ruby :: 2 decimal places ruby 
Ruby :: rails resources except 
Ruby :: command to run all rspec tests 
Ruby :: ruby refinement import dynamic methods 
Ruby :: eager load polymorphic rails 
Ruby :: rake db:rollback not doing anything 
Ruby :: rails migration change type of column 
Ruby :: ruby iterate over array 
Ruby :: add references rails migration 
Ruby :: ruby catch all exceptions 
Ruby :: ruby array to string with commas 
Ruby :: ruby run bash command 
Ruby :: array to string ruby 
Ruby :: how to add to an array ruby 
Ruby :: array to hash ruby 
Ruby :: rails logger stdout 
Ruby :: rails parse boolean 
Ruby :: read headers of csv using ruby 
Ruby :: will_paginate gem rails 
Ruby :: ruby generate task 
Ruby :: ruby and or 
Ruby :: add index in rails 
Ruby :: initialize hash with 0 value ruby 
Ruby :: ruby bundler load error 
Ruby :: rails deliver_later with delay 
Ruby :: set db environment to development 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =