Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vangelov/VLDContextSheet
Context menu similar to the one in the Pinterest iOS app
https://github.com/vangelov/VLDContextSheet
Last synced: 7 days ago
JSON representation
Context menu similar to the one in the Pinterest iOS app
- Host: GitHub
- URL: https://github.com/vangelov/VLDContextSheet
- Owner: vangelov
- License: mit
- Created: 2014-11-02T14:45:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T16:45:09.000Z (about 9 years ago)
- Last Synced: 2024-08-16T04:31:23.905Z (4 months ago)
- Language: Objective-C
- Homepage:
- Size: 356 KB
- Stars: 174
- Watchers: 14
- Forks: 33
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - VLDContextSheet - Context menu similar to the one in the Pinterest iOS app (UI / Menu)
- awesome-ios-star - VLDContextSheet - Context menu similar to the one in the Pinterest iOS app (UI / Menu)
README
# VLDContextSheet
A clone of the Pinterest iOS app context menu.
![BackgroundImage](https://github.com/vangelov/VLDContextSheet/blob/master/Screenshot.png)
## Example Usage
```objective-c
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
```objective-c
- (void) longPressed: (UIGestureRecognizer *) gestureRecognizer {
if(gestureRecognizer.state == UIGestureRecognizerStateBegan) {[self.contextSheet startWithGestureRecognizer: gestureRecognizer
inView: self.view];
}
}
```
### Delegate method```objective-c
- (void) contextSheet: (VLDContextSheet *) contextSheet didSelectItem: (VLDContextSheetItem *) item {
NSLog(@"Selected item: %@", item.title);
}
```### Hide
```objective-c
[self.contextSheet end];
```For more info check the Example project.