UA-17470720-3

Jump to content


Photo
- - - - -

Additional tableViewController Delegate Methods

models actions view-controllers feature-request

  • Please log in to reply
2 replies to this topic

#1 Sam Gerardi

Sam Gerardi

    Jr. Member

  • STV 3.0 Std
  • PipPip
  • 27 posts
  • LocationSan Diego, CA
Reputation: 5
Good

Posted 12 November 2012 - 09:10 PM

I would like to request the addition of 2 new tableViewController delegate methods.


- (BOOL)tableViewControllerShouldBeginEditing.
- (BOOL)tableViewControllerShouldEndEditing:cancelButtonTapped:doneButtonTapped.

These will allow for greater control and customization of the editButton functionality in a tableViewController.

Edited by Sam Gerardi, 21 November 2012 - 04:10 PM.

  • Tarek likes this

#2 Tim Zure

Tim Zure

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 28 posts
Reputation: 0
Neutral

Posted 13 November 2012 - 08:07 AM

This will be a good feature if implemented. We have done this in a hack method into our project to Handle the Edit and cancel button actions.

#3 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 14 December 2012 - 07:58 PM

Thanks guys for all the feedback.

STV 3.1.5 (just released) added three new SCViewControllerActions/SCTableViewControllerActions that should do the job for you. The new actions are: cancelButtonTapped, doneButtonTapped, and editButtonTapped. The actions get called when their respective buttons are tapped, and all allow you to return FALSE if you want the tap to be ignored.

For example, here is how you would override the cancel button from within the view controller itself:
self.actions.cancelButtonTapped = ^BOOL(SCTableViewController *)viewController
{
  if( /* your logic here */ )
     return TRUE; // accept the tap
  //else
  return FALSE; // ignore the tap
}

For more information, please refer to the actions' documentation.
  • wizgod likes this





Also tagged with one or more of these keywords: models, actions, view-controllers, feature-request

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users