├── .gitignore ├── FacebookMenuButton ├── FacebookMenuButton.h └── FacebookMenuButton.m ├── FacebookMenuButtonExample ├── FacebookMenuButtonExample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── FacebookMenuButtonExample │ ├── Base.lproj │ │ └── Main.storyboard │ ├── CCAppDelegate.h │ ├── CCAppDelegate.m │ ├── CCViewController.h │ ├── CCViewController.m │ ├── FacebookMenuButtonExample-Info.plist │ ├── FacebookMenuButtonExample-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── FacebookMenuButtonExampleTests │ ├── FacebookMenuButtonExampleTests-Info.plist │ ├── FacebookMenuButtonExampleTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | 23 | # Vim 24 | *.swp 25 | 26 | -------------------------------------------------------------------------------- /FacebookMenuButton/FacebookMenuButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FacebookMenuButton.h 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FacebookMenuButton : UIButton 12 | 13 | /** Color for the menu bars, will be slightly transparent when unpressed */ 14 | @property (nonatomic, strong) UIColor *barTint; 15 | 16 | /* Width of the menu bars */ 17 | @property (nonatomic, assign) NSInteger barWidth; 18 | 19 | /* Height or thickness of the menu bars */ 20 | @property (nonatomic, assign) NSInteger barHeight; 21 | 22 | /* Space between the menu bars */ 23 | @property (nonatomic, assign) NSInteger barSpacing; 24 | 25 | /* Duration of the animation when selected */ 26 | @property (nonatomic, assign) NSTimeInterval animationDuration; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FacebookMenuButton/FacebookMenuButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // FacebookMenuButton.m 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import "FacebookMenuButton.h" 10 | 11 | #import 12 | 13 | #define SIZE_DEFAULT_BAR_HEIGHT 2 14 | #define SIZE_DEFAULT_BAR_SPACING 5 15 | #define SIZE_DEFAULT_BAR_WIDTH 26 16 | 17 | #define TIME_ANIMATION_DURATION .5 18 | 19 | #define ALPHA_UNPRESSED_TINT 0.6 20 | #define ALPHA_PRESSED_TINT 1.0 21 | 22 | #define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI) 23 | 24 | 25 | @interface FacebookMenuButton () 26 | 27 | /** Bar elements */ 28 | @property (nonatomic, strong) UIView *bar1; 29 | @property (nonatomic, strong) UIView *bar2; 30 | @property (nonatomic, strong) UIView *bar3; 31 | 32 | /** Array to hold bars for quick access */ 33 | @property (nonatomic, strong) NSArray *bars; 34 | 35 | /** Timing function for cubic bezier animation */ 36 | @property (nonatomic, strong) CAMediaTimingFunction *timingFunction; 37 | 38 | /** Convenience storage of keyframe times */ 39 | @property (nonatomic, strong) NSArray *keyframeTimes; 40 | 41 | /** Flag to check if first time initializing */ 42 | @property (nonatomic, assign) BOOL initialized; 43 | 44 | @end 45 | 46 | @implementation FacebookMenuButton 47 | 48 | - (void)awakeFromNib 49 | { 50 | [self createBars]; 51 | } 52 | 53 | - (id)initWithFrame:(CGRect)frame 54 | { 55 | self = [super initWithFrame:frame]; 56 | if (self) { 57 | [self createBars]; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)setFrame:(CGRect)frame 63 | { 64 | [super setFrame:frame]; 65 | 66 | [self updateBarFrame]; 67 | } 68 | 69 | - (void)setBarTint:(UIColor *)barTint 70 | { 71 | _barTint = barTint; 72 | 73 | [self updateBarTint:self.highlighted]; 74 | } 75 | 76 | - (void)setHighlighted:(BOOL)highlighted 77 | { 78 | [super setHighlighted:highlighted]; 79 | 80 | [self updateBarTint:highlighted]; 81 | } 82 | 83 | - (void)setSelected:(BOOL)selected 84 | { 85 | [super setSelected:selected]; 86 | 87 | [self animateBars:selected]; 88 | } 89 | 90 | /** @brief Create bars if they don't exist yet */ 91 | - (void)createBars 92 | { 93 | // Some initial settings 94 | if (!self.initialized) 95 | { 96 | // Defaults for menu bars 97 | self.barWidth = SIZE_DEFAULT_BAR_WIDTH; 98 | self.barHeight = SIZE_DEFAULT_BAR_HEIGHT; 99 | self.barSpacing = SIZE_DEFAULT_BAR_SPACING; 100 | self.barTint = [UIColor whiteColor]; 101 | 102 | // Animation settings 103 | self.animationDuration = TIME_ANIMATION_DURATION; 104 | 105 | self.initialized = true; // Only allow once 106 | } 107 | if (!self.bar1) { 108 | self.bar1 = [UIView new]; 109 | } 110 | if (!self.bar2) { 111 | self.bar2 = [UIView new]; 112 | } 113 | if (!self.bar3) { 114 | self.bar3 = [UIView new]; 115 | } 116 | if (!self.bars) { 117 | NSMutableArray *bars = [NSMutableArray new]; 118 | [bars addObject:self.bar1]; 119 | [bars addObject:self.bar2]; 120 | [bars addObject:self.bar3]; 121 | for (UIView *bar in bars) { 122 | bar.userInteractionEnabled = false; 123 | [self addSubview:bar]; 124 | } 125 | self.bars = bars; 126 | [self updateBarTint:false]; 127 | } 128 | } 129 | 130 | /** @brief Update frames / positions of menu bars */ 131 | - (void)updateBarFrame 132 | { 133 | // Create them if they don't exist 134 | [self createBars]; 135 | 136 | // Setup for bar frame positions 137 | CGRect bounds = self.bounds; 138 | NSInteger paddingY = (CGRectGetHeight(bounds) 139 | - (self.bars.count * self.barHeight) 140 | - ((self.bars.count - 1) * self.barSpacing) 141 | ) / 2; 142 | NSInteger paddingX = (CGRectGetWidth(bounds) - self.barWidth) / 2; 143 | CGFloat cornerRadius = self.barHeight / 2; 144 | 145 | // Update bar frames 146 | CGFloat yOffset = paddingY; 147 | for (UIView *bar in self.bars) 148 | { 149 | bar.frame = CGRectMake( 150 | paddingX, yOffset, 151 | self.barWidth, self.barHeight 152 | ); 153 | bar.layer.cornerRadius = cornerRadius; 154 | yOffset += self.barHeight + self.barSpacing; 155 | } 156 | } 157 | 158 | 159 | /** @brief Updates all bars with color */ 160 | - (void)updateBarTint:(BOOL)highlighted 161 | { 162 | for (UIView *bar in self.bars) { 163 | bar.backgroundColor = [self.barTint 164 | colorWithAlphaComponent:(highlighted 165 | ? ALPHA_PRESSED_TINT : ALPHA_UNPRESSED_TINT)]; 166 | } 167 | } 168 | 169 | /** @brief Animates bars based on selected state */ 170 | - (void)animateBars:(BOOL)selected 171 | { 172 | // Create timing function if needed 173 | if (!self.timingFunction) { 174 | self.timingFunction = [CAMediaTimingFunction 175 | functionWithControlPoints:1.0 :0.0 :0.645 :0.650]; 176 | } 177 | 178 | // Create keyframe times if needed 179 | if (!self.keyframeTimes) { 180 | self.keyframeTimes = @[ 181 | @(0.0), @(0.45), @(0.75), @(1.0) 182 | ]; 183 | } 184 | 185 | // Setup 186 | CALayer *layer; 187 | CAKeyframeAnimation *animation; 188 | 189 | // This needs to shift the rotated bar into the center of the button, which is exactly one bar spacer and two halves of the center bar and the bar itself 190 | CGFloat shiftY = self.barHeight + self.barSpacing; 191 | 192 | // Animate to closed X 193 | if (selected) 194 | { 195 | ///////////////////////// 196 | // Bar 1 197 | layer = self.bar1.layer; 198 | 199 | // Animate rotation 200 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 201 | animation.duration = self.animationDuration; 202 | animation.values = @[ 203 | @(DEGREES_TO_RADIANS(0)) 204 | , @(DEGREES_TO_RADIANS(145)) 205 | , @(DEGREES_TO_RADIANS(130)) 206 | , @(DEGREES_TO_RADIANS(135)) 207 | ]; 208 | animation.keyTimes = self.keyframeTimes; 209 | animation.timingFunction = self.timingFunction; 210 | animation.fillMode = kCAFillModeForwards; 211 | [layer addAnimation:animation forKey:@"rotation"]; 212 | 213 | // Animate position 214 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 215 | animation.duration = self.animationDuration; 216 | animation.values = @[ 217 | @(0) 218 | , @(shiftY) 219 | , @(shiftY) 220 | , @(shiftY) 221 | ]; 222 | animation.keyTimes = self.keyframeTimes; 223 | animation.timingFunction = self.timingFunction; 224 | animation.fillMode = kCAFillModeForwards; 225 | [layer addAnimation:animation forKey:@"translation"]; 226 | 227 | // Update transform 228 | layer.transform = CATransform3DRotate( 229 | CATransform3DTranslate( 230 | CATransform3DIdentity 231 | , 0, shiftY, 0) 232 | , DEGREES_TO_RADIANS(135), 0, 0, 1); 233 | 234 | ///////////////////////// 235 | // Bar 2 236 | layer = self.bar2.layer; 237 | animation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 238 | animation.duration = self.animationDuration / 2; 239 | animation.values = @[ @(layer.opacity), @(0.0) ]; 240 | animation.keyTimes = @[ @(0.0), @(1.0) ]; 241 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 242 | animation.fillMode = kCAFillModeForwards; 243 | [layer addAnimation:animation forKey:@"opacity"]; 244 | layer.opacity = 0; // Actually update opacity 245 | 246 | 247 | ///////////////////////// 248 | // Bar 3 249 | layer = self.bar3.layer; 250 | 251 | // Animate rotation 252 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 253 | animation.duration = self.animationDuration; 254 | animation.values = @[ 255 | @(DEGREES_TO_RADIANS(0)) 256 | , @(DEGREES_TO_RADIANS(-145)) 257 | , @(DEGREES_TO_RADIANS(-130)) 258 | , @(DEGREES_TO_RADIANS(-135)) 259 | ]; 260 | animation.keyTimes = self.keyframeTimes; 261 | animation.timingFunction = self.timingFunction; 262 | animation.fillMode = kCAFillModeForwards; 263 | [layer addAnimation:animation forKey:@"rotation"]; 264 | 265 | // Animate position 266 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 267 | animation.duration = self.animationDuration; 268 | animation.values = @[ 269 | @(0) 270 | , @(-shiftY) 271 | , @(-shiftY) 272 | , @(-shiftY) 273 | ]; 274 | animation.keyTimes = self.keyframeTimes; 275 | animation.timingFunction = self.timingFunction; 276 | animation.fillMode = kCAFillModeForwards; 277 | [layer addAnimation:animation forKey:@"translation"]; 278 | 279 | // Update transform 280 | layer.transform = CATransform3DRotate( 281 | CATransform3DTranslate( 282 | CATransform3DIdentity 283 | , 0, -shiftY, 0) 284 | , DEGREES_TO_RADIANS(-135), 0, 0, 1); 285 | } 286 | else // Show hamburger 287 | { 288 | ///////////////////////// 289 | // Bar 1 290 | layer = self.bar1.layer; 291 | 292 | // Animate rotation 293 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 294 | animation.duration = self.animationDuration; 295 | animation.values = @[ 296 | @(DEGREES_TO_RADIANS(135)) 297 | , @(DEGREES_TO_RADIANS(-10)) 298 | , @(DEGREES_TO_RADIANS(5)) 299 | , @(DEGREES_TO_RADIANS(0)) 300 | ]; 301 | animation.keyTimes = self.keyframeTimes; 302 | animation.timingFunction = self.timingFunction; 303 | animation.fillMode = kCAFillModeForwards; 304 | [layer addAnimation:animation forKey:@"rotation"]; 305 | 306 | // Animate position 307 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 308 | animation.duration = self.animationDuration; 309 | animation.values = @[ 310 | @(shiftY) 311 | , @(0) 312 | , @(0) 313 | , @(0) 314 | ]; 315 | animation.keyTimes = self.keyframeTimes; 316 | animation.timingFunction = self.timingFunction; 317 | animation.fillMode = kCAFillModeForwards; 318 | [layer addAnimation:animation forKey:@"translation"]; 319 | layer.transform = CATransform3DIdentity; // Update 320 | 321 | 322 | ///////////////////////// 323 | // Bar 2 324 | layer = self.bar2.layer; 325 | animation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 326 | animation.duration = self.animationDuration; 327 | animation.values = @[ 328 | @(layer.opacity) 329 | , @(layer.opacity) 330 | , @(layer.opacity) 331 | , @(1.0) 332 | ]; 333 | animation.keyTimes = self.keyframeTimes; 334 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 335 | animation.fillMode = kCAFillModeForwards; 336 | [layer addAnimation:animation forKey:@"opacity"]; 337 | 338 | // Actually update opacity 339 | layer.opacity = 1; 340 | 341 | 342 | ///////////////////////// 343 | // Bar 3 344 | layer = self.bar3.layer; 345 | 346 | // Animate rotation 347 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"]; 348 | animation.duration = self.animationDuration; 349 | animation.values = @[ 350 | @(DEGREES_TO_RADIANS(-135)) 351 | , @(DEGREES_TO_RADIANS(10)) 352 | , @(DEGREES_TO_RADIANS(-5)) 353 | , @(DEGREES_TO_RADIANS(0)) 354 | ]; 355 | animation.keyTimes = self.keyframeTimes; 356 | animation.timingFunction = self.timingFunction; 357 | animation.fillMode = kCAFillModeForwards; 358 | [layer addAnimation:animation forKey:@"rotation"]; 359 | 360 | // Animate position 361 | animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 362 | animation.duration = self.animationDuration; 363 | animation.values = @[ 364 | @(-shiftY) 365 | , @(0) 366 | , @(0) 367 | , @(0) 368 | ]; 369 | animation.keyTimes = self.keyframeTimes; 370 | animation.timingFunction = self.timingFunction; 371 | animation.fillMode = kCAFillModeForwards; 372 | [layer addAnimation:animation forKey:@"translation"]; 373 | layer.transform = CATransform3DIdentity; // Update 374 | } 375 | } 376 | 377 | @end 378 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2230872A18F9AC57008E9412 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230872918F9AC57008E9412 /* Foundation.framework */; }; 11 | 2230872C18F9AC57008E9412 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230872B18F9AC57008E9412 /* CoreGraphics.framework */; }; 12 | 2230872E18F9AC57008E9412 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230872D18F9AC57008E9412 /* UIKit.framework */; }; 13 | 2230873418F9AC57008E9412 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2230873218F9AC57008E9412 /* InfoPlist.strings */; }; 14 | 2230873618F9AC57008E9412 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2230873518F9AC57008E9412 /* main.m */; }; 15 | 2230873A18F9AC57008E9412 /* CCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2230873918F9AC57008E9412 /* CCAppDelegate.m */; }; 16 | 2230873D18F9AC57008E9412 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2230873B18F9AC57008E9412 /* Main.storyboard */; }; 17 | 2230874018F9AC57008E9412 /* CCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2230873F18F9AC57008E9412 /* CCViewController.m */; }; 18 | 2230874218F9AC57008E9412 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2230874118F9AC57008E9412 /* Images.xcassets */; }; 19 | 2230874918F9AC57008E9412 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230874818F9AC57008E9412 /* XCTest.framework */; }; 20 | 2230874A18F9AC57008E9412 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230872918F9AC57008E9412 /* Foundation.framework */; }; 21 | 2230874B18F9AC57008E9412 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230872D18F9AC57008E9412 /* UIKit.framework */; }; 22 | 2230875318F9AC57008E9412 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2230875118F9AC57008E9412 /* InfoPlist.strings */; }; 23 | 2230875518F9AC57008E9412 /* FacebookMenuButtonExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2230875418F9AC57008E9412 /* FacebookMenuButtonExampleTests.m */; }; 24 | 2230876018F9AC9A008E9412 /* FacebookMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2230875F18F9AC9A008E9412 /* FacebookMenuButton.m */; }; 25 | 2230876318F9AF5D008E9412 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2230876218F9AF5D008E9412 /* QuartzCore.framework */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 2230874C18F9AC57008E9412 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 2230871E18F9AC57008E9412 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 2230872518F9AC57008E9412; 34 | remoteInfo = FacebookMenuButtonExample; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 2230872618F9AC57008E9412 /* FacebookMenuButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FacebookMenuButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 2230872918F9AC57008E9412 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 2230872B18F9AC57008E9412 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 2230872D18F9AC57008E9412 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 2230873118F9AC57008E9412 /* FacebookMenuButtonExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FacebookMenuButtonExample-Info.plist"; sourceTree = ""; }; 44 | 2230873318F9AC57008E9412 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 2230873518F9AC57008E9412 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 2230873718F9AC57008E9412 /* FacebookMenuButtonExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FacebookMenuButtonExample-Prefix.pch"; sourceTree = ""; }; 47 | 2230873818F9AC57008E9412 /* CCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCAppDelegate.h; sourceTree = ""; }; 48 | 2230873918F9AC57008E9412 /* CCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CCAppDelegate.m; sourceTree = ""; }; 49 | 2230873C18F9AC57008E9412 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 2230873E18F9AC57008E9412 /* CCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCViewController.h; sourceTree = ""; }; 51 | 2230873F18F9AC57008E9412 /* CCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CCViewController.m; sourceTree = ""; }; 52 | 2230874118F9AC57008E9412 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | 2230874718F9AC57008E9412 /* FacebookMenuButtonExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FacebookMenuButtonExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 2230874818F9AC57008E9412 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 55 | 2230875018F9AC57008E9412 /* FacebookMenuButtonExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FacebookMenuButtonExampleTests-Info.plist"; sourceTree = ""; }; 56 | 2230875218F9AC57008E9412 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | 2230875418F9AC57008E9412 /* FacebookMenuButtonExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FacebookMenuButtonExampleTests.m; sourceTree = ""; }; 58 | 2230875E18F9AC9A008E9412 /* FacebookMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FacebookMenuButton.h; path = ../../FacebookMenuButton/FacebookMenuButton.h; sourceTree = ""; }; 59 | 2230875F18F9AC9A008E9412 /* FacebookMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FacebookMenuButton.m; path = ../../FacebookMenuButton/FacebookMenuButton.m; sourceTree = ""; }; 60 | 2230876218F9AF5D008E9412 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 2230872318F9AC57008E9412 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 2230876318F9AF5D008E9412 /* QuartzCore.framework in Frameworks */, 69 | 2230872C18F9AC57008E9412 /* CoreGraphics.framework in Frameworks */, 70 | 2230872E18F9AC57008E9412 /* UIKit.framework in Frameworks */, 71 | 2230872A18F9AC57008E9412 /* Foundation.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 2230874418F9AC57008E9412 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 2230874918F9AC57008E9412 /* XCTest.framework in Frameworks */, 80 | 2230874B18F9AC57008E9412 /* UIKit.framework in Frameworks */, 81 | 2230874A18F9AC57008E9412 /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 2230871D18F9AC57008E9412 = { 89 | isa = PBXGroup; 90 | children = ( 91 | 2230872F18F9AC57008E9412 /* FacebookMenuButtonExample */, 92 | 2230874E18F9AC57008E9412 /* FacebookMenuButtonExampleTests */, 93 | 2230872818F9AC57008E9412 /* Frameworks */, 94 | 2230872718F9AC57008E9412 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 2230872718F9AC57008E9412 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 2230872618F9AC57008E9412 /* FacebookMenuButtonExample.app */, 102 | 2230874718F9AC57008E9412 /* FacebookMenuButtonExampleTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 2230872818F9AC57008E9412 /* Frameworks */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 2230876218F9AF5D008E9412 /* QuartzCore.framework */, 111 | 2230872918F9AC57008E9412 /* Foundation.framework */, 112 | 2230872B18F9AC57008E9412 /* CoreGraphics.framework */, 113 | 2230872D18F9AC57008E9412 /* UIKit.framework */, 114 | 2230874818F9AC57008E9412 /* XCTest.framework */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | 2230872F18F9AC57008E9412 /* FacebookMenuButtonExample */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 2230873818F9AC57008E9412 /* CCAppDelegate.h */, 123 | 2230873918F9AC57008E9412 /* CCAppDelegate.m */, 124 | 2230873B18F9AC57008E9412 /* Main.storyboard */, 125 | 2230873E18F9AC57008E9412 /* CCViewController.h */, 126 | 2230873F18F9AC57008E9412 /* CCViewController.m */, 127 | 2230874118F9AC57008E9412 /* Images.xcassets */, 128 | 2230873018F9AC57008E9412 /* Supporting Files */, 129 | 2230876118F9AC9F008E9412 /* FacebookMenuButton */, 130 | ); 131 | path = FacebookMenuButtonExample; 132 | sourceTree = ""; 133 | }; 134 | 2230873018F9AC57008E9412 /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 2230873118F9AC57008E9412 /* FacebookMenuButtonExample-Info.plist */, 138 | 2230873218F9AC57008E9412 /* InfoPlist.strings */, 139 | 2230873518F9AC57008E9412 /* main.m */, 140 | 2230873718F9AC57008E9412 /* FacebookMenuButtonExample-Prefix.pch */, 141 | ); 142 | name = "Supporting Files"; 143 | sourceTree = ""; 144 | }; 145 | 2230874E18F9AC57008E9412 /* FacebookMenuButtonExampleTests */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 2230875418F9AC57008E9412 /* FacebookMenuButtonExampleTests.m */, 149 | 2230874F18F9AC57008E9412 /* Supporting Files */, 150 | ); 151 | path = FacebookMenuButtonExampleTests; 152 | sourceTree = ""; 153 | }; 154 | 2230874F18F9AC57008E9412 /* Supporting Files */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 2230875018F9AC57008E9412 /* FacebookMenuButtonExampleTests-Info.plist */, 158 | 2230875118F9AC57008E9412 /* InfoPlist.strings */, 159 | ); 160 | name = "Supporting Files"; 161 | sourceTree = ""; 162 | }; 163 | 2230876118F9AC9F008E9412 /* FacebookMenuButton */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 2230875E18F9AC9A008E9412 /* FacebookMenuButton.h */, 167 | 2230875F18F9AC9A008E9412 /* FacebookMenuButton.m */, 168 | ); 169 | name = FacebookMenuButton; 170 | sourceTree = ""; 171 | }; 172 | /* End PBXGroup section */ 173 | 174 | /* Begin PBXNativeTarget section */ 175 | 2230872518F9AC57008E9412 /* FacebookMenuButtonExample */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 2230875818F9AC57008E9412 /* Build configuration list for PBXNativeTarget "FacebookMenuButtonExample" */; 178 | buildPhases = ( 179 | 2230872218F9AC57008E9412 /* Sources */, 180 | 2230872318F9AC57008E9412 /* Frameworks */, 181 | 2230872418F9AC57008E9412 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | ); 187 | name = FacebookMenuButtonExample; 188 | productName = FacebookMenuButtonExample; 189 | productReference = 2230872618F9AC57008E9412 /* FacebookMenuButtonExample.app */; 190 | productType = "com.apple.product-type.application"; 191 | }; 192 | 2230874618F9AC57008E9412 /* FacebookMenuButtonExampleTests */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 2230875B18F9AC57008E9412 /* Build configuration list for PBXNativeTarget "FacebookMenuButtonExampleTests" */; 195 | buildPhases = ( 196 | 2230874318F9AC57008E9412 /* Sources */, 197 | 2230874418F9AC57008E9412 /* Frameworks */, 198 | 2230874518F9AC57008E9412 /* Resources */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | 2230874D18F9AC57008E9412 /* PBXTargetDependency */, 204 | ); 205 | name = FacebookMenuButtonExampleTests; 206 | productName = FacebookMenuButtonExampleTests; 207 | productReference = 2230874718F9AC57008E9412 /* FacebookMenuButtonExampleTests.xctest */; 208 | productType = "com.apple.product-type.bundle.unit-test"; 209 | }; 210 | /* End PBXNativeTarget section */ 211 | 212 | /* Begin PBXProject section */ 213 | 2230871E18F9AC57008E9412 /* Project object */ = { 214 | isa = PBXProject; 215 | attributes = { 216 | CLASSPREFIX = CC; 217 | LastUpgradeCheck = 0510; 218 | ORGANIZATIONNAME = "Carlin Creations"; 219 | TargetAttributes = { 220 | 2230874618F9AC57008E9412 = { 221 | TestTargetID = 2230872518F9AC57008E9412; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = 2230872118F9AC57008E9412 /* Build configuration list for PBXProject "FacebookMenuButtonExample" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 2230871D18F9AC57008E9412; 234 | productRefGroup = 2230872718F9AC57008E9412 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 2230872518F9AC57008E9412 /* FacebookMenuButtonExample */, 239 | 2230874618F9AC57008E9412 /* FacebookMenuButtonExampleTests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | 2230872418F9AC57008E9412 /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 2230874218F9AC57008E9412 /* Images.xcassets in Resources */, 250 | 2230873418F9AC57008E9412 /* InfoPlist.strings in Resources */, 251 | 2230873D18F9AC57008E9412 /* Main.storyboard in Resources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | 2230874518F9AC57008E9412 /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | 2230875318F9AC57008E9412 /* InfoPlist.strings in Resources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | /* End PBXResourcesBuildPhase section */ 264 | 265 | /* Begin PBXSourcesBuildPhase section */ 266 | 2230872218F9AC57008E9412 /* Sources */ = { 267 | isa = PBXSourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | 2230873A18F9AC57008E9412 /* CCAppDelegate.m in Sources */, 271 | 2230873618F9AC57008E9412 /* main.m in Sources */, 272 | 2230876018F9AC9A008E9412 /* FacebookMenuButton.m in Sources */, 273 | 2230874018F9AC57008E9412 /* CCViewController.m in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 2230874318F9AC57008E9412 /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 2230875518F9AC57008E9412 /* FacebookMenuButtonExampleTests.m in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXSourcesBuildPhase section */ 286 | 287 | /* Begin PBXTargetDependency section */ 288 | 2230874D18F9AC57008E9412 /* PBXTargetDependency */ = { 289 | isa = PBXTargetDependency; 290 | target = 2230872518F9AC57008E9412 /* FacebookMenuButtonExample */; 291 | targetProxy = 2230874C18F9AC57008E9412 /* PBXContainerItemProxy */; 292 | }; 293 | /* End PBXTargetDependency section */ 294 | 295 | /* Begin PBXVariantGroup section */ 296 | 2230873218F9AC57008E9412 /* InfoPlist.strings */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 2230873318F9AC57008E9412 /* en */, 300 | ); 301 | name = InfoPlist.strings; 302 | sourceTree = ""; 303 | }; 304 | 2230873B18F9AC57008E9412 /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 2230873C18F9AC57008E9412 /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 2230875118F9AC57008E9412 /* InfoPlist.strings */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 2230875218F9AC57008E9412 /* en */, 316 | ); 317 | name = InfoPlist.strings; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 2230875618F9AC57008E9412 /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INT_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | GCC_C_LANGUAGE_STANDARD = gnu99; 342 | GCC_DYNAMIC_NO_PIC = NO; 343 | GCC_OPTIMIZATION_LEVEL = 0; 344 | GCC_PREPROCESSOR_DEFINITIONS = ( 345 | "DEBUG=1", 346 | "$(inherited)", 347 | ); 348 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 349 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 350 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 351 | GCC_WARN_UNDECLARED_SELECTOR = YES; 352 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 353 | GCC_WARN_UNUSED_FUNCTION = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 356 | ONLY_ACTIVE_ARCH = YES; 357 | SDKROOT = iphoneos; 358 | }; 359 | name = Debug; 360 | }; 361 | 2230875718F9AC57008E9412 /* Release */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ALWAYS_SEARCH_USER_PATHS = NO; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BOOL_CONVERSION = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = YES; 379 | ENABLE_NS_ASSERTIONS = NO; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 388 | SDKROOT = iphoneos; 389 | VALIDATE_PRODUCT = YES; 390 | }; 391 | name = Release; 392 | }; 393 | 2230875918F9AC57008E9412 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 398 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 399 | GCC_PREFIX_HEADER = "FacebookMenuButtonExample/FacebookMenuButtonExample-Prefix.pch"; 400 | INFOPLIST_FILE = "FacebookMenuButtonExample/FacebookMenuButtonExample-Info.plist"; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | WRAPPER_EXTENSION = app; 403 | }; 404 | name = Debug; 405 | }; 406 | 2230875A18F9AC57008E9412 /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 411 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 412 | GCC_PREFIX_HEADER = "FacebookMenuButtonExample/FacebookMenuButtonExample-Prefix.pch"; 413 | INFOPLIST_FILE = "FacebookMenuButtonExample/FacebookMenuButtonExample-Info.plist"; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | WRAPPER_EXTENSION = app; 416 | }; 417 | name = Release; 418 | }; 419 | 2230875C18F9AC57008E9412 /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FacebookMenuButtonExample.app/FacebookMenuButtonExample"; 423 | FRAMEWORK_SEARCH_PATHS = ( 424 | "$(SDKROOT)/Developer/Library/Frameworks", 425 | "$(inherited)", 426 | "$(DEVELOPER_FRAMEWORKS_DIR)", 427 | ); 428 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 429 | GCC_PREFIX_HEADER = "FacebookMenuButtonExample/FacebookMenuButtonExample-Prefix.pch"; 430 | GCC_PREPROCESSOR_DEFINITIONS = ( 431 | "DEBUG=1", 432 | "$(inherited)", 433 | ); 434 | INFOPLIST_FILE = "FacebookMenuButtonExampleTests/FacebookMenuButtonExampleTests-Info.plist"; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | TEST_HOST = "$(BUNDLE_LOADER)"; 437 | WRAPPER_EXTENSION = xctest; 438 | }; 439 | name = Debug; 440 | }; 441 | 2230875D18F9AC57008E9412 /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FacebookMenuButtonExample.app/FacebookMenuButtonExample"; 445 | FRAMEWORK_SEARCH_PATHS = ( 446 | "$(SDKROOT)/Developer/Library/Frameworks", 447 | "$(inherited)", 448 | "$(DEVELOPER_FRAMEWORKS_DIR)", 449 | ); 450 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 451 | GCC_PREFIX_HEADER = "FacebookMenuButtonExample/FacebookMenuButtonExample-Prefix.pch"; 452 | INFOPLIST_FILE = "FacebookMenuButtonExampleTests/FacebookMenuButtonExampleTests-Info.plist"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TEST_HOST = "$(BUNDLE_LOADER)"; 455 | WRAPPER_EXTENSION = xctest; 456 | }; 457 | name = Release; 458 | }; 459 | /* End XCBuildConfiguration section */ 460 | 461 | /* Begin XCConfigurationList section */ 462 | 2230872118F9AC57008E9412 /* Build configuration list for PBXProject "FacebookMenuButtonExample" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 2230875618F9AC57008E9412 /* Debug */, 466 | 2230875718F9AC57008E9412 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 2230875818F9AC57008E9412 /* Build configuration list for PBXNativeTarget "FacebookMenuButtonExample" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 2230875918F9AC57008E9412 /* Debug */, 475 | 2230875A18F9AC57008E9412 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | }; 479 | 2230875B18F9AC57008E9412 /* Build configuration list for PBXNativeTarget "FacebookMenuButtonExampleTests" */ = { 480 | isa = XCConfigurationList; 481 | buildConfigurations = ( 482 | 2230875C18F9AC57008E9412 /* Debug */, 483 | 2230875D18F9AC57008E9412 /* Release */, 484 | ); 485 | defaultConfigurationIsVisible = 0; 486 | }; 487 | /* End XCConfigurationList section */ 488 | }; 489 | rootObject = 2230871E18F9AC57008E9412 /* Project object */; 490 | } 491 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/CCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CCAppDelegate.h 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/CCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CCAppDelegate.m 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import "CCAppDelegate.h" 10 | 11 | @implementation CCAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/CCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CCViewController.h 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CCViewController : UIViewController 12 | - (IBAction)menuSelected:(UIButton *)sender; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/CCViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CCViewController.m 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import "CCViewController.h" 10 | 11 | #import "FacebookMenuButton.h" 12 | 13 | @interface CCViewController () 14 | 15 | @property (nonatomic, strong) FacebookMenuButton *menuButton; 16 | 17 | @end 18 | 19 | @implementation CCViewController 20 | 21 | - (void)viewDidLoad 22 | { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view, typically from a nib. 25 | 26 | self.menuButton = [[FacebookMenuButton alloc] initWithFrame:CGRectMake(0, 0, 88, 88)]; 27 | self.menuButton.center = self.view.center; 28 | [self.view addSubview:self.menuButton]; 29 | 30 | [self.menuButton addTarget:self action:@selector(menuSelected:) forControlEvents:UIControlEventTouchUpInside]; 31 | } 32 | 33 | - (void)didReceiveMemoryWarning 34 | { 35 | [super didReceiveMemoryWarning]; 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | - (IBAction)menuSelected:(UIButton *)sender 40 | { 41 | sender.selected = !sender.selected; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/FacebookMenuButtonExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.carlinyuen.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/FacebookMenuButtonExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FacebookMenuButtonExample 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CCAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CCAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExampleTests/FacebookMenuButtonExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.carlinyuen.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExampleTests/FacebookMenuButtonExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // FacebookMenuButtonExampleTests.m 3 | // FacebookMenuButtonExampleTests 4 | // 5 | // Created by . Carlin on 4/12/14. 6 | // Copyright (c) 2014 Carlin Creations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FacebookMenuButtonExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation FacebookMenuButtonExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /FacebookMenuButtonExample/FacebookMenuButtonExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Carlin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FacebookMenuButton 2 | ================== 3 | 4 | My shot at recreating Facebook Paper's hamburger menu button. 5 | Keywords: iOS, objective-c, objc, Xcode, paper, facebook, menu, hamburger, button. 6 | 7 | ## Requirements 8 | - You'll need to have the QuartzCore library imported into your project. 9 | 10 | ## Demo 11 | - See the FacebookMenuButtonExample project in the repo. It has an example of 12 | a button added through IB as well as one created in code. 13 | 14 | ![](./demo.gif) 15 | 16 | ## Usage 17 | 1. Import the button into your view controller: `#import "FacebookMenuButton.h"` 18 | 2. Create and add an instance of the button (you can also do this in IB): 19 | 20 | FacebookMenuButton *menuButton = [[FacebookMenuButton alloc] 21 | initWithFrame:CGRectMake(0, 0, 44, 44)]; 22 | menuButton.center = self.view.center; 23 | [self.view addSubview:menuButton]; 24 | 25 | 3. Add a target for the button when pressed, and set the button as selected 26 | when you want the animation to fire: 27 | 28 | [menuButton addTarget:self action:@selector(menuSelected:) 29 | forControlEvents:UIControlEventTouchUpInside]; 30 | 31 | ... 32 | 33 | - (IBAction)menuSelected:(UIButton *)sender { 34 | sender.selected = !sender.selected; 35 | } 36 | 37 | 4. That's it! You're done. Bonus points for customizing your button with the 38 | following properties: 39 | 40 | /** Color for the menu bars */ 41 | @property (nonatomic, strong) UIColor *barTint; 42 | 43 | /* Width of the menu bars */ 44 | @property (nonatomic, assign) NSInteger barWidth; 45 | 46 | /* Height or thickness of the menu bars */ 47 | @property (nonatomic, assign) NSInteger barHeight; 48 | 49 | /* Space between the menu bars */ 50 | @property (nonatomic, assign) NSInteger barSpacing; 51 | 52 | /* Duration of the animation when selected */ 53 | @property (nonatomic, assign) NSTimeInterval animationDuration; 54 | 55 | 56 | ## Notes 57 | - If you're using this in Interface Builder (IB), you can drag a UIButton and 58 | simply set its Custom Class to the Facebook Button. However, you'll also want 59 | to set the type to `Custom` instead of the default `System` or you'll get an 60 | annoying blue highlight when the button is selected. 61 | 62 | ### Inspiration 63 | From Daniel Strunk's HTML5/CSS3 version of the animation: http://dstrunk.com/emulating-facebook-papers-menu-animation/ 64 | 65 | ### License 66 | MIT 67 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carlinyuen/FacebookMenuButton/0e642634bde674023fafde7b2b85e7bc676830db/demo.gif --------------------------------------------------------------------------------