Repository: cyndibaby905/TumblrMenu Branch: master Commit: d7dae4cf236f Files: 21 Total size: 62.7 KB Directory structure: gitextract_ejin080m/ ├── .gitignore ├── CHTumblrMenu.podspec ├── LICENSE ├── README.md ├── TumblrMenu/ │ ├── CHAppDelegate.h │ ├── CHAppDelegate.m │ ├── CHViewController.h │ ├── CHViewController.m │ ├── Images.xcassets/ │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage/ │ │ └── Contents.json │ ├── TumblrMenu/ │ │ ├── CHTumblrMenuView.h │ │ └── CHTumblrMenuView.m │ ├── TumblrMenu-Info.plist │ ├── TumblrMenu-Prefix.pch │ ├── en.lproj/ │ │ └── InfoPlist.strings │ └── main.m ├── TumblrMenu.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata └── TumblrMenuTests/ ├── TumblrMenuTests-Info.plist ├── TumblrMenuTests.m └── en.lproj/ └── InfoPlist.strings ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode .DS_Store */build/* *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata profile *.moved-aside DerivedData .idea/ *.hmap *.xccheckout #CocoaPods Pods ================================================ FILE: CHTumblrMenu.podspec ================================================ Pod::Spec.new do |s| s.name = "CHTumblrMenu" s.version = "0.1" s.summary = "CHTumblrMenu is a Tumblr iOS app like menu view completely created using core animation." s.screenshots = "https://raw.github.com/cyndibaby905/TumblrMenu/master/tumblrMenu.gif" s.homepage = "https://github.com/cyndibaby905/TumblrMenu" s.license = { :type => 'MIT License', :file => 'LICENSE' } s.author = { "cyndibaby905" => "hangisnice@gmail.com" } s.source = { :git => "https://github.com/cyndibaby905/TumblrMenu.git", :tag => "0.1" } s.platform = :ios, '5.0' s.source_files = 'TumblrMenu/TumblrMenu/CHTumblrMenuView.{h,m}' end ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2013 Hang Chen 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 ================================================ ## CHTumblrMenuView ## Tumblr iOS app like menu view. Completely created using core animation. Easy to drop into your project. You can add as many items as you want, the CHTumblrMenuView will layout them automatically. ## Requirements ## CHTumblrMenuView requires Xcode 5, targeting either iOS 5.0 and above, ARC-enabled. ## How to use ## Drag CHTumblrMenuView.h amd CHTumblrMenuView.m files to your project. No other frameworks required. #import "CHTumblrMenuView.h" CHTumblrMenuView *menuView = [[CHTumblrMenuView alloc] init]; [menuView addMenuItemWithTitle:@"Text" andIcon:[UIImage imageNamed:@"post_type_bubble_text.png"] andSelectedBlock:^{ NSLog(@"Text selected"); }]; [menuView addMenuItemWithTitle:@"Photo" andIcon:[UIImage imageNamed:@"post_type_bubble_photo.png"] andSelectedBlock:^{ NSLog(@"Photo selected"); }]; [menuView addMenuItemWithTitle:@"Quote" andIcon:[UIImage imageNamed:@"post_type_bubble_quote.png"] andSelectedBlock:^{ NSLog(@"Quote selected"); }]; [menuView addMenuItemWithTitle:@"Link" andIcon:[UIImage imageNamed:@"post_type_bubble_link.png"] andSelectedBlock:^{ NSLog(@"Link selected"); }]; [menuView addMenuItemWithTitle:@"Chat" andIcon:[UIImage imageNamed:@"post_type_bubble_chat.png"] andSelectedBlock:^{ NSLog(@"Chat selected"); }]; [menuView addMenuItemWithTitle:@"Video" andIcon:[UIImage imageNamed:@"post_type_bubble_video.png"] andSelectedBlock:^{ NSLog(@"Video selected"); }]; [menuView show]; ## How it looks ## ![CHTumblrMenuView] (https://raw.github.com/cyndibaby905/TumblrMenu/master/tumblrMenu.gif) ## Lincense ## CHTumblrMenuView is available under the MIT license. See the LICENSE file for more info. ================================================ FILE: TumblrMenu/CHAppDelegate.h ================================================ // // CHAppDelegate.h // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import @interface CHAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: TumblrMenu/CHAppDelegate.m ================================================ // // CHAppDelegate.m // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import "CHAppDelegate.h" #import "CHViewController.h" @implementation CHAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = [[CHViewController alloc] init]; self.window.backgroundColor = [UIColor whiteColor]; //self.window.rootViewController = navController; [self.window makeKeyAndVisible]; 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: TumblrMenu/CHViewController.h ================================================ // // CHViewController.h // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import @interface CHViewController : UIViewController @end ================================================ FILE: TumblrMenu/CHViewController.m ================================================ // // CHViewController.m // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import "CHViewController.h" #import "CHTumblrMenuView.h" @interface CHViewController () @end @implementation CHViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:[UIImage imageNamed:@"tab_bar_button_compose_selected.png"] forState:UIControlStateHighlighted]; [button setImage:[UIImage imageNamed:@"tab_bar_button_compose_selected.png"] forState:UIControlStateNormal]; button.frame = CGRectMake((self.view.bounds.size.width - 59)/2.0, (self.view.bounds.size.height - 48)/2.0, 59, 48); [button addTarget:self action:@selector(showMenu) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; } - (void)showMenu { CHTumblrMenuView *menuView = [[CHTumblrMenuView alloc] init]; [menuView addMenuItemWithTitle:@"Text" andIcon:[UIImage imageNamed:@"post_type_bubble_text.png"] andSelectedBlock:^{ NSLog(@"Text selected"); }]; [menuView addMenuItemWithTitle:@"Photo" andIcon:[UIImage imageNamed:@"post_type_bubble_photo.png"] andSelectedBlock:^{ NSLog(@"Photo selected"); }]; [menuView addMenuItemWithTitle:@"Quote" andIcon:[UIImage imageNamed:@"post_type_bubble_quote.png"] andSelectedBlock:^{ NSLog(@"Quote selected"); }]; [menuView addMenuItemWithTitle:@"Link" andIcon:[UIImage imageNamed:@"post_type_bubble_link.png"] andSelectedBlock:^{ NSLog(@"Link selected"); }]; [menuView addMenuItemWithTitle:@"Chat" andIcon:[UIImage imageNamed:@"post_type_bubble_chat.png"] andSelectedBlock:^{ NSLog(@"Chat selected"); }]; [menuView addMenuItemWithTitle:@"Video" andIcon:[UIImage imageNamed:@"post_type_bubble_video.png"] andSelectedBlock:^{ NSLog(@"Video selected"); }]; [menuView show]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end ================================================ FILE: TumblrMenu/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: TumblrMenu/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: TumblrMenu/TumblrMenu/CHTumblrMenuView.h ================================================ // // CHTumblrMenuView.h // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import typedef void (^CHTumblrMenuViewSelectedBlock)(void); @interface CHTumblrMenuView : UIView @property (nonatomic, readonly)UIImageView *backgroundImgView; - (void)addMenuItemWithTitle:(NSString*)title andIcon:(UIImage*)icon andSelectedBlock:(CHTumblrMenuViewSelectedBlock)block; - (void)show; @end ================================================ FILE: TumblrMenu/TumblrMenu/CHTumblrMenuView.m ================================================ // // CHTumblrMenuView.m // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import "CHTumblrMenuView.h" #define CHTumblrMenuViewTag 1999 #define CHTumblrMenuViewImageHeight 90 #define CHTumblrMenuViewTitleHeight 20 #define CHTumblrMenuViewVerticalPadding 10 #define CHTumblrMenuViewHorizontalMargin 10 #define CHTumblrMenuViewRriseAnimationID @"CHTumblrMenuViewRriseAnimationID" #define CHTumblrMenuViewDismissAnimationID @"CHTumblrMenuViewDismissAnimationID" #define CHTumblrMenuViewAnimationTime 0.36 #define CHTumblrMenuViewAnimationInterval (CHTumblrMenuViewAnimationTime / 5) #define TumblrBlue [UIColor colorWithRed:45/255.0f green:68/255.0f blue:94/255.0f alpha:1.0] @interface CHTumblrMenuItemButton : UIButton + (id)TumblrMenuItemButtonWithTitle:(NSString*)title andIcon:(UIImage*)icon andSelectedBlock:(CHTumblrMenuViewSelectedBlock)block; @property(nonatomic,copy)CHTumblrMenuViewSelectedBlock selectedBlock; @end @implementation CHTumblrMenuItemButton + (id)TumblrMenuItemButtonWithTitle:(NSString*)title andIcon:(UIImage*)icon andSelectedBlock:(CHTumblrMenuViewSelectedBlock)block { CHTumblrMenuItemButton *button = [CHTumblrMenuItemButton buttonWithType:UIButtonTypeCustom]; [button setImage:icon forState:UIControlStateNormal]; [button setTitle:title forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; button.titleLabel.textAlignment = NSTextAlignmentCenter; button.selectedBlock = block; return button; } - (void)layoutSubviews { [super layoutSubviews]; self.imageView.frame = CGRectMake(0, 0, CHTumblrMenuViewImageHeight, CHTumblrMenuViewImageHeight); self.titleLabel.frame = CGRectMake(0, CHTumblrMenuViewImageHeight, CHTumblrMenuViewImageHeight, CHTumblrMenuViewTitleHeight); } @end @implementation CHTumblrMenuView { UIImageView *backgroundView_; NSMutableArray *buttons_; } @synthesize backgroundImgView = backgroundView_; - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code UITapGestureRecognizer *ges = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss:)]; ges.delegate = self; [self addGestureRecognizer:ges]; self.backgroundColor = [UIColor clearColor]; backgroundView_ = [[UIImageView alloc] initWithFrame:self.bounds]; backgroundView_.backgroundColor = TumblrBlue; backgroundView_.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; [self addSubview:backgroundView_]; buttons_ = [[NSMutableArray alloc] initWithCapacity:6]; } return self; } - (void)addMenuItemWithTitle:(NSString*)title andIcon:(UIImage*)icon andSelectedBlock:(CHTumblrMenuViewSelectedBlock)block { CHTumblrMenuItemButton *button = [CHTumblrMenuItemButton TumblrMenuItemButtonWithTitle:title andIcon:icon andSelectedBlock:block]; [button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:button]; [buttons_ addObject:button]; } - (CGRect)frameForButtonAtIndex:(NSUInteger)index { NSUInteger columnCount = 3; NSUInteger columnIndex = index % columnCount; NSUInteger rowCount = buttons_.count / columnCount + (buttons_.count%columnCount>0?1:0); NSUInteger rowIndex = index / columnCount; CGFloat itemHeight = (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) * rowCount + (rowCount > 1?(rowCount - 1) * CHTumblrMenuViewHorizontalMargin:0); CGFloat offsetY = (self.bounds.size.height - itemHeight) / 2.0; CGFloat verticalPadding = (self.bounds.size.width - CHTumblrMenuViewHorizontalMargin * 2 - CHTumblrMenuViewImageHeight * 3) / 2.0; CGFloat offsetX = CHTumblrMenuViewHorizontalMargin; offsetX += (CHTumblrMenuViewImageHeight+ verticalPadding) * columnIndex; offsetY += (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight + CHTumblrMenuViewVerticalPadding) * rowIndex; return CGRectMake(offsetX, offsetY, CHTumblrMenuViewImageHeight, (CHTumblrMenuViewImageHeight+CHTumblrMenuViewTitleHeight)); } - (void)layoutSubviews { [super layoutSubviews]; for (NSUInteger i = 0; i < buttons_.count; i++) { CHTumblrMenuItemButton *button = buttons_[i]; button.frame = [self frameForButtonAtIndex:i]; } } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if ([gestureRecognizer.view isKindOfClass:[CHTumblrMenuItemButton class]]) { return NO; } CGPoint location = [gestureRecognizer locationInView:self]; for (UIView* subview in buttons_) { if (CGRectContainsPoint(subview.frame, location)) { return NO; } } return YES; } - (void)dismiss:(id)sender { [self dropAnimation]; double delayInSeconds = CHTumblrMenuViewAnimationTime + CHTumblrMenuViewAnimationInterval * (buttons_.count + 1); dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [self removeFromSuperview]; }); } - (void)buttonTapped:(CHTumblrMenuItemButton*)btn { [self dismiss:nil]; double delayInSeconds = CHTumblrMenuViewAnimationTime + CHTumblrMenuViewAnimationInterval * (buttons_.count + 1); dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ btn.selectedBlock(); }); } - (void)riseAnimation { NSUInteger columnCount = 3; NSUInteger rowCount = buttons_.count / columnCount + (buttons_.count%columnCount>0?1:0); for (NSUInteger index = 0; index < buttons_.count; index++) { CHTumblrMenuItemButton *button = buttons_[index]; button.layer.opacity = 0; CGRect frame = [self frameForButtonAtIndex:index]; NSUInteger rowIndex = index / columnCount; NSUInteger columnIndex = index % columnCount; CGPoint fromPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y + (rowCount - rowIndex + 2)*200 + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); CGPoint toPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); double delayInSeconds = rowIndex * columnCount * CHTumblrMenuViewAnimationInterval; if (!columnIndex) { delayInSeconds += CHTumblrMenuViewAnimationInterval; } else if(columnIndex == 2) { delayInSeconds += CHTumblrMenuViewAnimationInterval * 2; } CABasicAnimation *positionAnimation; positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; positionAnimation.fromValue = [NSValue valueWithCGPoint:fromPosition]; positionAnimation.toValue = [NSValue valueWithCGPoint:toPosition]; positionAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.45f :1.2f :0.75f :1.0f]; positionAnimation.duration = CHTumblrMenuViewAnimationTime; positionAnimation.beginTime = [button.layer convertTime:CACurrentMediaTime() fromLayer:nil] + delayInSeconds; [positionAnimation setValue:[NSNumber numberWithUnsignedInteger:index] forKey:CHTumblrMenuViewRriseAnimationID]; positionAnimation.delegate = self; [button.layer addAnimation:positionAnimation forKey:@"riseAnimation"]; } } - (void)dropAnimation { NSUInteger columnCount = 3; for (NSUInteger index = 0; index < buttons_.count; index++) { CHTumblrMenuItemButton *button = buttons_[index]; CGRect frame = [self frameForButtonAtIndex:index]; NSUInteger rowIndex = index / columnCount; NSUInteger columnIndex = index % columnCount; CGPoint toPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y - (rowIndex + 2)*200 + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); CGPoint fromPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); double delayInSeconds = rowIndex * columnCount * CHTumblrMenuViewAnimationInterval; if (!columnIndex) { delayInSeconds += CHTumblrMenuViewAnimationInterval; } else if(columnIndex == 2) { delayInSeconds += CHTumblrMenuViewAnimationInterval * 2; } CABasicAnimation *positionAnimation; positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; positionAnimation.fromValue = [NSValue valueWithCGPoint:fromPosition]; positionAnimation.toValue = [NSValue valueWithCGPoint:toPosition]; positionAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.3 :0.5f :1.0f :1.0f]; positionAnimation.duration = CHTumblrMenuViewAnimationTime; positionAnimation.beginTime = [button.layer convertTime:CACurrentMediaTime() fromLayer:nil] + delayInSeconds; [positionAnimation setValue:[NSNumber numberWithUnsignedInteger:index] forKey:CHTumblrMenuViewDismissAnimationID]; positionAnimation.delegate = self; [button.layer addAnimation:positionAnimation forKey:@"riseAnimation"]; } } - (void)animationDidStart:(CAAnimation *)anim { NSUInteger columnCount = 3; if([anim valueForKey:CHTumblrMenuViewRriseAnimationID]) { NSUInteger index = [[anim valueForKey:CHTumblrMenuViewRriseAnimationID] unsignedIntegerValue]; UIView *view = buttons_[index]; CGRect frame = [self frameForButtonAtIndex:index]; CGPoint toPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); CGFloat toAlpha = 1.0; view.layer.position = toPosition; view.layer.opacity = toAlpha; } else if([anim valueForKey:CHTumblrMenuViewDismissAnimationID]) { NSUInteger index = [[anim valueForKey:CHTumblrMenuViewDismissAnimationID] unsignedIntegerValue]; NSUInteger rowIndex = index / columnCount; UIView *view = buttons_[index]; CGRect frame = [self frameForButtonAtIndex:index]; CGPoint toPosition = CGPointMake(frame.origin.x + CHTumblrMenuViewImageHeight / 2.0,frame.origin.y - (rowIndex + 2)*200 + (CHTumblrMenuViewImageHeight + CHTumblrMenuViewTitleHeight) / 2.0); view.layer.position = toPosition; } } - (void)show { UIViewController *appRootViewController; UIWindow *window; window = [UIApplication sharedApplication].keyWindow; appRootViewController = window.rootViewController; UIViewController *topViewController = appRootViewController; while (topViewController.presentedViewController != nil) { topViewController = topViewController.presentedViewController; } if ([topViewController.view viewWithTag:CHTumblrMenuViewTag]) { [[topViewController.view viewWithTag:CHTumblrMenuViewTag] removeFromSuperview]; } self.frame = topViewController.view.bounds; [topViewController.view addSubview:self]; [self riseAnimation]; } @end ================================================ FILE: TumblrMenu/TumblrMenu-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier HangChen.${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: TumblrMenu/TumblrMenu-Prefix.pch ================================================ // // Prefix header // // The contents of this file are implicitly included at the beginning of every source file. // #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: TumblrMenu/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: TumblrMenu/main.m ================================================ // // main.m // TumblrMenu // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import #import "CHAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([CHAppDelegate class])); } } ================================================ FILE: TumblrMenu.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 7760606E1855F40B005424C0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7760606D1855F40B005424C0 /* Foundation.framework */; }; 776060701855F40B005424C0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7760606F1855F40B005424C0 /* CoreGraphics.framework */; }; 776060721855F40B005424C0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 776060711855F40B005424C0 /* UIKit.framework */; }; 776060781855F40B005424C0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 776060761855F40B005424C0 /* InfoPlist.strings */; }; 7760607A1855F40B005424C0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 776060791855F40B005424C0 /* main.m */; }; 7760607E1855F40B005424C0 /* CHAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7760607D1855F40B005424C0 /* CHAppDelegate.m */; }; 776060871855F40B005424C0 /* CHViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 776060861855F40B005424C0 /* CHViewController.m */; }; 776060891855F40B005424C0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 776060881855F40B005424C0 /* Images.xcassets */; }; 776060901855F40B005424C0 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7760608F1855F40B005424C0 /* XCTest.framework */; }; 776060911855F40B005424C0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7760606D1855F40B005424C0 /* Foundation.framework */; }; 776060921855F40B005424C0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 776060711855F40B005424C0 /* UIKit.framework */; }; 7760609A1855F40B005424C0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 776060981855F40B005424C0 /* InfoPlist.strings */; }; 7760609C1855F40B005424C0 /* TumblrMenuTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7760609B1855F40B005424C0 /* TumblrMenuTests.m */; }; 776060B41855F43F005424C0 /* post_type_bubble_chat.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060A61855F43F005424C0 /* post_type_bubble_chat.png */; }; 776060B51855F43F005424C0 /* post_type_bubble_chat@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060A71855F43F005424C0 /* post_type_bubble_chat@2x.png */; }; 776060B61855F43F005424C0 /* post_type_bubble_link.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060A81855F43F005424C0 /* post_type_bubble_link.png */; }; 776060B71855F43F005424C0 /* post_type_bubble_link@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060A91855F43F005424C0 /* post_type_bubble_link@2x.png */; }; 776060B81855F43F005424C0 /* post_type_bubble_photo.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AA1855F43F005424C0 /* post_type_bubble_photo.png */; }; 776060B91855F43F005424C0 /* post_type_bubble_photo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AB1855F43F005424C0 /* post_type_bubble_photo@2x.png */; }; 776060BA1855F43F005424C0 /* post_type_bubble_quote.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AC1855F43F005424C0 /* post_type_bubble_quote.png */; }; 776060BB1855F43F005424C0 /* post_type_bubble_quote@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AD1855F43F005424C0 /* post_type_bubble_quote@2x.png */; }; 776060BC1855F43F005424C0 /* post_type_bubble_text.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AE1855F43F005424C0 /* post_type_bubble_text.png */; }; 776060BD1855F43F005424C0 /* post_type_bubble_text@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060AF1855F43F005424C0 /* post_type_bubble_text@2x.png */; }; 776060BE1855F43F005424C0 /* post_type_bubble_video.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060B01855F43F005424C0 /* post_type_bubble_video.png */; }; 776060BF1855F43F005424C0 /* post_type_bubble_video@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060B11855F43F005424C0 /* post_type_bubble_video@2x.png */; }; 776060D718573F01005424C0 /* tab_bar_button_compose_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060D518573F01005424C0 /* tab_bar_button_compose_selected.png */; }; 776060D818573F01005424C0 /* tab_bar_button_compose_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060D618573F01005424C0 /* tab_bar_button_compose_unselected.png */; }; 776060DB18573F4F005424C0 /* tab_bar_button_compose_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060D918573F4F005424C0 /* tab_bar_button_compose_selected@2x.png */; }; 776060DC18573F4F005424C0 /* tab_bar_button_compose_unselected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 776060DA18573F4F005424C0 /* tab_bar_button_compose_unselected@2x.png */; }; 776060E018574380005424C0 /* CHTumblrMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 776060DF18574380005424C0 /* CHTumblrMenuView.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 776060931855F40B005424C0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 776060621855F40B005424C0 /* Project object */; proxyType = 1; remoteGlobalIDString = 776060691855F40B005424C0; remoteInfo = TumblrMenu; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 7760606A1855F40B005424C0 /* TumblrMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TumblrMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7760606D1855F40B005424C0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 7760606F1855F40B005424C0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 776060711855F40B005424C0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 776060751855F40B005424C0 /* TumblrMenu-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TumblrMenu-Info.plist"; sourceTree = ""; }; 776060771855F40B005424C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 776060791855F40B005424C0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 7760607B1855F40B005424C0 /* TumblrMenu-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TumblrMenu-Prefix.pch"; sourceTree = ""; }; 7760607C1855F40B005424C0 /* CHAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHAppDelegate.h; sourceTree = ""; }; 7760607D1855F40B005424C0 /* CHAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHAppDelegate.m; sourceTree = ""; }; 776060851855F40B005424C0 /* CHViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHViewController.h; sourceTree = ""; }; 776060861855F40B005424C0 /* CHViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHViewController.m; sourceTree = ""; }; 776060881855F40B005424C0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 7760608E1855F40B005424C0 /* TumblrMenuTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TumblrMenuTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 7760608F1855F40B005424C0 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 776060971855F40B005424C0 /* TumblrMenuTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TumblrMenuTests-Info.plist"; sourceTree = ""; }; 776060991855F40B005424C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 7760609B1855F40B005424C0 /* TumblrMenuTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TumblrMenuTests.m; sourceTree = ""; }; 776060A61855F43F005424C0 /* post_type_bubble_chat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_chat.png; sourceTree = ""; }; 776060A71855F43F005424C0 /* post_type_bubble_chat@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_chat@2x.png"; sourceTree = ""; }; 776060A81855F43F005424C0 /* post_type_bubble_link.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_link.png; sourceTree = ""; }; 776060A91855F43F005424C0 /* post_type_bubble_link@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_link@2x.png"; sourceTree = ""; }; 776060AA1855F43F005424C0 /* post_type_bubble_photo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_photo.png; sourceTree = ""; }; 776060AB1855F43F005424C0 /* post_type_bubble_photo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_photo@2x.png"; sourceTree = ""; }; 776060AC1855F43F005424C0 /* post_type_bubble_quote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_quote.png; sourceTree = ""; }; 776060AD1855F43F005424C0 /* post_type_bubble_quote@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_quote@2x.png"; sourceTree = ""; }; 776060AE1855F43F005424C0 /* post_type_bubble_text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_text.png; sourceTree = ""; }; 776060AF1855F43F005424C0 /* post_type_bubble_text@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_text@2x.png"; sourceTree = ""; }; 776060B01855F43F005424C0 /* post_type_bubble_video.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = post_type_bubble_video.png; sourceTree = ""; }; 776060B11855F43F005424C0 /* post_type_bubble_video@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "post_type_bubble_video@2x.png"; sourceTree = ""; }; 776060D518573F01005424C0 /* tab_bar_button_compose_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_bar_button_compose_selected.png; sourceTree = ""; }; 776060D618573F01005424C0 /* tab_bar_button_compose_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_bar_button_compose_unselected.png; sourceTree = ""; }; 776060D918573F4F005424C0 /* tab_bar_button_compose_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_bar_button_compose_selected@2x.png"; sourceTree = ""; }; 776060DA18573F4F005424C0 /* tab_bar_button_compose_unselected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_bar_button_compose_unselected@2x.png"; sourceTree = ""; }; 776060DE18574380005424C0 /* CHTumblrMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHTumblrMenuView.h; sourceTree = ""; }; 776060DF18574380005424C0 /* CHTumblrMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CHTumblrMenuView.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 776060671855F40B005424C0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 776060701855F40B005424C0 /* CoreGraphics.framework in Frameworks */, 776060721855F40B005424C0 /* UIKit.framework in Frameworks */, 7760606E1855F40B005424C0 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 7760608B1855F40B005424C0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 776060901855F40B005424C0 /* XCTest.framework in Frameworks */, 776060921855F40B005424C0 /* UIKit.framework in Frameworks */, 776060911855F40B005424C0 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 776060611855F40B005424C0 = { isa = PBXGroup; children = ( 776060731855F40B005424C0 /* TumblrMenu */, 776060951855F40B005424C0 /* TumblrMenuTests */, 7760606C1855F40B005424C0 /* Frameworks */, 7760606B1855F40B005424C0 /* Products */, ); sourceTree = ""; }; 7760606B1855F40B005424C0 /* Products */ = { isa = PBXGroup; children = ( 7760606A1855F40B005424C0 /* TumblrMenu.app */, 7760608E1855F40B005424C0 /* TumblrMenuTests.xctest */, ); name = Products; sourceTree = ""; }; 7760606C1855F40B005424C0 /* Frameworks */ = { isa = PBXGroup; children = ( 7760606D1855F40B005424C0 /* Foundation.framework */, 7760606F1855F40B005424C0 /* CoreGraphics.framework */, 776060711855F40B005424C0 /* UIKit.framework */, 7760608F1855F40B005424C0 /* XCTest.framework */, ); name = Frameworks; sourceTree = ""; }; 776060731855F40B005424C0 /* TumblrMenu */ = { isa = PBXGroup; children = ( 776060DD18574380005424C0 /* TumblrMenu */, 776060A51855F43F005424C0 /* Resources */, 7760607C1855F40B005424C0 /* CHAppDelegate.h */, 7760607D1855F40B005424C0 /* CHAppDelegate.m */, 776060851855F40B005424C0 /* CHViewController.h */, 776060861855F40B005424C0 /* CHViewController.m */, 776060881855F40B005424C0 /* Images.xcassets */, 776060741855F40B005424C0 /* Supporting Files */, ); path = TumblrMenu; sourceTree = ""; }; 776060741855F40B005424C0 /* Supporting Files */ = { isa = PBXGroup; children = ( 776060751855F40B005424C0 /* TumblrMenu-Info.plist */, 776060761855F40B005424C0 /* InfoPlist.strings */, 776060791855F40B005424C0 /* main.m */, 7760607B1855F40B005424C0 /* TumblrMenu-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 776060951855F40B005424C0 /* TumblrMenuTests */ = { isa = PBXGroup; children = ( 7760609B1855F40B005424C0 /* TumblrMenuTests.m */, 776060961855F40B005424C0 /* Supporting Files */, ); path = TumblrMenuTests; sourceTree = ""; }; 776060961855F40B005424C0 /* Supporting Files */ = { isa = PBXGroup; children = ( 776060971855F40B005424C0 /* TumblrMenuTests-Info.plist */, 776060981855F40B005424C0 /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; 776060A51855F43F005424C0 /* Resources */ = { isa = PBXGroup; children = ( 776060D918573F4F005424C0 /* tab_bar_button_compose_selected@2x.png */, 776060DA18573F4F005424C0 /* tab_bar_button_compose_unselected@2x.png */, 776060D518573F01005424C0 /* tab_bar_button_compose_selected.png */, 776060D618573F01005424C0 /* tab_bar_button_compose_unselected.png */, 776060A61855F43F005424C0 /* post_type_bubble_chat.png */, 776060A71855F43F005424C0 /* post_type_bubble_chat@2x.png */, 776060A81855F43F005424C0 /* post_type_bubble_link.png */, 776060A91855F43F005424C0 /* post_type_bubble_link@2x.png */, 776060AA1855F43F005424C0 /* post_type_bubble_photo.png */, 776060AB1855F43F005424C0 /* post_type_bubble_photo@2x.png */, 776060AC1855F43F005424C0 /* post_type_bubble_quote.png */, 776060AD1855F43F005424C0 /* post_type_bubble_quote@2x.png */, 776060AE1855F43F005424C0 /* post_type_bubble_text.png */, 776060AF1855F43F005424C0 /* post_type_bubble_text@2x.png */, 776060B01855F43F005424C0 /* post_type_bubble_video.png */, 776060B11855F43F005424C0 /* post_type_bubble_video@2x.png */, ); path = Resources; sourceTree = ""; }; 776060DD18574380005424C0 /* TumblrMenu */ = { isa = PBXGroup; children = ( 776060DE18574380005424C0 /* CHTumblrMenuView.h */, 776060DF18574380005424C0 /* CHTumblrMenuView.m */, ); path = TumblrMenu; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 776060691855F40B005424C0 /* TumblrMenu */ = { isa = PBXNativeTarget; buildConfigurationList = 7760609F1855F40B005424C0 /* Build configuration list for PBXNativeTarget "TumblrMenu" */; buildPhases = ( 776060661855F40B005424C0 /* Sources */, 776060671855F40B005424C0 /* Frameworks */, 776060681855F40B005424C0 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = TumblrMenu; productName = TumblrMenu; productReference = 7760606A1855F40B005424C0 /* TumblrMenu.app */; productType = "com.apple.product-type.application"; }; 7760608D1855F40B005424C0 /* TumblrMenuTests */ = { isa = PBXNativeTarget; buildConfigurationList = 776060A21855F40B005424C0 /* Build configuration list for PBXNativeTarget "TumblrMenuTests" */; buildPhases = ( 7760608A1855F40B005424C0 /* Sources */, 7760608B1855F40B005424C0 /* Frameworks */, 7760608C1855F40B005424C0 /* Resources */, ); buildRules = ( ); dependencies = ( 776060941855F40B005424C0 /* PBXTargetDependency */, ); name = TumblrMenuTests; productName = TumblrMenuTests; productReference = 7760608E1855F40B005424C0 /* TumblrMenuTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 776060621855F40B005424C0 /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = CH; LastUpgradeCheck = 0500; ORGANIZATIONNAME = HangChen; TargetAttributes = { 7760608D1855F40B005424C0 = { TestTargetID = 776060691855F40B005424C0; }; }; }; buildConfigurationList = 776060651855F40B005424C0 /* Build configuration list for PBXProject "TumblrMenu" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 776060611855F40B005424C0; productRefGroup = 7760606B1855F40B005424C0 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 776060691855F40B005424C0 /* TumblrMenu */, 7760608D1855F40B005424C0 /* TumblrMenuTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 776060681855F40B005424C0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 776060B51855F43F005424C0 /* post_type_bubble_chat@2x.png in Resources */, 776060B81855F43F005424C0 /* post_type_bubble_photo.png in Resources */, 776060B91855F43F005424C0 /* post_type_bubble_photo@2x.png in Resources */, 776060BF1855F43F005424C0 /* post_type_bubble_video@2x.png in Resources */, 776060BA1855F43F005424C0 /* post_type_bubble_quote.png in Resources */, 776060BD1855F43F005424C0 /* post_type_bubble_text@2x.png in Resources */, 776060B41855F43F005424C0 /* post_type_bubble_chat.png in Resources */, 776060D818573F01005424C0 /* tab_bar_button_compose_unselected.png in Resources */, 776060BC1855F43F005424C0 /* post_type_bubble_text.png in Resources */, 776060891855F40B005424C0 /* Images.xcassets in Resources */, 776060DB18573F4F005424C0 /* tab_bar_button_compose_selected@2x.png in Resources */, 776060B61855F43F005424C0 /* post_type_bubble_link.png in Resources */, 776060B71855F43F005424C0 /* post_type_bubble_link@2x.png in Resources */, 776060D718573F01005424C0 /* tab_bar_button_compose_selected.png in Resources */, 776060781855F40B005424C0 /* InfoPlist.strings in Resources */, 776060DC18573F4F005424C0 /* tab_bar_button_compose_unselected@2x.png in Resources */, 776060BB1855F43F005424C0 /* post_type_bubble_quote@2x.png in Resources */, 776060BE1855F43F005424C0 /* post_type_bubble_video.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 7760608C1855F40B005424C0 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 7760609A1855F40B005424C0 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 776060661855F40B005424C0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 7760607A1855F40B005424C0 /* main.m in Sources */, 7760607E1855F40B005424C0 /* CHAppDelegate.m in Sources */, 776060E018574380005424C0 /* CHTumblrMenuView.m in Sources */, 776060871855F40B005424C0 /* CHViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 7760608A1855F40B005424C0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 7760609C1855F40B005424C0 /* TumblrMenuTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 776060941855F40B005424C0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 776060691855F40B005424C0 /* TumblrMenu */; targetProxy = 776060931855F40B005424C0 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 776060761855F40B005424C0 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 776060771855F40B005424C0 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; 776060981855F40B005424C0 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 776060991855F40B005424C0 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 7760609D1855F40B005424C0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; 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; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 7760609E1855F40B005424C0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD)"; 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; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 776060A01855F40B005424C0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TumblrMenu/TumblrMenu-Prefix.pch"; INFOPLIST_FILE = "TumblrMenu/TumblrMenu-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; 776060A11855F40B005424C0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TumblrMenu/TumblrMenu-Prefix.pch"; INFOPLIST_FILE = "TumblrMenu/TumblrMenu-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; 776060A31855F40B005424C0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TumblrMenu.app/TumblrMenu"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TumblrMenu/TumblrMenu-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = "TumblrMenuTests/TumblrMenuTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 776060A41855F40B005424C0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TumblrMenu.app/TumblrMenu"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "TumblrMenu/TumblrMenu-Prefix.pch"; INFOPLIST_FILE = "TumblrMenuTests/TumblrMenuTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 776060651855F40B005424C0 /* Build configuration list for PBXProject "TumblrMenu" */ = { isa = XCConfigurationList; buildConfigurations = ( 7760609D1855F40B005424C0 /* Debug */, 7760609E1855F40B005424C0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 7760609F1855F40B005424C0 /* Build configuration list for PBXNativeTarget "TumblrMenu" */ = { isa = XCConfigurationList; buildConfigurations = ( 776060A01855F40B005424C0 /* Debug */, 776060A11855F40B005424C0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 776060A21855F40B005424C0 /* Build configuration list for PBXNativeTarget "TumblrMenuTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 776060A31855F40B005424C0 /* Debug */, 776060A41855F40B005424C0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 776060621855F40B005424C0 /* Project object */; } ================================================ FILE: TumblrMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: TumblrMenuTests/TumblrMenuTests-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier HangChen.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: TumblrMenuTests/TumblrMenuTests.m ================================================ // // TumblrMenuTests.m // TumblrMenuTests // // Created by HangChen on 12/9/13. // Copyright (c) 2013 Hang Chen (https://github.com/cyndibaby905) // // 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. #import @interface TumblrMenuTests : XCTestCase @end @implementation TumblrMenuTests - (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: TumblrMenuTests/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */