MGSwipeTableCell
MGSwipeTableCell copied to clipboard
iOS 11 Swift 3 support?
Would appreciate an update to the latest.
Thanks,
Do you mean iOS 10 ?
Yes, sorry. iOS 10
+1
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.
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];
}
}
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.
@spiking , you can try my solution mentioned in https://github.com/MortimerGoro/MGSwipeTableCell/issues/232