MGSwipeTableCell icon indicating copy to clipboard operation
MGSwipeTableCell copied to clipboard

iOS 11 Swift 3 support?

Open appsird opened this issue 9 years ago • 7 comments

Would appreciate an update to the latest.

Thanks,

appsird avatar Jul 21 '16 21:07 appsird

Do you mean iOS 10 ?

FloLecoeuche avatar Jul 25 '16 14:07 FloLecoeuche

Yes, sorry. iOS 10

appsird avatar Jul 25 '16 14:07 appsird

+1

mattgabor avatar Aug 24 '16 23:08 mattgabor

It works for me on iOS 10 / Xcode 8 beta 6 (8S201h).

I am using the delegate, and the only change I had to make was w/rt optional unbinding when creating the actual buttons in the 'swipeButtonsFor' method.

You must explicitly unbind the button object returned from the MGSwipeButton constructor before returning it in your button array. Example:

let moveButton = MGSwipeButton(title: "Move To", backgroundColor: UIColor.orange) let formatButton = MGSwipeButton(title: "Format", backgroundColor: UIColor.darkGray) return [moveButton!, formatButton!]

Before I did this, it was crashing at line 80 in MGSwipeTableCell.m (attempting to calculate the container width based on the button bounds). Now it's working as expected.

chrisblessing avatar Aug 25 '16 20:08 chrisblessing

Xcode 8 also warns about a lack of a [super awakeFromNib] so I added that to MGSwipeTableCell.m'sawakeFromNib.

-(void) awakeFromNib { [super awakeFromNib]; if (!_panRecognizer) { [self initViews:YES]; } }

chrisblessing avatar Aug 25 '16 20:08 chrisblessing

Anyone got this working with the swipeTableCell function?

func swipeTableCell(_ cell: MGSwipeTableCell!, swipeButtonsFor direction: MGSwipeDirection, swipeSettings: MGSwipeSettings!, expansionSettings: MGSwipeExpansionSettings!) -> [AnyObject]! {

For me, with iOS 10, it never gets called.

KantCompute avatar Sep 24 '16 17:09 KantCompute

@spiking , you can try my solution mentioned in https://github.com/MortimerGoro/MGSwipeTableCell/issues/232

gujinku avatar Sep 26 '16 13:09 gujinku