Repository: vangelov/VLDContextSheet Branch: master Commit: ae73cfdda68a Files: 30 Total size: 56.4 KB Directory structure: gitextract_9vxp4bps/ ├── .gitignore ├── LICENSE ├── README.md ├── VLDContextSheet/ │ ├── VLDContextSheet.h │ ├── VLDContextSheet.m │ ├── VLDContextSheetItem.h │ ├── VLDContextSheetItem.m │ ├── VLDContextSheetItemView.h │ └── VLDContextSheetItemView.m └── VLDContextSheetExample/ ├── VLDContextSheetExample/ │ ├── Images.xcassets/ │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage/ │ │ │ └── Contents.json │ │ ├── add.imageset/ │ │ │ └── Contents.json │ │ ├── add_highlighted.imageset/ │ │ │ └── Contents.json │ │ ├── gift.imageset/ │ │ │ └── Contents.json │ │ ├── gift_highlighted.imageset/ │ │ │ └── Contents.json │ │ ├── share.imageset/ │ │ │ └── Contents.json │ │ └── share_highlighted.imageset/ │ │ └── Contents.json │ ├── VLDAppDelegate.h │ ├── VLDAppDelegate.m │ ├── VLDContextSheetExample-Info.plist │ ├── VLDContextSheetExample-Prefix.pch │ ├── VLDExampleViewController.h │ ├── VLDExampleViewController.m │ ├── en.lproj/ │ │ └── InfoPlist.strings │ └── main.m ├── VLDContextSheetExample.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata └── VLDContextSheetExampleTests/ ├── VLDContextSheetExampleTests-Info.plist ├── VLDContextSheetExampleTests.m └── en.lproj/ └── InfoPlist.strings ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # # Pods/ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014 Vladimir Angelov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # 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. ================================================ FILE: VLDContextSheet/VLDContextSheet.h ================================================ // // VLDContextSheet.h // // Created by Vladimir Angelov on 2/7/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import @class VLDContextSheet; @class VLDContextSheetItem; @protocol VLDContextSheetDelegate - (void) contextSheet: (VLDContextSheet *) contextSheet didSelectItem: (VLDContextSheetItem *) item; @end @interface VLDContextSheet : UIView @property (assign, nonatomic) NSInteger radius; @property (assign, nonatomic) CGFloat rotation; @property (assign, nonatomic) CGFloat rangeAngle; @property (strong, nonatomic) NSArray *items; @property (assign, nonatomic) id delegate; - (id) initWithItems: (NSArray *) items; - (void) startWithGestureRecognizer: (UIGestureRecognizer *) gestureRecognizer inView: (UIView *) view; - (void) end; @end ================================================ FILE: VLDContextSheet/VLDContextSheet.m ================================================ // // VLDContextSheet.m // // Created by Vladimir Angelov on 2/7/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import "VLDContextSheetItemView.h" #import "VLDContextSheet.h" typedef struct { CGRect rect; CGFloat rotation; } VLDZone; static const NSInteger VLDMaxTouchDistanceAllowance = 40; static const NSInteger VLDZonesCount = 10; static inline VLDZone VLDZoneMake(CGRect rect, CGFloat rotation) { VLDZone zone; zone.rect = rect; zone.rotation = rotation; return zone; } static CGFloat VLDVectorDotProduct(CGPoint vector1, CGPoint vector2) { return vector1.x * vector2.x + vector1.y * vector2.y; } static CGFloat VLDVectorLength(CGPoint vector) { return sqrt(vector.x * vector.x + vector.y * vector.y); } static CGRect VLDOrientedScreenBounds() { CGRect bounds = [UIScreen mainScreen].bounds; if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation) && bounds.size.width < bounds.size.height) { bounds.size = CGSizeMake(bounds.size.height, bounds.size.width); } return bounds; } @interface VLDContextSheet () @property (strong, nonatomic) NSArray *itemViews; @property (strong, nonatomic) UIView *centerView; @property (strong, nonatomic) UIView *backgroundView; @property (strong, nonatomic) VLDContextSheetItemView *selectedItemView; @property (assign, nonatomic) BOOL openAnimationFinished; @property (assign, nonatomic) CGPoint touchCenter; @property (strong, nonatomic) UIGestureRecognizer *starterGestureRecognizer; @end @implementation VLDContextSheet { VLDZone zones[VLDZonesCount]; } - (id) initWithFrame: (CGRect) frame { return [self initWithItems: nil]; } - (id) initWithItems: (NSArray *) items { self = [super initWithFrame: VLDOrientedScreenBounds()]; if(self) { _items = items; _radius = 100; _rangeAngle = M_PI / 1.6; [self createSubviews]; } return self; } - (void) dealloc { [self.starterGestureRecognizer removeTarget: self action: @selector(gestureRecognizedStateObserver:)]; } - (void) createSubviews { _backgroundView = [[UIView alloc] initWithFrame: CGRectZero]; _backgroundView.backgroundColor = [UIColor colorWithWhite: 0 alpha: 0.6]; [self addSubview: self.backgroundView]; _itemViews = [[NSMutableArray alloc] init]; for(VLDContextSheetItem *item in _items) { VLDContextSheetItemView *itemView = [[VLDContextSheetItemView alloc] init]; itemView.item = item; [self addSubview: itemView]; [(NSMutableArray *) _itemViews addObject: itemView]; } VLDContextSheetItemView *sampleItemView = _itemViews[0]; _centerView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, sampleItemView.frame.size.width, sampleItemView.frame.size.width)]; _centerView.layer.cornerRadius = 25; _centerView.layer.borderWidth = 2; _centerView.layer.borderColor = [UIColor grayColor].CGColor; [self addSubview: _centerView]; } - (void) layoutSubviews { [super layoutSubviews]; self.backgroundView.frame = self.bounds; } - (void) setCenterViewHighlighted: (BOOL) highlighted { _centerView.backgroundColor = highlighted ? [UIColor colorWithWhite: 0.5 alpha: 0.4] : nil; } - (void) createZones { CGRect screenRect = self.bounds; NSInteger rowHeight1 = 120; zones[0] = VLDZoneMake(CGRectMake(0, 0, 70, rowHeight1), 0.8); zones[1] = VLDZoneMake(CGRectMake(zones[0].rect.size.width, 0, 40, rowHeight1), 0.4); zones[2] = VLDZoneMake(CGRectMake(zones[1].rect.origin.x + zones[1].rect.size.width, 0, screenRect.size.width - 2 *(zones[0].rect.size.width + zones[1].rect.size.width), rowHeight1), 0); zones[3] = VLDZoneMake(CGRectMake(zones[2].rect.origin.x + zones[2].rect.size.width, 0, zones[1].rect.size.width, rowHeight1), -zones[1].rotation); zones[4] = VLDZoneMake(CGRectMake(zones[3].rect.origin.x + zones[3].rect.size.width, 0, zones[0].rect.size.width, rowHeight1), -zones[0].rotation); NSInteger rowHeight2 = screenRect.size.height - zones[0].rect.size.height; zones[5] = VLDZoneMake(CGRectMake(0, zones[0].rect.size.height, zones[0].rect.size.width, rowHeight2), M_PI - zones[0].rotation); zones[6] = VLDZoneMake(CGRectMake(zones[5].rect.size.width, zones[5].rect.origin.y, zones[1].rect.size.width, rowHeight2), M_PI - zones[1].rotation); zones[7] = VLDZoneMake(CGRectMake(zones[6].rect.origin.x + zones[6].rect.size.width, zones[5].rect.origin.y, zones[2].rect.size.width, rowHeight2), M_PI - zones[2].rotation); zones[8] = VLDZoneMake(CGRectMake(zones[7].rect.origin.x + zones[7].rect.size.width, zones[5].rect.origin.y, zones[3].rect.size.width, rowHeight2), M_PI - zones[3].rotation); zones[9] = VLDZoneMake(CGRectMake(zones[8].rect.origin.x + zones[8].rect.size.width, zones[5].rect.origin.y, zones[4].rect.size.width, rowHeight2), M_PI - zones[4].rotation); } /* Only used for testing the touch zones */ - (void) drawZones { for(int i = 0; i < VLDZonesCount; i++) { UIView *zoneView = [[UIView alloc] initWithFrame: zones[i].rect]; CGFloat hue = ( arc4random() % 256 / 256.0 ); CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; UIColor *color = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; zoneView.backgroundColor = color; [self addSubview: zoneView]; } } - (void) updateItemView: (UIView *) itemView touchDistance: (CGFloat) touchDistance animated: (BOOL) animated { if(!animated) { [self updateItemViewNotAnimated: itemView touchDistance: touchDistance]; } else { [UIView animateWithDuration: 0.4 delay: 0 usingSpringWithDamping: 0.45 initialSpringVelocity: 7.5 options: UIViewAnimationOptionBeginFromCurrentState animations: ^{ [self updateItemViewNotAnimated: itemView touchDistance: touchDistance]; } completion: nil]; } } - (void) updateItemViewNotAnimated: (UIView *) itemView touchDistance: (CGFloat) touchDistance { NSInteger itemIndex = [self.itemViews indexOfObject: itemView]; CGFloat angle = -0.65 + self.rotation + itemIndex * (self.rangeAngle / self.itemViews.count); CGFloat resistanceFactor = 1.0 / (touchDistance > 0 ? 6.0 : 3.0); itemView.center = CGPointMake(self.touchCenter.x + (self.radius + touchDistance * resistanceFactor) * sin(angle), self.touchCenter.y + (self.radius + touchDistance * resistanceFactor) * cos(angle)); CGFloat scale = 1 + 0.2 * (fabs(touchDistance) / self.radius); itemView.transform = CGAffineTransformMakeScale(scale, scale); } - (void) openItemsFromCenterView { self.openAnimationFinished = NO; for(int i = 0; i < self.itemViews.count; i++) { VLDContextSheetItemView *itemView = self.itemViews[i]; itemView.transform = CGAffineTransformIdentity; itemView.center = self.touchCenter; [itemView setHighlighted: NO animated: NO]; [UIView animateWithDuration: 0.5 delay: i * 0.01 usingSpringWithDamping: 0.45 initialSpringVelocity: 7.5 options: 0 animations: ^{ [self updateItemViewNotAnimated: itemView touchDistance: 0.0]; } completion: ^(BOOL finished) { self.openAnimationFinished = YES; }]; } } - (void) closeItemsToCenterView { [UIView animateWithDuration: 0.1 delay: 0.0 options: UIViewAnimationOptionCurveEaseInOut animations:^{ self.alpha = 0.0; } completion:^(BOOL finished) { [self removeFromSuperview]; self.alpha = 1.0; }]; } - (void) startWithGestureRecognizer: (UIGestureRecognizer *) gestureRecognizer inView: (UIView *) view { [view addSubview: self]; self.frame = VLDOrientedScreenBounds(); [self createZones]; self.starterGestureRecognizer = gestureRecognizer; self.touchCenter = [self.starterGestureRecognizer locationInView: self]; self.centerView.center = self.touchCenter; self.selectedItemView = nil; [self setCenterViewHighlighted: YES]; self.rotation = [self rotationForCenter: self.centerView.center]; [self openItemsFromCenterView]; [self.starterGestureRecognizer addTarget: self action: @selector(gestureRecognizedStateObserver:)]; } - (CGFloat) rotationForCenter: (CGPoint) center { for(NSInteger i = 0; i < 10; i++) { VLDZone zone = zones[i]; if(CGRectContainsPoint(zone.rect, center)) { return zone.rotation; } } return 0; } - (void) gestureRecognizedStateObserver: (UIGestureRecognizer *) gestureRecognizer { if(self.openAnimationFinished && gestureRecognizer.state == UIGestureRecognizerStateChanged) { CGPoint touchPoint = [gestureRecognizer locationInView: self]; [self updateItemViewsForTouchPoint: touchPoint]; } else if(gestureRecognizer.state == UIGestureRecognizerStateEnded || gestureRecognizer.state == UIGestureRecognizerStateCancelled) { if(gestureRecognizer.state == UIGestureRecognizerStateCancelled) { self.selectedItemView = nil; } [self end]; } } - (CGFloat) signedTouchDistanceForTouchVector: (CGPoint) touchVector itemView: (UIView *) itemView { CGFloat touchDistance = VLDVectorLength(touchVector); CGPoint oldCenter = itemView.center; CGAffineTransform oldTransform = itemView.transform; [self updateItemViewNotAnimated: itemView touchDistance: self.radius + 40]; if(!CGRectContainsRect(self.bounds, itemView.frame)) { touchDistance = -touchDistance; } itemView.center = oldCenter; itemView.transform = oldTransform; return touchDistance; } - (void) updateItemViewsForTouchPoint: (CGPoint) touchPoint { CGPoint touchVector = {touchPoint.x - self.touchCenter.x, touchPoint.y - self.touchCenter.y}; VLDContextSheetItemView *itemView = [self itemViewForTouchVector: touchVector]; CGFloat touchDistance = [self signedTouchDistanceForTouchVector: touchVector itemView: itemView]; if(fabs(touchDistance) <= VLDMaxTouchDistanceAllowance) { self.centerView.center = CGPointMake(self.touchCenter.x + touchVector.x, self.touchCenter.y + touchVector.y); [self setCenterViewHighlighted: YES]; } else { [self setCenterViewHighlighted: NO]; [UIView animateWithDuration: 0.4 delay: 0 usingSpringWithDamping: 0.35 initialSpringVelocity: 7.5 options: UIViewAnimationOptionBeginFromCurrentState animations: ^{ self.centerView.center = self.touchCenter; } completion: nil]; } if(touchDistance > self.radius + VLDMaxTouchDistanceAllowance) { [itemView setHighlighted: NO animated: YES]; [self updateItemView: itemView touchDistance: 0.0 animated: YES]; self.selectedItemView = nil; return; } if(itemView != self.selectedItemView) { [self.selectedItemView setHighlighted: NO animated: YES]; [self updateItemView: self.selectedItemView touchDistance: 0.0 animated: YES]; [self updateItemView: itemView touchDistance: touchDistance animated: YES]; [self bringSubviewToFront: itemView]; } else { [self updateItemView: itemView touchDistance: touchDistance animated: NO]; } if(fabs(touchDistance) > VLDMaxTouchDistanceAllowance) { [itemView setHighlighted: YES animated: YES]; } self.selectedItemView = itemView; } - (VLDContextSheetItemView *) itemViewForTouchVector: (CGPoint) touchVector { CGFloat maxCosOfAngle = -2; VLDContextSheetItemView *resultItemView = nil; for(int i = 0; i < self.itemViews.count; i++) { VLDContextSheetItemView *itemView = self.itemViews[i]; CGPoint itemViewVector = { itemView.center.x - self.touchCenter.x, itemView.center.y - self.touchCenter.y }; CGFloat cosOfAngle = VLDVectorDotProduct(itemViewVector, touchVector) / VLDVectorLength(itemViewVector); if(cosOfAngle > maxCosOfAngle) { maxCosOfAngle = cosOfAngle; resultItemView = itemView; } } return resultItemView; } - (void) end { [self.starterGestureRecognizer removeTarget: self action: @selector(gestureRecognizedStateObserver:)]; if(self.selectedItemView && self.selectedItemView.isHighlighted) { [self.delegate contextSheet: self didSelectItem: self.selectedItemView.item]; } [self closeItemsToCenterView]; } @end ================================================ FILE: VLDContextSheet/VLDContextSheetItem.h ================================================ // // VLDContextSheetItem.h // // Created by Vladimir Angelov on 2/10/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import @interface VLDContextSheetItem : NSObject - (id) initWithTitle: (NSString *) title image: (UIImage *) image highlightedImage: (UIImage *) highlightedImage; @property (strong, readonly) NSString *title; @property (strong, readonly) UIImage *image; @property (strong, readonly) UIImage *highlightedImage; @property (assign, readwrite, getter = isEnabled) BOOL enabled; @end ================================================ FILE: VLDContextSheet/VLDContextSheetItem.m ================================================ // // VLDContextSheetItem.m // // Created by Vladimir Angelov on 2/10/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import "VLDContextSheetItem.h" @implementation VLDContextSheetItem - (id) initWithTitle: (NSString *) title image: (UIImage *) image highlightedImage: (UIImage *) highlightedImage { self = [super init]; if(self) { _title = title; _image = image; _highlightedImage = highlightedImage; _enabled = YES; } return self; } @end ================================================ FILE: VLDContextSheet/VLDContextSheetItemView.h ================================================ // // VLDContextSheetItem.h // // Created by Vladimir Angelov on 2/9/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import @class VLDContextSheetItem; @interface VLDContextSheetItemView : UIView @property (strong, nonatomic) VLDContextSheetItem *item; @property (readonly) BOOL isHighlighted; - (void) setHighlighted: (BOOL) highlighted animated: (BOOL) animated; @end ================================================ FILE: VLDContextSheet/VLDContextSheetItemView.m ================================================ // // VLDContextSheetItemView.m, // // Created by Vladimir Angelov on 2/9/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import "VLDContextSheetItemView.h" #import "VLDContextSheetItem.h" #import static const NSInteger VLDTextPadding = 5; @interface VLDContextSheetItemView () @property (nonatomic, strong) UIImageView *imageView; @property (nonatomic, strong) UIImageView *highlightedImageView; @property (nonatomic, strong) UILabel *label; @property (nonatomic, assign) NSInteger labelWidth; @end @implementation VLDContextSheetItemView @synthesize item = _item; - (id) initWithFrame: (CGRect) frame { self = [super initWithFrame: CGRectMake(0, 0, 50, 83)]; if(self) { [self createSubviews]; } return self; } - (void) createSubviews { _imageView = [[UIImageView alloc] init]; [self addSubview: _imageView]; _highlightedImageView = [[UIImageView alloc] init]; _highlightedImageView.alpha = 0.0; [self addSubview: _highlightedImageView]; _label = [[UILabel alloc] init]; _label.clipsToBounds = YES; _label.font = [UIFont systemFontOfSize: 10]; _label.textAlignment = NSTextAlignmentCenter; _label.layer.cornerRadius = 7; _label.backgroundColor = [UIColor colorWithWhite: 0.0 alpha: 0.4]; _label.textColor = [UIColor whiteColor]; _label.alpha = 0.0; [self addSubview: _label]; } - (void) layoutSubviews { [super layoutSubviews]; self.imageView.frame = CGRectMake(0, (self.frame.size.height - self.frame.size.width) / 2, self.frame.size.width, self.frame.size.width); self.highlightedImageView.frame = self.imageView.frame; self.label.frame = CGRectMake((self.frame.size.width - self.labelWidth) / 2.0, 0, self.labelWidth, 14); } - (void) setItem:(VLDContextSheetItem *)item { _item = item; [self updateImages]; [self updateLabelText]; } - (void) updateImages { self.imageView.image = self.item.image; self.highlightedImageView.image = self.item.highlightedImage; self.imageView.alpha = self.item.isEnabled ? 1.0 : 0.3; } - (void) updateLabelText { self.label.text = self.item.title; self.labelWidth = 2 * VLDTextPadding + ceil([self.label.text sizeWithAttributes: @{ NSFontAttributeName: self.label.font }].width); [self setNeedsDisplay]; } - (void) setHighlighted: (BOOL) highlighted animated: (BOOL) animated { if (!self.item.isEnabled) { return; } _isHighlighted = highlighted; [UIView animateWithDuration: animated ? 0.3 : 0.0 delay: 0.0 options: UIViewAnimationOptionCurveEaseInOut animations:^{ self.highlightedImageView.alpha = (highlighted ? 1.0 : 0.0); self.imageView.alpha = 1 - self.highlightedImageView.alpha; self.label.alpha = self.highlightedImageView.alpha; } completion: nil]; } @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/LaunchImage.launchimage/Contents.json ================================================ { "images" : [ { "orientation" : "portrait", "idiom" : "iphone", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", "subtype" : "retina4", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/add.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "add_to_collection_button@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/add_highlighted.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "add_to_collection_button2@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/gift.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "gift_button@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/gift_highlighted.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "gift_button2@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/share.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "share_button@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/Images.xcassets/share_highlighted.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "share_button2@2x.png" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDAppDelegate.h ================================================ // // VLDAppDelegate.h // VLDContextSheetExample // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import @class VLDExampleViewController; @interface VLDAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) VLDExampleViewController *viewController; @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDAppDelegate.m ================================================ // // VLDAppDelegate.m // VLDContextSheetExample // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import "VLDAppDelegate.h" #import "VLDExampleViewController.h" @implementation VLDAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; self.viewController = [[VLDExampleViewController alloc] init]; self.window.rootViewController = self.viewController; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDContextSheetExample-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.example.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDContextSheetExample-Prefix.pch ================================================ // // Prefix header // // The contents of this file are implicitly included at the beginning of every source file. // #import #ifndef __IPHONE_3_0 #warning "This project uses features only available in iOS SDK 3.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDExampleViewController.h ================================================ // // VLDExampleViewController.h // VLDContextSheetExample // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import #import "VLDContextSheet.h" @interface VLDExampleViewController : UIViewController @property (strong, nonatomic) VLDContextSheet *contextSheet; @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/VLDExampleViewController.m ================================================ // // VLDExampleViewController.m // VLDContextSheetExample // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import "VLDExampleViewController.h" #import "VLDContextSheetItem.h" @implementation VLDExampleViewController - (void) viewDidLoad { [super viewDidLoad]; [self createContextSheet]; self.view.backgroundColor = [UIColor grayColor]; UIGestureRecognizer *gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget: self action: @selector(longPressed:)]; [self.view addGestureRecognizer: gestureRecognizer]; } - (void) createContextSheet { VLDContextSheetItem *item1 = [[VLDContextSheetItem alloc] initWithTitle: @"Gift" image: [UIImage imageNamed: @"gift"] highlightedImage: [UIImage imageNamed: @"gift_highlighted"]]; VLDContextSheetItem *item2 = [[VLDContextSheetItem alloc] initWithTitle: @"Add to" image: [UIImage imageNamed: @"add"] highlightedImage: [UIImage imageNamed: @"add_highlighted"]]; VLDContextSheetItem *item3 = [[VLDContextSheetItem alloc] initWithTitle: @"Share" image: [UIImage imageNamed: @"share"] highlightedImage: [UIImage imageNamed: @"share_highlighted"]]; self.contextSheet = [[VLDContextSheet alloc] initWithItems: @[ item1, item2, item3 ]]; self.contextSheet.delegate = self; } - (void) contextSheet: (VLDContextSheet *) contextSheet didSelectItem: (VLDContextSheetItem *) item { NSLog(@"Selected item: %@", item.title); } - (void) longPressed: (UIGestureRecognizer *) gestureRecognizer { if(gestureRecognizer.state == UIGestureRecognizerStateBegan) { [self.contextSheet startWithGestureRecognizer: gestureRecognizer inView: self.view]; } } - (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation duration: (NSTimeInterval) duration { [super willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration]; [self.contextSheet end]; } @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample/main.m ================================================ // // main.m // VLDContextSheetExample // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import #import "VLDAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([VLDAppDelegate class])); } } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 75001E4F1A0662990098C5C4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E4E1A0662990098C5C4 /* Foundation.framework */; }; 75001E511A0662990098C5C4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E501A0662990098C5C4 /* CoreGraphics.framework */; }; 75001E531A0662990098C5C4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E521A0662990098C5C4 /* UIKit.framework */; }; 75001E591A06629A0098C5C4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 75001E571A06629A0098C5C4 /* InfoPlist.strings */; }; 75001E5B1A06629A0098C5C4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E5A1A06629A0098C5C4 /* main.m */; }; 75001E5F1A06629A0098C5C4 /* VLDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E5E1A06629A0098C5C4 /* VLDAppDelegate.m */; }; 75001E611A06629A0098C5C4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75001E601A06629A0098C5C4 /* Images.xcassets */; }; 75001E681A06629A0098C5C4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E671A06629A0098C5C4 /* XCTest.framework */; }; 75001E691A06629A0098C5C4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E4E1A0662990098C5C4 /* Foundation.framework */; }; 75001E6A1A06629A0098C5C4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75001E521A0662990098C5C4 /* UIKit.framework */; }; 75001E721A06629A0098C5C4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 75001E701A06629A0098C5C4 /* InfoPlist.strings */; }; 75001E741A06629A0098C5C4 /* VLDContextSheetExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E731A06629A0098C5C4 /* VLDContextSheetExampleTests.m */; }; 75001E841A0662CF0098C5C4 /* VLDContextSheetItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E7F1A0662CF0098C5C4 /* VLDContextSheetItem.m */; }; 75001E851A0662CF0098C5C4 /* VLDContextSheetItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E811A0662CF0098C5C4 /* VLDContextSheetItemView.m */; }; 75001E861A0662CF0098C5C4 /* VLDContextSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E831A0662CF0098C5C4 /* VLDContextSheet.m */; }; 75001E891A0663190098C5C4 /* VLDExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 75001E881A0663190098C5C4 /* VLDExampleViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 75001E6B1A06629A0098C5C4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 75001E431A0662990098C5C4 /* Project object */; proxyType = 1; remoteGlobalIDString = 75001E4A1A0662990098C5C4; remoteInfo = VLDContextSheetExample; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 75001E4B1A0662990098C5C4 /* VLDContextSheetExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VLDContextSheetExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 75001E4E1A0662990098C5C4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 75001E501A0662990098C5C4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 75001E521A0662990098C5C4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 75001E561A06629A0098C5C4 /* VLDContextSheetExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "VLDContextSheetExample-Info.plist"; sourceTree = ""; }; 75001E581A06629A0098C5C4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 75001E5A1A06629A0098C5C4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 75001E5C1A06629A0098C5C4 /* VLDContextSheetExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLDContextSheetExample-Prefix.pch"; sourceTree = ""; }; 75001E5D1A06629A0098C5C4 /* VLDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLDAppDelegate.h; sourceTree = ""; }; 75001E5E1A06629A0098C5C4 /* VLDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLDAppDelegate.m; sourceTree = ""; }; 75001E601A06629A0098C5C4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 75001E661A06629A0098C5C4 /* VLDContextSheetExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VLDContextSheetExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 75001E671A06629A0098C5C4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 75001E6F1A06629A0098C5C4 /* VLDContextSheetExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "VLDContextSheetExampleTests-Info.plist"; sourceTree = ""; }; 75001E711A06629A0098C5C4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 75001E731A06629A0098C5C4 /* VLDContextSheetExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLDContextSheetExampleTests.m; sourceTree = ""; }; 75001E7E1A0662CF0098C5C4 /* VLDContextSheetItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLDContextSheetItem.h; sourceTree = ""; }; 75001E7F1A0662CF0098C5C4 /* VLDContextSheetItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLDContextSheetItem.m; sourceTree = ""; }; 75001E801A0662CF0098C5C4 /* VLDContextSheetItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLDContextSheetItemView.h; sourceTree = ""; }; 75001E811A0662CF0098C5C4 /* VLDContextSheetItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLDContextSheetItemView.m; sourceTree = ""; }; 75001E821A0662CF0098C5C4 /* VLDContextSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLDContextSheet.h; sourceTree = ""; }; 75001E831A0662CF0098C5C4 /* VLDContextSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLDContextSheet.m; sourceTree = ""; }; 75001E871A0663190098C5C4 /* VLDExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLDExampleViewController.h; sourceTree = ""; }; 75001E881A0663190098C5C4 /* VLDExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLDExampleViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 75001E481A0662990098C5C4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 75001E511A0662990098C5C4 /* CoreGraphics.framework in Frameworks */, 75001E531A0662990098C5C4 /* UIKit.framework in Frameworks */, 75001E4F1A0662990098C5C4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 75001E631A06629A0098C5C4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 75001E681A06629A0098C5C4 /* XCTest.framework in Frameworks */, 75001E6A1A06629A0098C5C4 /* UIKit.framework in Frameworks */, 75001E691A06629A0098C5C4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 75001E421A0662990098C5C4 = { isa = PBXGroup; children = ( 75001E7D1A0662CF0098C5C4 /* VLDContextSheet */, 75001E541A06629A0098C5C4 /* VLDContextSheetExample */, 75001E6D1A06629A0098C5C4 /* VLDContextSheetExampleTests */, 75001E4D1A0662990098C5C4 /* Frameworks */, 75001E4C1A0662990098C5C4 /* Products */, ); sourceTree = ""; }; 75001E4C1A0662990098C5C4 /* Products */ = { isa = PBXGroup; children = ( 75001E4B1A0662990098C5C4 /* VLDContextSheetExample.app */, 75001E661A06629A0098C5C4 /* VLDContextSheetExampleTests.xctest */, ); name = Products; sourceTree = ""; }; 75001E4D1A0662990098C5C4 /* Frameworks */ = { isa = PBXGroup; children = ( 75001E4E1A0662990098C5C4 /* Foundation.framework */, 75001E501A0662990098C5C4 /* CoreGraphics.framework */, 75001E521A0662990098C5C4 /* UIKit.framework */, 75001E671A06629A0098C5C4 /* XCTest.framework */, ); name = Frameworks; sourceTree = ""; }; 75001E541A06629A0098C5C4 /* VLDContextSheetExample */ = { isa = PBXGroup; children = ( 75001E5D1A06629A0098C5C4 /* VLDAppDelegate.h */, 75001E5E1A06629A0098C5C4 /* VLDAppDelegate.m */, 75001E871A0663190098C5C4 /* VLDExampleViewController.h */, 75001E881A0663190098C5C4 /* VLDExampleViewController.m */, 75001E601A06629A0098C5C4 /* Images.xcassets */, 75001E551A06629A0098C5C4 /* Supporting Files */, ); path = VLDContextSheetExample; sourceTree = ""; }; 75001E551A06629A0098C5C4 /* Supporting Files */ = { isa = PBXGroup; children = ( 75001E561A06629A0098C5C4 /* VLDContextSheetExample-Info.plist */, 75001E571A06629A0098C5C4 /* InfoPlist.strings */, 75001E5A1A06629A0098C5C4 /* main.m */, 75001E5C1A06629A0098C5C4 /* VLDContextSheetExample-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 75001E6D1A06629A0098C5C4 /* VLDContextSheetExampleTests */ = { isa = PBXGroup; children = ( 75001E731A06629A0098C5C4 /* VLDContextSheetExampleTests.m */, 75001E6E1A06629A0098C5C4 /* Supporting Files */, ); path = VLDContextSheetExampleTests; sourceTree = ""; }; 75001E6E1A06629A0098C5C4 /* Supporting Files */ = { isa = PBXGroup; children = ( 75001E6F1A06629A0098C5C4 /* VLDContextSheetExampleTests-Info.plist */, 75001E701A06629A0098C5C4 /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; 75001E7D1A0662CF0098C5C4 /* VLDContextSheet */ = { isa = PBXGroup; children = ( 75001E7E1A0662CF0098C5C4 /* VLDContextSheetItem.h */, 75001E7F1A0662CF0098C5C4 /* VLDContextSheetItem.m */, 75001E801A0662CF0098C5C4 /* VLDContextSheetItemView.h */, 75001E811A0662CF0098C5C4 /* VLDContextSheetItemView.m */, 75001E821A0662CF0098C5C4 /* VLDContextSheet.h */, 75001E831A0662CF0098C5C4 /* VLDContextSheet.m */, ); name = VLDContextSheet; path = ../VLDContextSheet; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 75001E4A1A0662990098C5C4 /* VLDContextSheetExample */ = { isa = PBXNativeTarget; buildConfigurationList = 75001E771A06629A0098C5C4 /* Build configuration list for PBXNativeTarget "VLDContextSheetExample" */; buildPhases = ( 75001E471A0662990098C5C4 /* Sources */, 75001E481A0662990098C5C4 /* Frameworks */, 75001E491A0662990098C5C4 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = VLDContextSheetExample; productName = VLDContextSheetExample; productReference = 75001E4B1A0662990098C5C4 /* VLDContextSheetExample.app */; productType = "com.apple.product-type.application"; }; 75001E651A06629A0098C5C4 /* VLDContextSheetExampleTests */ = { isa = PBXNativeTarget; buildConfigurationList = 75001E7A1A06629A0098C5C4 /* Build configuration list for PBXNativeTarget "VLDContextSheetExampleTests" */; buildPhases = ( 75001E621A06629A0098C5C4 /* Sources */, 75001E631A06629A0098C5C4 /* Frameworks */, 75001E641A06629A0098C5C4 /* Resources */, ); buildRules = ( ); dependencies = ( 75001E6C1A06629A0098C5C4 /* PBXTargetDependency */, ); name = VLDContextSheetExampleTests; productName = VLDContextSheetExampleTests; productReference = 75001E661A06629A0098C5C4 /* VLDContextSheetExampleTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 75001E431A0662990098C5C4 /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = VLD; LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Vladimir Angelov"; TargetAttributes = { 75001E651A06629A0098C5C4 = { TestTargetID = 75001E4A1A0662990098C5C4; }; }; }; buildConfigurationList = 75001E461A0662990098C5C4 /* Build configuration list for PBXProject "VLDContextSheetExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 75001E421A0662990098C5C4; productRefGroup = 75001E4C1A0662990098C5C4 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 75001E4A1A0662990098C5C4 /* VLDContextSheetExample */, 75001E651A06629A0098C5C4 /* VLDContextSheetExampleTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 75001E491A0662990098C5C4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 75001E591A06629A0098C5C4 /* InfoPlist.strings in Resources */, 75001E611A06629A0098C5C4 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 75001E641A06629A0098C5C4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 75001E721A06629A0098C5C4 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 75001E471A0662990098C5C4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 75001E891A0663190098C5C4 /* VLDExampleViewController.m in Sources */, 75001E861A0662CF0098C5C4 /* VLDContextSheet.m in Sources */, 75001E851A0662CF0098C5C4 /* VLDContextSheetItemView.m in Sources */, 75001E5B1A06629A0098C5C4 /* main.m in Sources */, 75001E841A0662CF0098C5C4 /* VLDContextSheetItem.m in Sources */, 75001E5F1A06629A0098C5C4 /* VLDAppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 75001E621A06629A0098C5C4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 75001E741A06629A0098C5C4 /* VLDContextSheetExampleTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 75001E6C1A06629A0098C5C4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 75001E4A1A0662990098C5C4 /* VLDContextSheetExample */; targetProxy = 75001E6B1A06629A0098C5C4 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 75001E571A06629A0098C5C4 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 75001E581A06629A0098C5C4 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; 75001E701A06629A0098C5C4 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 75001E711A06629A0098C5C4 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 75001E751A06629A0098C5C4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 75001E761A06629A0098C5C4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 75001E781A06629A0098C5C4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VLDContextSheetExample/VLDContextSheetExample-Prefix.pch"; INFOPLIST_FILE = "VLDContextSheetExample/VLDContextSheetExample-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; 75001E791A06629A0098C5C4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VLDContextSheetExample/VLDContextSheetExample-Prefix.pch"; INFOPLIST_FILE = "VLDContextSheetExample/VLDContextSheetExample-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; 75001E7B1A06629A0098C5C4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/VLDContextSheetExample.app/VLDContextSheetExample"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VLDContextSheetExample/VLDContextSheetExample-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = "VLDContextSheetExampleTests/VLDContextSheetExampleTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 75001E7C1A06629A0098C5C4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/VLDContextSheetExample.app/VLDContextSheetExample"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VLDContextSheetExample/VLDContextSheetExample-Prefix.pch"; INFOPLIST_FILE = "VLDContextSheetExampleTests/VLDContextSheetExampleTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 75001E461A0662990098C5C4 /* Build configuration list for PBXProject "VLDContextSheetExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 75001E751A06629A0098C5C4 /* Debug */, 75001E761A06629A0098C5C4 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 75001E771A06629A0098C5C4 /* Build configuration list for PBXNativeTarget "VLDContextSheetExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 75001E781A06629A0098C5C4 /* Debug */, 75001E791A06629A0098C5C4 /* Release */, ); defaultConfigurationIsVisible = 0; }; 75001E7A1A06629A0098C5C4 /* Build configuration list for PBXNativeTarget "VLDContextSheetExampleTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 75001E7B1A06629A0098C5C4 /* Debug */, 75001E7C1A06629A0098C5C4 /* Release */, ); defaultConfigurationIsVisible = 0; }; /* End XCConfigurationList section */ }; rootObject = 75001E431A0662990098C5C4 /* Project object */; } ================================================ FILE: VLDContextSheetExample/VLDContextSheetExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: VLDContextSheetExample/VLDContextSheetExampleTests/VLDContextSheetExampleTests-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.example.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: VLDContextSheetExample/VLDContextSheetExampleTests/VLDContextSheetExampleTests.m ================================================ // // VLDContextSheetExampleTests.m // VLDContextSheetExampleTests // // Created by Vladimir Angelov on 11/2/14. // Copyright (c) 2014 Vladimir Angelov. All rights reserved. // #import @interface VLDContextSheetExampleTests : XCTestCase @end @implementation VLDContextSheetExampleTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end ================================================ FILE: VLDContextSheetExample/VLDContextSheetExampleTests/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */