├── .gitignore ├── LICENSE ├── MCFireworksButton.podspec ├── MCFireworksButton ├── MCFireworksButton.h ├── MCFireworksButton.m ├── MCFireworksView.h └── MCFireworksView.m ├── MCFireworksButtonDemo ├── MCFireworksButtonDemo.xcodeproj │ └── project.pbxproj ├── MCFireworksButtonDemo │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── Like-Blue.imageset │ │ │ ├── Contents.json │ │ │ └── Like-Blue@2x.png │ │ ├── Like.imageset │ │ │ ├── Contents.json │ │ │ └── Like@2x.png │ │ └── Sparkle.imageset │ │ │ ├── Contents.json │ │ │ └── Sparkle.png │ ├── MCAppDelegate.h │ ├── MCAppDelegate.m │ ├── MCFireworksButtonDemo-Info.plist │ ├── MCFireworksButtonDemo-Prefix.pch │ ├── MCViewController.h │ ├── MCViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── MCFireworksButtonDemoTests │ ├── MCFireworksButtonDemoTests-Info.plist │ ├── MCFireworksButtonDemoTests.m │ └── en.lproj │ └── InfoPlist.strings ├── README.md └── screenshot.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | .DS_Store 6 | build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | *.xcworkspace 16 | !default.xcworkspace 17 | xcuserdata 18 | profile 19 | *.moved-aside 20 | DerivedData 21 | .idea/ 22 | 23 | # CocoaPods 24 | Pods 25 | Podfile.lock 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Matthew Cheok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MCFireworksButton.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'MCFireworksButton' 3 | s.version = '0.1' 4 | s.platform = :ios, '7.0' 5 | s.license = { :type => 'MIT', :file => 'LICENSE' } 6 | s.summary = 'Drop-in button control with with particle effects similar to the Like button in Facebook Paper.' 7 | s.homepage = 'https://github.com/matthewcheok/MCFireworksButton' 8 | s.author = { 'Matthew Cheok' => 'cheok.jz@gmail.com' } 9 | s.requires_arc = true 10 | s.source = { :git => 'https://github.com/matthewcheok/MCFireworksButton.git', :branch => 'master', :tag => s.version.to_s } 11 | s.source_files = 'MCFireworksButton/*.{h,m}' 12 | s.public_header_files = 'MCFireworksButton/*.h' 13 | end 14 | -------------------------------------------------------------------------------- /MCFireworksButton/MCFireworksButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCFireworksButton.h 3 | // MCFireworksButton 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MCFireworksButton : UIButton 12 | 13 | @property (strong, nonatomic) UIImage *particleImage; 14 | @property (assign, nonatomic) CGFloat particleScale; 15 | @property (assign, nonatomic) CGFloat particleScaleRange; 16 | 17 | - (void)animate; 18 | - (void)popOutsideWithDuration:(NSTimeInterval)duration; 19 | - (void)popInsideWithDuration:(NSTimeInterval)duration; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MCFireworksButton/MCFireworksButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // MCFireworksButton.m 3 | // MCFireworksButton 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import "MCFireworksButton.h" 10 | #import "MCFireworksView.h" 11 | 12 | @interface MCFireworksButton () 13 | 14 | @property (strong, nonatomic) MCFireworksView *fireworksView; 15 | 16 | @end 17 | 18 | @implementation MCFireworksButton 19 | 20 | - (void)setup { 21 | self.clipsToBounds = NO; 22 | 23 | _fireworksView = [[MCFireworksView alloc] init]; 24 | [self insertSubview:_fireworksView atIndex:0]; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | [self setup]; 31 | } 32 | return self; 33 | } 34 | 35 | - (id)initWithCoder:(NSCoder *)aDecoder { 36 | self = [super initWithCoder:aDecoder]; 37 | if (self) { 38 | [self setup]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)layoutSubviews { 44 | [super layoutSubviews]; 45 | self.fireworksView.frame = self.bounds; 46 | 47 | [self insertSubview:self.fireworksView atIndex:0]; 48 | } 49 | 50 | #pragma mark - Methods 51 | 52 | - (void)animate { 53 | [self.fireworksView animate]; 54 | } 55 | 56 | - (void)popOutsideWithDuration:(NSTimeInterval)duration { 57 | __weak typeof(self) weakSelf = self; 58 | self.transform = CGAffineTransformIdentity; 59 | [UIView animateKeyframesWithDuration:duration delay:0 options:0 animations: ^{ 60 | [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 3.0 animations: ^{ 61 | typeof(self) strongSelf = weakSelf; 62 | strongSelf.transform = CGAffineTransformMakeScale(1.5, 1.5); 63 | }]; 64 | [UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations: ^{ 65 | typeof(self) strongSelf = weakSelf; 66 | strongSelf.transform = CGAffineTransformMakeScale(0.8, 0.8); 67 | }]; 68 | [UIView addKeyframeWithRelativeStartTime:2/3.0 relativeDuration:1/3.0 animations: ^{ 69 | typeof(self) strongSelf = weakSelf; 70 | strongSelf.transform = CGAffineTransformMakeScale(1.0, 1.0); 71 | }]; 72 | } completion:nil]; 73 | } 74 | 75 | - (void)popInsideWithDuration:(NSTimeInterval)duration { 76 | __weak typeof(self) weakSelf = self; 77 | self.transform = CGAffineTransformIdentity; 78 | [UIView animateKeyframesWithDuration:duration delay:0 options:0 animations: ^{ 79 | [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 2.0 animations: ^{ 80 | typeof(self) strongSelf = weakSelf; 81 | strongSelf.transform = CGAffineTransformMakeScale(0.8, 0.8); 82 | }]; 83 | [UIView addKeyframeWithRelativeStartTime:1/2.0 relativeDuration:1/2.0 animations: ^{ 84 | typeof(self) strongSelf = weakSelf; 85 | strongSelf.transform = CGAffineTransformMakeScale(1.0, 1.0); 86 | }]; 87 | } completion:nil]; 88 | } 89 | 90 | #pragma mark - Properties 91 | 92 | - (UIImage *)particleImage { 93 | return self.fireworksView.particleImage; 94 | } 95 | 96 | - (void)setParticleImage:(UIImage *)particleImage { 97 | self.fireworksView.particleImage = particleImage; 98 | } 99 | 100 | - (CGFloat)particleScale { 101 | return self.fireworksView.particleScale; 102 | } 103 | 104 | - (void)setParticleScale:(CGFloat)particleScale { 105 | self.fireworksView.particleScale = particleScale; 106 | } 107 | 108 | - (CGFloat)particleScaleRange { 109 | return self.fireworksView.particleScaleRange; 110 | } 111 | 112 | - (void)setParticleScaleRange:(CGFloat)particleScaleRange { 113 | self.fireworksView.particleScaleRange = particleScaleRange; 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /MCFireworksButton/MCFireworksView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCFireworksView.h 3 | // MCFireworksButton 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MCFireworksView : UIView 12 | 13 | @property (strong, nonatomic) UIImage *particleImage; 14 | @property (assign, nonatomic) CGFloat particleScale; 15 | @property (assign, nonatomic) CGFloat particleScaleRange; 16 | 17 | - (void)animate; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MCFireworksButton/MCFireworksView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MCFireworksView.m 3 | // MCFireworksButton 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import "MCFireworksView.h" 10 | 11 | @interface MCFireworksView () 12 | 13 | @property (strong, nonatomic) NSArray *emitterCells; 14 | @property (strong, nonatomic) CAEmitterLayer *chargeLayer; 15 | @property (strong, nonatomic) CAEmitterLayer *explosionLayer; 16 | 17 | @end 18 | 19 | @implementation MCFireworksView 20 | 21 | - (void)setup { 22 | self.clipsToBounds = NO; 23 | self.userInteractionEnabled = NO; 24 | 25 | CAEmitterCell *explosionCell = [CAEmitterCell emitterCell]; 26 | explosionCell.name = @"explosion"; 27 | explosionCell.alphaRange = 0.20; 28 | explosionCell.alphaSpeed = -1.0; 29 | 30 | explosionCell.lifetime = 0.7; 31 | explosionCell.lifetimeRange = 0.3; 32 | explosionCell.birthRate = 0; 33 | explosionCell.velocity = 40.00; 34 | explosionCell.velocityRange = 10.00; 35 | 36 | _explosionLayer = [CAEmitterLayer layer]; 37 | _explosionLayer.name = @"emitterLayer"; 38 | _explosionLayer.emitterShape = kCAEmitterLayerCircle; 39 | _explosionLayer.emitterMode = kCAEmitterLayerOutline; 40 | _explosionLayer.emitterSize = CGSizeMake(25, 0); 41 | _explosionLayer.emitterCells = @[explosionCell]; 42 | _explosionLayer.renderMode = kCAEmitterLayerOldestFirst; 43 | _explosionLayer.masksToBounds = NO; 44 | _explosionLayer.seed = 1366128504; 45 | [self.layer addSublayer:_explosionLayer]; 46 | 47 | CAEmitterCell *chargeCell = [CAEmitterCell emitterCell]; 48 | chargeCell.name = @"charge"; 49 | chargeCell.alphaRange = 0.20; 50 | chargeCell.alphaSpeed = -1.0; 51 | 52 | chargeCell.lifetime = 0.3; 53 | chargeCell.lifetimeRange = 0.1; 54 | chargeCell.birthRate = 0; 55 | chargeCell.velocity = -40.0; 56 | chargeCell.velocityRange = 0.00; 57 | 58 | _chargeLayer = [CAEmitterLayer layer]; 59 | _chargeLayer.name = @"emitterLayer"; 60 | _chargeLayer.emitterShape = kCAEmitterLayerCircle; 61 | _chargeLayer.emitterMode = kCAEmitterLayerOutline; 62 | _chargeLayer.emitterSize = CGSizeMake(25, 0); 63 | _chargeLayer.emitterCells = @[chargeCell]; 64 | _chargeLayer.renderMode = kCAEmitterLayerOldestFirst; 65 | _chargeLayer.masksToBounds = NO; 66 | _chargeLayer.seed = 1366128504; 67 | [self.layer addSublayer:_chargeLayer]; 68 | 69 | self.emitterCells = @[chargeCell, explosionCell]; 70 | } 71 | 72 | - (id)initWithFrame:(CGRect)frame { 73 | self = [super initWithFrame:frame]; 74 | if (self) { 75 | [self setup]; 76 | } 77 | return self; 78 | } 79 | 80 | - (id)initWithCoder:(NSCoder *)aDecoder { 81 | self = [super initWithCoder:aDecoder]; 82 | if (self) { 83 | [self setup]; 84 | } 85 | return self; 86 | } 87 | 88 | - (void)layoutSubviews { 89 | [super layoutSubviews]; 90 | CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); 91 | self.chargeLayer.emitterPosition = center; 92 | self.explosionLayer.emitterPosition = center; 93 | } 94 | 95 | #pragma mark - Methods 96 | 97 | - (void)animate { 98 | self.chargeLayer.beginTime = CACurrentMediaTime(); 99 | [self.chargeLayer setValue:@80 forKeyPath:@"emitterCells.charge.birthRate"]; 100 | dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC); 101 | dispatch_after(delay, dispatch_get_main_queue(), ^{ 102 | [self explode]; 103 | }); 104 | } 105 | 106 | - (void)explode { 107 | [self.chargeLayer setValue:@0 forKeyPath:@"emitterCells.charge.birthRate"]; 108 | self.explosionLayer.beginTime = CACurrentMediaTime(); 109 | [self.explosionLayer setValue:@500 forKeyPath:@"emitterCells.explosion.birthRate"]; 110 | dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC); 111 | dispatch_after(delay, dispatch_get_main_queue(), ^{ 112 | [self stop]; 113 | }); 114 | } 115 | 116 | - (void)stop { 117 | [self.chargeLayer setValue:@0 forKeyPath:@"emitterCells.charge.birthRate"]; 118 | [self.explosionLayer setValue:@0 forKeyPath:@"emitterCells.explosion.birthRate"]; 119 | } 120 | 121 | #pragma mark - Properties 122 | 123 | - (void)setParticleImage:(UIImage *)particleImage { 124 | _particleImage = particleImage; 125 | for (CAEmitterCell *cell in self.emitterCells) { 126 | cell.contents = (id)[particleImage CGImage]; 127 | } 128 | } 129 | 130 | - (void)setParticleScale:(CGFloat)particleScale { 131 | _particleScale = particleScale; 132 | for (CAEmitterCell *cell in self.emitterCells) { 133 | cell.scale = particleScale; 134 | } 135 | } 136 | 137 | - (void)setParticleScaleRange:(CGFloat)particleScaleRange { 138 | _particleScaleRange = particleScaleRange; 139 | for (CAEmitterCell *cell in self.emitterCells) { 140 | cell.scaleRange = particleScaleRange; 141 | } 142 | } 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 34B2D88618D68B3C0089F6A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D88518D68B3C0089F6A4 /* Foundation.framework */; }; 11 | 34B2D88818D68B3C0089F6A4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D88718D68B3C0089F6A4 /* CoreGraphics.framework */; }; 12 | 34B2D88A18D68B3C0089F6A4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D88918D68B3C0089F6A4 /* UIKit.framework */; }; 13 | 34B2D89018D68B3C0089F6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34B2D88E18D68B3C0089F6A4 /* InfoPlist.strings */; }; 14 | 34B2D89218D68B3C0089F6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B2D89118D68B3C0089F6A4 /* main.m */; }; 15 | 34B2D89618D68B3C0089F6A4 /* MCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B2D89518D68B3C0089F6A4 /* MCAppDelegate.m */; }; 16 | 34B2D89918D68B3C0089F6A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34B2D89718D68B3C0089F6A4 /* Main.storyboard */; }; 17 | 34B2D89C18D68B3C0089F6A4 /* MCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B2D89B18D68B3C0089F6A4 /* MCViewController.m */; }; 18 | 34B2D89E18D68B3C0089F6A4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34B2D89D18D68B3C0089F6A4 /* Images.xcassets */; }; 19 | 34B2D8A518D68B3C0089F6A4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D8A418D68B3C0089F6A4 /* XCTest.framework */; }; 20 | 34B2D8A618D68B3C0089F6A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D88518D68B3C0089F6A4 /* Foundation.framework */; }; 21 | 34B2D8A718D68B3C0089F6A4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B2D88918D68B3C0089F6A4 /* UIKit.framework */; }; 22 | 34B2D8AF18D68B3C0089F6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34B2D8AD18D68B3C0089F6A4 /* InfoPlist.strings */; }; 23 | 34B2D8B118D68B3C0089F6A4 /* MCFireworksButtonDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B2D8B018D68B3C0089F6A4 /* MCFireworksButtonDemoTests.m */; }; 24 | 34C946F618D68F6500F7C23F /* MCFireworksButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C946F318D68F6500F7C23F /* MCFireworksButton.m */; }; 25 | 34C946F718D68F6500F7C23F /* MCFireworksView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C946F518D68F6500F7C23F /* MCFireworksView.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 34B2D8A818D68B3C0089F6A4 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 34B2D87A18D68B3C0089F6A4 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 34B2D88118D68B3C0089F6A4; 34 | remoteInfo = MCFireworksButtonDemo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 34B2D88218D68B3C0089F6A4 /* MCFireworksButtonDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MCFireworksButtonDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 34B2D88518D68B3C0089F6A4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 34B2D88718D68B3C0089F6A4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 34B2D88918D68B3C0089F6A4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 34B2D88D18D68B3C0089F6A4 /* MCFireworksButtonDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MCFireworksButtonDemo-Info.plist"; sourceTree = ""; }; 44 | 34B2D88F18D68B3C0089F6A4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 34B2D89118D68B3C0089F6A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 34B2D89318D68B3C0089F6A4 /* MCFireworksButtonDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MCFireworksButtonDemo-Prefix.pch"; sourceTree = ""; }; 47 | 34B2D89418D68B3C0089F6A4 /* MCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAppDelegate.h; sourceTree = ""; }; 48 | 34B2D89518D68B3C0089F6A4 /* MCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCAppDelegate.m; sourceTree = ""; }; 49 | 34B2D89818D68B3C0089F6A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 34B2D89A18D68B3C0089F6A4 /* MCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCViewController.h; sourceTree = ""; }; 51 | 34B2D89B18D68B3C0089F6A4 /* MCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCViewController.m; sourceTree = ""; }; 52 | 34B2D89D18D68B3C0089F6A4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | 34B2D8A318D68B3C0089F6A4 /* MCFireworksButtonDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MCFireworksButtonDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 34B2D8A418D68B3C0089F6A4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 55 | 34B2D8AC18D68B3C0089F6A4 /* MCFireworksButtonDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MCFireworksButtonDemoTests-Info.plist"; sourceTree = ""; }; 56 | 34B2D8AE18D68B3C0089F6A4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | 34B2D8B018D68B3C0089F6A4 /* MCFireworksButtonDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCFireworksButtonDemoTests.m; sourceTree = ""; }; 58 | 34C946F218D68F6500F7C23F /* MCFireworksButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCFireworksButton.h; path = ../../MCFireworksButton/MCFireworksButton.h; sourceTree = ""; }; 59 | 34C946F318D68F6500F7C23F /* MCFireworksButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MCFireworksButton.m; path = ../../MCFireworksButton/MCFireworksButton.m; sourceTree = ""; }; 60 | 34C946F418D68F6500F7C23F /* MCFireworksView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MCFireworksView.h; path = ../../MCFireworksButton/MCFireworksView.h; sourceTree = ""; }; 61 | 34C946F518D68F6500F7C23F /* MCFireworksView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MCFireworksView.m; path = ../../MCFireworksButton/MCFireworksView.m; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 34B2D87F18D68B3C0089F6A4 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 34B2D88818D68B3C0089F6A4 /* CoreGraphics.framework in Frameworks */, 70 | 34B2D88A18D68B3C0089F6A4 /* UIKit.framework in Frameworks */, 71 | 34B2D88618D68B3C0089F6A4 /* Foundation.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 34B2D8A018D68B3C0089F6A4 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 34B2D8A518D68B3C0089F6A4 /* XCTest.framework in Frameworks */, 80 | 34B2D8A718D68B3C0089F6A4 /* UIKit.framework in Frameworks */, 81 | 34B2D8A618D68B3C0089F6A4 /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 34B2D87918D68B3C0089F6A4 = { 89 | isa = PBXGroup; 90 | children = ( 91 | 34B2D88B18D68B3C0089F6A4 /* MCFireworksButtonDemo */, 92 | 34B2D8AA18D68B3C0089F6A4 /* MCFireworksButtonDemoTests */, 93 | 34B2D88418D68B3C0089F6A4 /* Frameworks */, 94 | 34B2D88318D68B3C0089F6A4 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 34B2D88318D68B3C0089F6A4 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 34B2D88218D68B3C0089F6A4 /* MCFireworksButtonDemo.app */, 102 | 34B2D8A318D68B3C0089F6A4 /* MCFireworksButtonDemoTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 34B2D88418D68B3C0089F6A4 /* Frameworks */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 34B2D88518D68B3C0089F6A4 /* Foundation.framework */, 111 | 34B2D88718D68B3C0089F6A4 /* CoreGraphics.framework */, 112 | 34B2D88918D68B3C0089F6A4 /* UIKit.framework */, 113 | 34B2D8A418D68B3C0089F6A4 /* XCTest.framework */, 114 | ); 115 | name = Frameworks; 116 | sourceTree = ""; 117 | }; 118 | 34B2D88B18D68B3C0089F6A4 /* MCFireworksButtonDemo */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 34B2D8C218D68B620089F6A4 /* MCFireworksButton */, 122 | 34B2D8BB18D68B4D0089F6A4 /* App Delegate */, 123 | 34B2D8BA18D68B450089F6A4 /* View Controllers */, 124 | 34B2D89D18D68B3C0089F6A4 /* Images.xcassets */, 125 | 34B2D88C18D68B3C0089F6A4 /* Supporting Files */, 126 | ); 127 | path = MCFireworksButtonDemo; 128 | sourceTree = ""; 129 | }; 130 | 34B2D88C18D68B3C0089F6A4 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 34B2D88D18D68B3C0089F6A4 /* MCFireworksButtonDemo-Info.plist */, 134 | 34B2D88E18D68B3C0089F6A4 /* InfoPlist.strings */, 135 | 34B2D89118D68B3C0089F6A4 /* main.m */, 136 | 34B2D89318D68B3C0089F6A4 /* MCFireworksButtonDemo-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 34B2D8AA18D68B3C0089F6A4 /* MCFireworksButtonDemoTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 34B2D8B018D68B3C0089F6A4 /* MCFireworksButtonDemoTests.m */, 145 | 34B2D8AB18D68B3C0089F6A4 /* Supporting Files */, 146 | ); 147 | path = MCFireworksButtonDemoTests; 148 | sourceTree = ""; 149 | }; 150 | 34B2D8AB18D68B3C0089F6A4 /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 34B2D8AC18D68B3C0089F6A4 /* MCFireworksButtonDemoTests-Info.plist */, 154 | 34B2D8AD18D68B3C0089F6A4 /* InfoPlist.strings */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 34B2D8BA18D68B450089F6A4 /* View Controllers */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 34B2D89718D68B3C0089F6A4 /* Main.storyboard */, 163 | 34B2D89A18D68B3C0089F6A4 /* MCViewController.h */, 164 | 34B2D89B18D68B3C0089F6A4 /* MCViewController.m */, 165 | ); 166 | name = "View Controllers"; 167 | sourceTree = ""; 168 | }; 169 | 34B2D8BB18D68B4D0089F6A4 /* App Delegate */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 34B2D89418D68B3C0089F6A4 /* MCAppDelegate.h */, 173 | 34B2D89518D68B3C0089F6A4 /* MCAppDelegate.m */, 174 | ); 175 | name = "App Delegate"; 176 | sourceTree = ""; 177 | }; 178 | 34B2D8C218D68B620089F6A4 /* MCFireworksButton */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 34C946F218D68F6500F7C23F /* MCFireworksButton.h */, 182 | 34C946F318D68F6500F7C23F /* MCFireworksButton.m */, 183 | 34C946F418D68F6500F7C23F /* MCFireworksView.h */, 184 | 34C946F518D68F6500F7C23F /* MCFireworksView.m */, 185 | ); 186 | name = MCFireworksButton; 187 | sourceTree = ""; 188 | }; 189 | /* End PBXGroup section */ 190 | 191 | /* Begin PBXNativeTarget section */ 192 | 34B2D88118D68B3C0089F6A4 /* MCFireworksButtonDemo */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 34B2D8B418D68B3C0089F6A4 /* Build configuration list for PBXNativeTarget "MCFireworksButtonDemo" */; 195 | buildPhases = ( 196 | 34B2D87E18D68B3C0089F6A4 /* Sources */, 197 | 34B2D87F18D68B3C0089F6A4 /* Frameworks */, 198 | 34B2D88018D68B3C0089F6A4 /* Resources */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | ); 204 | name = MCFireworksButtonDemo; 205 | productName = MCFireworksButtonDemo; 206 | productReference = 34B2D88218D68B3C0089F6A4 /* MCFireworksButtonDemo.app */; 207 | productType = "com.apple.product-type.application"; 208 | }; 209 | 34B2D8A218D68B3C0089F6A4 /* MCFireworksButtonDemoTests */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = 34B2D8B718D68B3C0089F6A4 /* Build configuration list for PBXNativeTarget "MCFireworksButtonDemoTests" */; 212 | buildPhases = ( 213 | 34B2D89F18D68B3C0089F6A4 /* Sources */, 214 | 34B2D8A018D68B3C0089F6A4 /* Frameworks */, 215 | 34B2D8A118D68B3C0089F6A4 /* Resources */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | 34B2D8A918D68B3C0089F6A4 /* PBXTargetDependency */, 221 | ); 222 | name = MCFireworksButtonDemoTests; 223 | productName = MCFireworksButtonDemoTests; 224 | productReference = 34B2D8A318D68B3C0089F6A4 /* MCFireworksButtonDemoTests.xctest */; 225 | productType = "com.apple.product-type.bundle.unit-test"; 226 | }; 227 | /* End PBXNativeTarget section */ 228 | 229 | /* Begin PBXProject section */ 230 | 34B2D87A18D68B3C0089F6A4 /* Project object */ = { 231 | isa = PBXProject; 232 | attributes = { 233 | CLASSPREFIX = MC; 234 | LastUpgradeCheck = 0510; 235 | ORGANIZATIONNAME = "Matthew Cheok"; 236 | TargetAttributes = { 237 | 34B2D8A218D68B3C0089F6A4 = { 238 | TestTargetID = 34B2D88118D68B3C0089F6A4; 239 | }; 240 | }; 241 | }; 242 | buildConfigurationList = 34B2D87D18D68B3C0089F6A4 /* Build configuration list for PBXProject "MCFireworksButtonDemo" */; 243 | compatibilityVersion = "Xcode 3.2"; 244 | developmentRegion = English; 245 | hasScannedForEncodings = 0; 246 | knownRegions = ( 247 | en, 248 | Base, 249 | ); 250 | mainGroup = 34B2D87918D68B3C0089F6A4; 251 | productRefGroup = 34B2D88318D68B3C0089F6A4 /* Products */; 252 | projectDirPath = ""; 253 | projectRoot = ""; 254 | targets = ( 255 | 34B2D88118D68B3C0089F6A4 /* MCFireworksButtonDemo */, 256 | 34B2D8A218D68B3C0089F6A4 /* MCFireworksButtonDemoTests */, 257 | ); 258 | }; 259 | /* End PBXProject section */ 260 | 261 | /* Begin PBXResourcesBuildPhase section */ 262 | 34B2D88018D68B3C0089F6A4 /* Resources */ = { 263 | isa = PBXResourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | 34B2D89E18D68B3C0089F6A4 /* Images.xcassets in Resources */, 267 | 34B2D89018D68B3C0089F6A4 /* InfoPlist.strings in Resources */, 268 | 34B2D89918D68B3C0089F6A4 /* Main.storyboard in Resources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | 34B2D8A118D68B3C0089F6A4 /* Resources */ = { 273 | isa = PBXResourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | 34B2D8AF18D68B3C0089F6A4 /* InfoPlist.strings in Resources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXResourcesBuildPhase section */ 281 | 282 | /* Begin PBXSourcesBuildPhase section */ 283 | 34B2D87E18D68B3C0089F6A4 /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 34C946F718D68F6500F7C23F /* MCFireworksView.m in Sources */, 288 | 34B2D89618D68B3C0089F6A4 /* MCAppDelegate.m in Sources */, 289 | 34B2D89C18D68B3C0089F6A4 /* MCViewController.m in Sources */, 290 | 34C946F618D68F6500F7C23F /* MCFireworksButton.m in Sources */, 291 | 34B2D89218D68B3C0089F6A4 /* main.m in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | 34B2D89F18D68B3C0089F6A4 /* Sources */ = { 296 | isa = PBXSourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 34B2D8B118D68B3C0089F6A4 /* MCFireworksButtonDemoTests.m in Sources */, 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXSourcesBuildPhase section */ 304 | 305 | /* Begin PBXTargetDependency section */ 306 | 34B2D8A918D68B3C0089F6A4 /* PBXTargetDependency */ = { 307 | isa = PBXTargetDependency; 308 | target = 34B2D88118D68B3C0089F6A4 /* MCFireworksButtonDemo */; 309 | targetProxy = 34B2D8A818D68B3C0089F6A4 /* PBXContainerItemProxy */; 310 | }; 311 | /* End PBXTargetDependency section */ 312 | 313 | /* Begin PBXVariantGroup section */ 314 | 34B2D88E18D68B3C0089F6A4 /* InfoPlist.strings */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 34B2D88F18D68B3C0089F6A4 /* en */, 318 | ); 319 | name = InfoPlist.strings; 320 | sourceTree = ""; 321 | }; 322 | 34B2D89718D68B3C0089F6A4 /* Main.storyboard */ = { 323 | isa = PBXVariantGroup; 324 | children = ( 325 | 34B2D89818D68B3C0089F6A4 /* Base */, 326 | ); 327 | name = Main.storyboard; 328 | sourceTree = ""; 329 | }; 330 | 34B2D8AD18D68B3C0089F6A4 /* InfoPlist.strings */ = { 331 | isa = PBXVariantGroup; 332 | children = ( 333 | 34B2D8AE18D68B3C0089F6A4 /* en */, 334 | ); 335 | name = InfoPlist.strings; 336 | sourceTree = ""; 337 | }; 338 | /* End PBXVariantGroup section */ 339 | 340 | /* Begin XCBuildConfiguration section */ 341 | 34B2D8B218D68B3C0089F6A4 /* Debug */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ALWAYS_SEARCH_USER_PATHS = NO; 345 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 346 | CLANG_CXX_LIBRARY = "libc++"; 347 | CLANG_ENABLE_MODULES = YES; 348 | CLANG_ENABLE_OBJC_ARC = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_CONSTANT_CONVERSION = YES; 351 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 352 | CLANG_WARN_EMPTY_BODY = YES; 353 | CLANG_WARN_ENUM_CONVERSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_OPTIMIZATION_LEVEL = 0; 362 | GCC_PREPROCESSOR_DEFINITIONS = ( 363 | "DEBUG=1", 364 | "$(inherited)", 365 | ); 366 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 374 | ONLY_ACTIVE_ARCH = YES; 375 | SDKROOT = iphoneos; 376 | }; 377 | name = Debug; 378 | }; 379 | 34B2D8B318D68B3C0089F6A4 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_MODULES = YES; 386 | CLANG_ENABLE_OBJC_ARC = YES; 387 | CLANG_WARN_BOOL_CONVERSION = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 390 | CLANG_WARN_EMPTY_BODY = YES; 391 | CLANG_WARN_ENUM_CONVERSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 396 | COPY_PHASE_STRIP = YES; 397 | ENABLE_NS_ASSERTIONS = NO; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 401 | GCC_WARN_UNDECLARED_SELECTOR = YES; 402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 403 | GCC_WARN_UNUSED_FUNCTION = YES; 404 | GCC_WARN_UNUSED_VARIABLE = YES; 405 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 406 | SDKROOT = iphoneos; 407 | VALIDATE_PRODUCT = YES; 408 | }; 409 | name = Release; 410 | }; 411 | 34B2D8B518D68B3C0089F6A4 /* Debug */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 415 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 416 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 417 | GCC_PREFIX_HEADER = "MCFireworksButtonDemo/MCFireworksButtonDemo-Prefix.pch"; 418 | INFOPLIST_FILE = "MCFireworksButtonDemo/MCFireworksButtonDemo-Info.plist"; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | WRAPPER_EXTENSION = app; 421 | }; 422 | name = Debug; 423 | }; 424 | 34B2D8B618D68B3C0089F6A4 /* Release */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 428 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 429 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 430 | GCC_PREFIX_HEADER = "MCFireworksButtonDemo/MCFireworksButtonDemo-Prefix.pch"; 431 | INFOPLIST_FILE = "MCFireworksButtonDemo/MCFireworksButtonDemo-Info.plist"; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | WRAPPER_EXTENSION = app; 434 | }; 435 | name = Release; 436 | }; 437 | 34B2D8B818D68B3C0089F6A4 /* Debug */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MCFireworksButtonDemo.app/MCFireworksButtonDemo"; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(SDKROOT)/Developer/Library/Frameworks", 443 | "$(inherited)", 444 | "$(DEVELOPER_FRAMEWORKS_DIR)", 445 | ); 446 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 447 | GCC_PREFIX_HEADER = "MCFireworksButtonDemo/MCFireworksButtonDemo-Prefix.pch"; 448 | GCC_PREPROCESSOR_DEFINITIONS = ( 449 | "DEBUG=1", 450 | "$(inherited)", 451 | ); 452 | INFOPLIST_FILE = "MCFireworksButtonDemoTests/MCFireworksButtonDemoTests-Info.plist"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TEST_HOST = "$(BUNDLE_LOADER)"; 455 | WRAPPER_EXTENSION = xctest; 456 | }; 457 | name = Debug; 458 | }; 459 | 34B2D8B918D68B3C0089F6A4 /* Release */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MCFireworksButtonDemo.app/MCFireworksButtonDemo"; 463 | FRAMEWORK_SEARCH_PATHS = ( 464 | "$(SDKROOT)/Developer/Library/Frameworks", 465 | "$(inherited)", 466 | "$(DEVELOPER_FRAMEWORKS_DIR)", 467 | ); 468 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 469 | GCC_PREFIX_HEADER = "MCFireworksButtonDemo/MCFireworksButtonDemo-Prefix.pch"; 470 | INFOPLIST_FILE = "MCFireworksButtonDemoTests/MCFireworksButtonDemoTests-Info.plist"; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUNDLE_LOADER)"; 473 | WRAPPER_EXTENSION = xctest; 474 | }; 475 | name = Release; 476 | }; 477 | /* End XCBuildConfiguration section */ 478 | 479 | /* Begin XCConfigurationList section */ 480 | 34B2D87D18D68B3C0089F6A4 /* Build configuration list for PBXProject "MCFireworksButtonDemo" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 34B2D8B218D68B3C0089F6A4 /* Debug */, 484 | 34B2D8B318D68B3C0089F6A4 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 34B2D8B418D68B3C0089F6A4 /* Build configuration list for PBXNativeTarget "MCFireworksButtonDemo" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 34B2D8B518D68B3C0089F6A4 /* Debug */, 493 | 34B2D8B618D68B3C0089F6A4 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 34B2D8B718D68B3C0089F6A4 /* Build configuration list for PBXNativeTarget "MCFireworksButtonDemoTests" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 34B2D8B818D68B3C0089F6A4 /* Debug */, 502 | 34B2D8B918D68B3C0089F6A4 /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | /* End XCConfigurationList section */ 508 | }; 509 | rootObject = 34B2D87A18D68B3C0089F6A4 /* Project object */; 510 | } 511 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/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 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/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 | } -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/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 | } -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like-Blue.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Like-Blue@2x.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like-Blue.imageset/Like-Blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewcheok/MCFireworksButton/649b564d36d35cf6320ce128358f9cdf5f5577d4/MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like-Blue.imageset/Like-Blue@2x.png -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Like@2x.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like.imageset/Like@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewcheok/MCFireworksButton/649b564d36d35cf6320ce128358f9cdf5f5577d4/MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Like.imageset/Like@2x.png -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Sparkle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Sparkle.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Sparkle.imageset/Sparkle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewcheok/MCFireworksButton/649b564d36d35cf6320ce128358f9cdf5f5577d4/MCFireworksButtonDemo/MCFireworksButtonDemo/Images.xcassets/Sparkle.imageset/Sparkle.png -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCAppDelegate.h 3 | // MCFireworksButtonDemo 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MCAppDelegate.m 3 | // MCFireworksButtonDemo 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import "MCAppDelegate.h" 10 | 11 | @implementation MCAppDelegate 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 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCFireworksButtonDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.matthewcheok.${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 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCFireworksButtonDemo-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 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCViewController.h 3 | // MCFireworksButtonDemo 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MCViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/MCViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MCViewController.m 3 | // MCFireworksButtonDemo 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import "MCViewController.h" 10 | #import "MCFireworksButton.h" 11 | 12 | @interface MCViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet MCFireworksButton *likeButton; 15 | 16 | @end 17 | 18 | @implementation MCViewController { 19 | BOOL _selected; 20 | } 21 | 22 | - (IBAction)handleButtonPress:(id)sender { 23 | _selected = !_selected; 24 | if (_selected) { 25 | [self.likeButton popOutsideWithDuration:0.5]; 26 | [self.likeButton setImage:[UIImage imageNamed:@"Like-Blue"] forState:UIControlStateNormal]; 27 | [self.likeButton animate]; 28 | } 29 | else { 30 | [self.likeButton popInsideWithDuration:0.4]; 31 | [self.likeButton setImage:[UIImage imageNamed:@"Like"] forState:UIControlStateNormal]; 32 | } 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | 39 | self.likeButton.particleImage = [UIImage imageNamed:@"Sparkle"]; 40 | self.likeButton.particleScale = 0.05; 41 | self.likeButton.particleScaleRange = 0.02; 42 | } 43 | 44 | - (void)didReceiveMemoryWarning { 45 | [super didReceiveMemoryWarning]; 46 | // Dispose of any resources that can be recreated. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MCFireworksButtonDemo 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MCAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MCAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemoTests/MCFireworksButtonDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.matthewcheok.${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 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemoTests/MCFireworksButtonDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MCFireworksButtonDemoTests.m 3 | // MCFireworksButtonDemoTests 4 | // 5 | // Created by Matthew Cheok on 17/3/14. 6 | // Copyright (c) 2014 Matthew Cheok. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MCFireworksButtonDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MCFireworksButtonDemoTests 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 | -------------------------------------------------------------------------------- /MCFireworksButtonDemo/MCFireworksButtonDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MCFireworksButton ![License MIT](https://go-shields.herokuapp.com/license-MIT-blue.png) 2 | ================= 3 | 4 | [![Badge w/ Version](https://cocoapod-badges.herokuapp.com/v/MCFireworksButton/badge.png)](https://github.com/matthewcheok/MCFireworksButton) 5 | [![Badge w/ Platform](https://cocoapod-badges.herokuapp.com/p/MCFireworksButton/badge.svg)](https://github.com/matthewcheok/MCFireworksButton) 6 | 7 | Drop-in button control with with particle effects similar to the Like button in Facebook Paper. 8 | 9 | 10 | ##Screenshot 11 | ![Screenshot](https://raw.github.com/matthewcheok/MCFireworksButton/master/screenshot.gif "Example of MCFireworksButton") 12 | 13 | ## Installation 14 | 15 | Add the following to your [CocoaPods](http://cocoapods.org/) Podfile 16 | 17 | pod 'MCFireworksButton' 18 | 19 | or clone as a git submodule, 20 | 21 | or just copy files in the ```MCFireworksButton``` folder into your project. 22 | 23 | ## Using MCFireworksButton 24 | 25 | Simply call methods `-animate` to begin the particle effect. 26 | 27 | [self.likeButton animate]; 28 | 29 | Some basic bounce animations are included for convenience. 30 | 31 | [self.likeButton popInsideWithDuration:0.4]; 32 | 33 | or 34 | 35 | [self.likeButton popOutsideWithDuration:0.5]; 36 | 37 | ## Configuration 38 | 39 | You can specify the particle texture and scales to be used in the particle effect: 40 | 41 | self.likeButton.particleImage = [UIImage imageNamed:@"Sparkle"]; 42 | self.likeButton.particleScale = 0.05; 43 | self.likeButton.particleScaleRange = 0.02; 44 | 45 | Alternatively you can use `MCFireworksView` directly if you don't need UIButton functionality. 46 | 47 | ## License 48 | 49 | MCFireworksButton is under the MIT license. 50 | -------------------------------------------------------------------------------- /screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthewcheok/MCFireworksButton/649b564d36d35cf6320ce128358f9cdf5f5577d4/screenshot.gif --------------------------------------------------------------------------------