MGSwipeTableCell icon indicating copy to clipboard operation
MGSwipeTableCell copied to clipboard

How to do expansion in Swift?

Open jtan021 opened this issue 9 years ago • 6 comments

I cannot seem to get the expansion to work in Swift. Can someone please explain?

Are there any functions that I need other than these two?

func swipeTableCell(cell: MGSwipeTableCell, canSwipe direction: MGSwipeDirection) -> Bool 

func swipeTableCell(cell: MGSwipeTableCell, swipeButtonsForDirection direction: MGSwipeDirection, swipeSettings: MGSwipeSettings, expansionSettings: MGSwipeExpansionSettings) -> [AnyObject] 

When I tried defining the buttons in the "swipeButtonsForDirection" method, they would not show up in the application. I can only get it to work if I define the buttons in the cellForRowAtIndexPath method.

jtan021 avatar Jul 03 '16 05:07 jtan021

Have you figured this out? I am in the same situation. delegate methods not working!

KodiKraig avatar Jul 06 '16 17:07 KodiKraig

Feel like a noob for sure. I was forgetting to set the cell delegate to self....

https://github.com/MortimerGoro/MGSwipeTableCell/issues/79

KodiKraig avatar Jul 06 '16 18:07 KodiKraig

I did that but still could not get it to work. Did you get expansions to work?

jtan021 avatar Jul 06 '16 23:07 jtan021

Hmm are casting the cell properly? And no my design at the moment doesn't require that functionality.

Sent from my iPhone

On Jul 6, 2016, at 19:11, jtan021 [email protected] wrote:

I did that but still could not get it to work. Did you get expansions to work?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

KodiKraig avatar Jul 06 '16 23:07 KodiKraig

Nevermind I got it to work. Not sure what was wrong before lol I just redid all the steps and it worked this time ._.

jtan021 avatar Jul 06 '16 23:07 jtan021

Nice! It's great when it works out that way ha

Sent from my iPhone

On Jul 6, 2016, at 19:41, jtan021 [email protected] wrote:

Nevermind I got it to work. Not sure what was wrong before lol I just redid all the steps and it worked this time ._.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

KodiKraig avatar Jul 06 '16 23:07 KodiKraig