Skip to content

Instantly share code, notes, and snippets.

@steipete
Last active January 29, 2018 14:19
Show Gist options
  • Star 80 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save steipete/10541433 to your computer and use it in GitHub Desktop.
Save steipete/10541433 to your computer and use it in GitHub Desktop.
Using the "More" button. Of course the simple way that Apple uses in Mail/iOS is not public. rdar://16600859
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"More";
}
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me...");
// Hide the More/Delete menu.
[self setEditing:NO animated:YES];
}
@MrAlek
Copy link

MrAlek commented Apr 24, 2014

For future reference, I got my App Store app approved using the above mentioned, undocumented delegate calls, compiled with the iOS 7.1 SDK. Might mean Apple will make them public in a future release.

@phatmann
Copy link

@LeoNatan
Copy link

Finally, this has been solved in iOS8!

@Phoebe719
Copy link

@LeoNatan -- Where? Can't seem to find documentation on it in iOS 8. Thx!

@siancu
Copy link

siancu commented Jun 30, 2014

Look for UITableViewRowAction. It seems it has been added in beta2, so far could only find a reference in the API diffs between beta1 and beta2: https://developer.apple.com/library/prerelease/ios//releasenotes/General/iPhoneSeedAPIDiffs/index.html

Also I couldn't get it to work at the moment, but I suppose I'm doing something wrong, as there is at least one person who got it to work: https://twitter.com/marksands/status/481642991745265664

@scheinem
Copy link

scheinem commented Jul 6, 2014

Here is a working example: https://gist.github.com/scheinem/e36835db07486e9f7e64

As I mentioned in the comments make sure you've also implemented tableView:commitEditingStyle:forRowAtIndexPath: in you UITableViewController.

BTW: I updated MSCMoreOptionTableViewCell to be compatible with iOS 8 (beta 2) and added some other functionality.

@Elaz
Copy link

Elaz commented Jul 20, 2014

@scheinem Sorry, but your implementation (MSC) is an insult to coding. Replacing Apple's private api calls with scrambled stringWithFormat and invocations? seriously?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment