UA-17470720-3

Jump to content


Photo
- - - - -

Event when moving a cell


  • Please log in to reply
3 replies to this topic

#1 Urkman

Urkman

    Experienced Member

  • STV 4.0 Pro
  • PipPipPipPip
  • 59 posts
Reputation: 17
Good

Posted 28 October 2013 - 05:47 AM

Hello,

 

is there an event fired, when a cell is moved?

 

Thanks,

Urkman


  • cratrenue likes this

#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 137
Popular

Posted 28 October 2013 - 08:15 AM

Hi Urkman,

 

There is the SCTableViewModelDelegate method:

 

- (NSIndexPath *)tableViewModel:(SCTableViewModel *)tableModel targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath

 

HTH


Cheers,

Dave

www.dgapps.ie

#3 Urkman

Urkman

    Experienced Member

  • STV 4.0 Pro
  • PipPipPipPip
  • 59 posts
Reputation: 17
Good

Posted 28 October 2013 - 11:53 AM

Hello Dave,

 

thanks for the answer :)

 

But this is not exactly what I'm looking for. I want a delegate function called, when the dragging ends, not on every position change.

 

But anyway, one question to this delegate function:

How can I change the two cells? Lets say, I want to update a counter in this cells?

 

Thanks.

Urkman



#4 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 137
Popular

Posted 28 October 2013 - 07:38 PM

Hi Urkman,

 

I don't think there is any way to be notified when dragging has ended, just that position change method.

 

 

Is it one of the cells that you're moving that you want to update? 

 

 

SCTableViewCell *sourceCell = [tableModel cellAtIndexPath:sourceIndexPath];

 

 

and

 

SCTableViewCell *proposedDestinationCell = [tableModel cellAtIndexPath:proposedDestinationIndexPath];

get you the two cells.

 

As far as I can work out the boundObject cell isn't updated until the table comes out of edit mode, or certainly their order isn't updated.


Cheers,

Dave

www.dgapps.ie




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users