• Stars
    star
    174
  • Rank 211,979 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Context menu similar to the one in the Pinterest iOS app

VLDContextSheet

A clone of the Pinterest iOS app context menu.

BackgroundImage

Example Usage

VLDContextSheetItem *item1 = [[VLDContextSheetItem alloc] initWithTitle: @"Gift"
                                                                  image: [UIImage imageNamed: @"gift"]
                                                       highlightedImage: [UIImage imageNamed: @"gift_highlighted"]];

VLDContextSheetItem *item2 = ...
    
VLDContextSheetItem *item3 = ...
    
self.contextSheet = [[VLDContextSheet alloc] initWithItems: @[ item1, item2, item3 ]];
self.contextSheet.delegate = self;

Show

- (void) longPressed: (UIGestureRecognizer *) gestureRecognizer {
    if(gestureRecognizer.state == UIGestureRecognizerStateBegan) {

        [self.contextSheet startWithGestureRecognizer: gestureRecognizer
                                               inView: self.view];
    }
}

Delegate method

- (void) contextSheet: (VLDContextSheet *) contextSheet didSelectItem: (VLDContextSheetItem *) item {
    NSLog(@"Selected item: %@", item.title);
}

Hide

[self.contextSheet end];

For more info check the Example project.