Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

delegate menu actions to ViewController #463

Closed
wants to merge 1 commit into from

Conversation

ghazel
Copy link
Contributor

@ghazel ghazel commented Sep 1, 2014

The basic idea is to show the menu from the cell, but delegate shouldShowMenu/canPerformAction/performAction to the ViewController, as iOS would do and has methods for on UICollectionViewDelegate.

The ActionTarget hack I'm not terribly pleased with. UICollectionViewCell has an undocumented _performAction:sender: which would be perfect for this, but I don't know if overriding it is kosher with the App Store.

If that's ok to use, then all the ActionTarget stuff and targetForAction can be removed and replaced with a simple:

- (void)_performAction:(SEL)action sender:(id)sender
{
    [self.delegate performAction:action forCell:self withSender:sender];
}

@ghazel
Copy link
Contributor Author

ghazel commented Sep 1, 2014

Relevant to #458

@jessesquires
Copy link
Owner

hey @ghazel - this is a bit too hacky, but i've got a better solution coming.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants