uitableviewrowaction

Swift 3: UITableViewRowActionStyle() “Missing Parameter” Error Msg

房东的猫 提交于 2019-12-19 07:49:16
问题 When I swipe a UITableView cell, the below code is called: func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { //Problem code let delBut = UITableViewRowAction(style: UITableViewRowActionStyle(), title: delete_InLocal) { action, index in //Setup Now that I've started migrating to Swift 3, I get an error message on the UITableViewRowActionStyle(): Missing argument for parameter 'rawValue' in call Anyone know what the syntax for Swift

Swift 3: UITableViewRowActionStyle() “Missing Parameter” Error Msg

亡梦爱人 提交于 2019-12-19 07:49:08
问题 When I swipe a UITableView cell, the below code is called: func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { //Problem code let delBut = UITableViewRowAction(style: UITableViewRowActionStyle(), title: delete_InLocal) { action, index in //Setup Now that I've started migrating to Swift 3, I get an error message on the UITableViewRowActionStyle(): Missing argument for parameter 'rawValue' in call Anyone know what the syntax for Swift

Swift 3 own font for UITableViewCellActionButton

流过昼夜 提交于 2019-12-12 05:40:56
问题 this is my first question here, so feel free to point out anything I might be doing wrong ;) I'm currently trying to give the UITableViewRowAction-Buttons in my Application a custom font. For that I used David Seeks Answer here and put in in an extension like this: extension UITableViewCell{ override open func layoutSubviews() { super.layoutSubviews() for subview in self.subviews { for sub in subview.subviews { if String(describing: sub).range(of: "UITableViewCellActionButton") != nil { for

Issue properly triggering a view controller to open when a UITableView row is pressed?

淺唱寂寞╮ 提交于 2019-12-11 14:57:56
问题 How can I properly trigger a view controller to open when a UITableView row is pressed? I need to allow the user to go back from the view controller back to the tableView and allow them to select the same or a different tableView row. The problem I am currently having is the application crashes when selecting the same row more than once after returning back from ViewController that opens when selecting on one of the rows: scheduledDelivery Currently, this is the code I have: import UIKit

How pass the value of a selected cell to another ViewController?

扶醉桌前 提交于 2019-12-11 07:45:53
问题 Essentially, I have the following UITableViewController that contains custom tableView cells with labels in them. When the cell is selected I would like the value of the cell to be passed to the next view controller where I am using it in an HTTP POST response. What can be added to didSelectRowAt to pass the value of the selected cell to the view controller presented? Perhaps as a variable? The following is my code: import UIKit class ScheduledCell: UITableViewCell { @IBOutlet weak var

How to add image to row action in Table View?

醉酒当歌 提交于 2019-12-04 08:28:10
问题 How to add custom image to delete button when swiping cell from right on UITableview as shown in the below image? func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? { let remove = UITableViewRowAction(style: .Default, title: "\nRemove") { action, indexPath in } remove.backgroundColor = UIColor(patternImage: UIImage(named: "remove")!) } From the above code, Image is showing but, it is showing as a group of images stacked

UITableViewRowAction with image instead of title

。_饼干妹妹 提交于 2019-12-04 04:29:28
I'd like to make a cell swipe action like mail app. I set UIImage to backgroundColor of row action. action.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"remove"]]; But i get my image repeated side-by-side on the background. like this. enter image description here Is the image size problem? Could tell me how to fix it,or an other way to do it ? Yes, this is an image size problem. Even I had a similar requirement and faced the same problem. In this case when you use, action.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"remove"]]; Even if you set

UITableViewRowAction with icon and text

情到浓时终转凉″ 提交于 2019-12-03 14:02:55
问题 There are a couple of similar questions out there, but I think there should be up an up to date answer for iOS 10, using Swift3, that doesn't use private APIs, and doesn't rely on you restricting your icon to the unicode emoji. I have table rows with three actions right now: func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { let rename = UITableViewRowAction(style: .normal, title: "Rename") { (_, indexPath) in self.renameEntry

How to add image to row action in Table View?

会有一股神秘感。 提交于 2019-12-02 23:29:28
How to add custom image to delete button when swiping cell from right on UITableview as shown in the below image? func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? { let remove = UITableViewRowAction(style: .Default, title: "\nRemove") { action, indexPath in } remove.backgroundColor = UIColor(patternImage: UIImage(named: "remove")!) } From the above code, Image is showing but, it is showing as a group of images stacked together. I mean, I am unable to set the "ContentMode" to ".ScaleToAspectFit" for the "UIImage" What is the

Using buttons/images in tableView:editActionsForRowAt:

送分小仙女□ 提交于 2019-12-02 18:19:05
问题 I am trying to use tableView:editActionsForRowAt:, having buttons with images instead of the usual texts. But there are some challenges. Can some one help me? First here is what I have already working, -- with some precious help from SOF -- and here is what I would like to get ideally: The relevant code is below. The first case above is obtained when having xShift and xShiftInc both set to 0.0. The second case is obtained by initializing xShift to 30.0 and xShiftInc to 20.0. Graphically I get