├── .gitignore ├── Documentation └── Images │ ├── demo.gif │ ├── screenshot.png │ └── use-with-storyboard.png ├── LICENSE ├── MyPlayground.playground ├── Contents.swift ├── Sources │ └── SupportCode.swift ├── contents.xcplayground └── timeline.xctimeline ├── README.md ├── SWFrameButton.podspec ├── SWFrameButton ├── SWFrameButton.h └── SWFrameButton.m └── SWFrameButtonExample ├── SWFrameButtonExample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── SWFrameButtonExample ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── iphone5.imageset │ │ ├── Contents.json │ │ └── iphone5.png │ └── magic.imageset │ │ ├── 873-magic-wand.png │ │ ├── 873-magic-wand@2x.png │ │ └── Contents.json ├── LaunchScreen.storyboard ├── SWAppDelegate.h ├── SWAppDelegate.m ├── SWFrameButtonExample-Info.plist ├── SWFrameButtonExample-Prefix.pch ├── SWSecondViewController.h ├── SWSecondViewController.m ├── SWTableViewCell.h ├── SWTableViewCell.m ├── SWTableViewController.h ├── SWTableViewController.m ├── SWViewController.h ├── SWViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m └── SWFrameButtonExampleTests ├── SWFrameButtonExampleTests-Info.plist ├── SWFrameButtonExampleTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 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 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | Pods/ -------------------------------------------------------------------------------- /Documentation/Images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/Documentation/Images/demo.gif -------------------------------------------------------------------------------- /Documentation/Images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/Documentation/Images/screenshot.png -------------------------------------------------------------------------------- /Documentation/Images/use-with-storyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/Documentation/Images/use-with-storyboard.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Sarun Wongpatcharapakorn 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. -------------------------------------------------------------------------------- /MyPlayground.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | //: Playground - noun: a place where people can play 2 | 3 | import UIKit 4 | 5 | var str = "Hello, playground" 6 | 7 | let size = CGSize(width: 100, height: 100) 8 | let rect = CGRect(x: 0, y: 0, width: 100, height: 100) 9 | UIGraphicsBeginImageContextWithOptions(size, false, 0) 10 | let context = UIGraphicsGetCurrentContext() 11 | let path = UIBezierPath(roundedRect: rect, cornerRadius: 10) 12 | CGContextSetFillColorWithColor(context, UIColor.redColor().CGColor) 13 | path.fill() 14 | let image = UIGraphicsGetImageFromCurrentImageContext() 15 | -------------------------------------------------------------------------------- /MyPlayground.playground/Sources/SupportCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // This file (and all other Swift source files in the Sources directory of this playground) will be precompiled into a framework which is automatically made available to MyPlayground.playground. 3 | // 4 | -------------------------------------------------------------------------------- /MyPlayground.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MyPlayground.playground/timeline.xctimeline: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SWFrameButton 2 | 3 | This UIButton subclass replicate single line border button see in iOS 7 App Store. 4 | 5 | ![Screenshot](/Documentation/Images/demo.gif) 6 | 7 | ## Installation 8 | 9 | SWFrameButton is available through [CocoaPods](http://cocoapods.org). To install 10 | it, simply add the following line to your Podfile: 11 | 12 | pod "SWFrameButton" 13 | 14 | You may also quickly try the SWFrameButton example project with 15 | 16 | pod try SWFrameButton 17 | 18 | ## Requirements 19 | 20 | Requires iOS 7.0+ and ARC. 21 | 22 | ## Usage 23 | 24 | SWFrameButton design to use `tintColor` to determine its color, so try to avoid set text color by `setTitleColor:forState:` it won't break your button, but may raise inconsistent highlighted/selected color state. `Text Color` property in Interface Builder will be ignore for this reason, use `Tint` property in view section instead. 25 | 26 | Basic usage 27 | ```objective-c 28 | SWFrameButton *button = [[SWFrameButton alloc] init]; 29 | [button setTitle:@"Green Tint Button" forState:UIControlStateNormal]; 30 | [button sizeToFit]; 31 | button.tintColor = [UIColor greenColor]; 32 | ``` 33 | 34 | If you use Interface Builder, add a UIBUtton to your interface and set Class to `SWFrameButton`. 35 | 36 | ![Use with storyboard](/Documentation/Images/use-with-storyboard.png) 37 | 38 | ### Customization 39 | You can use customize SWFrameButton using UIAppearance 40 | ```objective-c 41 | [[SWFrameButton appearance] setTintColor:[UIColor orangeColor]]; 42 | [[SWFrameButton appearance] setBorderWidth:1]; 43 | [[SWFrameButton appearance] setCornerRadius:10]; 44 | ``` 45 | or set individual button style via property 46 | ```objective-c 47 | SWFrameButton *button = [[SWFrameButton alloc] init]; 48 | button.tintColor = [UIColor orangeColor]; 49 | button.borderWidth = 1; 50 | button.cornerRadius = 10; 51 | ``` 52 | 53 | ## Author 54 | 55 | [Sarun Wongpatcharapakorn](https://github.com/sarunw) ([@sarunw](https://twitter.com/sarunw)) 56 | 57 | ## License 58 | 59 | SWFrameButton is available under the MIT license. See the LICENSE file for more info. 60 | -------------------------------------------------------------------------------- /SWFrameButton.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SWFrameButton" 3 | s.version = "1.2.2" 4 | s.summary = "iOS7 UIButton with border" 5 | s.homepage = "https://github.com/sarunw/SWFrameButton" 6 | s.license = 'MIT' 7 | s.author = { "Sarun Wongpatcharapakorn" => "artwork.th@gmail.com" } 8 | s.source = { :git => "https://github.com/sarunw/SWFrameButton.git", :tag => s.version.to_s } 9 | s.platform = :ios, '7.0' 10 | s.requires_arc = true 11 | s.source_files = 'SWFrameButton/*.{h,m}' 12 | s.frameworks = 'QuartzCore' 13 | end 14 | -------------------------------------------------------------------------------- /SWFrameButton/SWFrameButton.h: -------------------------------------------------------------------------------- 1 | // SWFrameButton.h 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface SWFrameButton : UIButton 26 | 27 | @property (nonatomic, assign) IBInspectable CGFloat cornerRadius; //UI_APPEARANCE_SELECTOR; 28 | @property (nonatomic, assign) IBInspectable CGFloat borderWidth; //UI_APPEARANCE_SELECTOR; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /SWFrameButton/SWFrameButton.m: -------------------------------------------------------------------------------- 1 | // SWFrameButton.m 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import "SWFrameButton.h" 24 | #import 25 | 26 | static CGFloat const SWDefaultFontSize = 15.0; 27 | static CGFloat const SWCornerRadius = 4.0; 28 | static CGFloat const SWBorderWidth = 1.0; 29 | static CGFloat const SWAnimationDuration = 0.25; 30 | static CGFloat const SWAppleTouchableGuidelineDimension = 44; 31 | static UIEdgeInsets const SWContentEdgeInsets = {5, 10, 5, 10}; 32 | 33 | @interface SWFrameButton () 34 | 35 | @property (nonatomic, strong) UIImageView *backgroundImageView; 36 | @property (nonatomic, assign) BOOL disableAnimation; 37 | 38 | @end 39 | 40 | @implementation SWFrameButton 41 | 42 | - (id)initWithFrame:(CGRect)frame 43 | { 44 | self = [super initWithFrame:frame]; 45 | if (self) { 46 | [self commonInit]; 47 | [self commonSetup]; 48 | 49 | // Set default font when init in code 50 | [self.titleLabel setFont:[UIFont systemFontOfSize:SWDefaultFontSize]]; 51 | } 52 | return self; 53 | } 54 | 55 | - (id)initWithCoder:(NSCoder *)aDecoder 56 | { 57 | self = [super initWithCoder:aDecoder]; 58 | if (self) { 59 | [self commonInit]; 60 | [self commonSetup]; 61 | } 62 | 63 | return self; 64 | } 65 | 66 | 67 | - (void)commonSetup 68 | { 69 | self.adjustsImageWhenHighlighted = NO; 70 | self.layer.cornerRadius = self.cornerRadius; 71 | self.layer.borderWidth = self.borderWidth; 72 | self.layer.borderColor = self.tintColor.CGColor; 73 | [self setContentEdgeInsets:SWContentEdgeInsets]; 74 | [self setTitleColor:self.tintColor forState:UIControlStateNormal]; 75 | self.backgroundImageView = [[UIImageView alloc] initWithFrame:self.bounds]; 76 | self.backgroundImageView.alpha = 0; 77 | self.backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 78 | [self insertSubview:self.backgroundImageView atIndex:0]; 79 | 80 | // HAX: solve image not alpha when set in storyboard 81 | self.selected = self.selected; 82 | } 83 | 84 | 85 | - (void)commonInit 86 | { 87 | _cornerRadius = SWCornerRadius; 88 | _borderWidth = SWBorderWidth; 89 | } 90 | 91 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event 92 | { 93 | CGSize buttonSize = self.bounds.size; 94 | CGFloat widthToAdd = MAX(SWAppleTouchableGuidelineDimension - buttonSize.width, 0); 95 | CGFloat heightToAdd = MAX(SWAppleTouchableGuidelineDimension - buttonSize.height, 0); 96 | CGRect newFrame = CGRectInset(self.bounds, -widthToAdd, -heightToAdd); 97 | 98 | return CGRectContainsPoint(newFrame, point); 99 | } 100 | 101 | #pragma mark - Custom Accessors 102 | 103 | - (void)setHighlighted:(BOOL)highlighted 104 | { 105 | [super setHighlighted:highlighted]; 106 | 107 | if (self.disableAnimation) { 108 | return; 109 | } 110 | 111 | if (self.selected) { 112 | if (self.highlighted) { 113 | self.backgroundImageView.alpha = 0.5; 114 | self.titleLabel.alpha = 0; 115 | self.imageView.alpha = 0; 116 | self.imageView.tintColor = [UIColor clearColor]; 117 | self.layer.borderColor = [UIColor clearColor].CGColor; 118 | } else { 119 | self.backgroundImageView.alpha = 1; 120 | self.titleLabel.alpha = 0; 121 | self.imageView.alpha = 0; 122 | self.imageView.tintColor = [UIColor clearColor]; 123 | } 124 | } else { 125 | [UIView animateWithDuration:SWAnimationDuration animations:^{ 126 | if (highlighted) { 127 | 128 | self.backgroundImageView.alpha = 1; 129 | self.titleLabel.alpha = 0; 130 | self.imageView.alpha = 0; 131 | self.imageView.tintColor = [UIColor clearColor]; 132 | } else { 133 | self.layer.borderColor = self.tintColor.CGColor; 134 | self.backgroundImageView.alpha = 0; 135 | self.titleLabel.alpha = 1; 136 | self.imageView.alpha = 1; 137 | self.imageView.tintColor = self.tintColor; 138 | } 139 | }]; 140 | } 141 | } 142 | 143 | - (void)setSelected:(BOOL)selected 144 | { 145 | [super setSelected:selected]; 146 | 147 | if (self.disableAnimation) { 148 | return; 149 | } 150 | 151 | if (self.highlighted) { 152 | // selected by user interaction 153 | if (selected) { 154 | self.backgroundImageView.alpha = 1; 155 | self.titleLabel.alpha = 0; 156 | self.imageView.alpha = 0; 157 | self.imageView.tintColor = [UIColor clearColor]; 158 | } else { 159 | // Leave this to unhighlighted 160 | } 161 | } else { 162 | if (selected) { 163 | self.backgroundImageView.alpha = 1; 164 | self.titleLabel.alpha = 0; 165 | self.imageView.alpha = 0; 166 | self.imageView.tintColor = [UIColor clearColor]; 167 | } else { 168 | self.layer.borderColor = self.tintColor.CGColor; 169 | self.backgroundImageView.alpha = 0; 170 | self.titleLabel.alpha = 1; 171 | self.imageView.alpha = 1; 172 | self.imageView.tintColor = self.tintColor; 173 | } 174 | } 175 | } 176 | 177 | - (void)tintColorDidChange 178 | { 179 | self.layer.borderColor = self.tintColor.CGColor; 180 | [self setTitleColor:self.tintColor forState:UIControlStateNormal]; 181 | [self updateBackgroundImageView]; 182 | 183 | if (self.selected == NO) { 184 | self.imageView.tintColor = self.tintColor; 185 | } 186 | } 187 | 188 | - (void)setTitle:(NSString *)title forState:(UIControlState)state { 189 | [super setTitle:title forState:state]; 190 | 191 | self.disableAnimation = YES; 192 | self.selected = YES; 193 | self.selected = NO; 194 | self.disableAnimation = NO; 195 | 196 | [self updateBackgroundImageView]; 197 | } 198 | 199 | - (void)setImage:(UIImage *)image forState:(UIControlState)state { 200 | [super setImage:image forState:state]; 201 | 202 | self.disableAnimation = YES; 203 | self.selected = YES; 204 | self.selected = NO; 205 | self.disableAnimation = NO; 206 | 207 | [self updateBackgroundImageView]; 208 | } 209 | 210 | - (void) updateBackgroundImageView { 211 | self.backgroundImageView.image = [self sw_backgroundImage]; 212 | } 213 | 214 | 215 | #pragma mark - Properties 216 | 217 | - (void)setCornerRadius:(CGFloat)cornerRadius 218 | { 219 | _cornerRadius = cornerRadius; 220 | 221 | self.layer.cornerRadius = cornerRadius; 222 | } 223 | 224 | - (void)setBorderWidth:(CGFloat)borderWidth 225 | { 226 | _borderWidth = borderWidth; 227 | 228 | self.layer.borderWidth = borderWidth; 229 | } 230 | 231 | - (void)setHighlightedTintColor:(UIColor *)color 232 | { 233 | [self setTitleColor:color forState:UIControlStateHighlighted]; 234 | [self setTitleColor:color forState:UIControlStateSelected]; 235 | [self setTitleColor:color forState:UIControlStateSelected|UIControlStateHighlighted]; 236 | 237 | } 238 | 239 | - (void)setEnabled:(BOOL)enabled { 240 | [super setEnabled:enabled]; 241 | 242 | if (enabled) { 243 | self.tintAdjustmentMode = UIViewTintAdjustmentModeAutomatic; 244 | } else { 245 | self.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed; 246 | } 247 | } 248 | 249 | 250 | 251 | #pragma mark - helper 252 | 253 | - (void)layoutSubviews { 254 | [super layoutSubviews]; 255 | 256 | self.backgroundImageView.image = [self sw_backgroundImage]; 257 | } 258 | 259 | - (UIImage *)sw_backgroundImage { 260 | CGRect rect = self.bounds; 261 | UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); 262 | CGContextRef context = UIGraphicsGetCurrentContext(); 263 | 264 | NSString *textSelectedState = [self titleForState:UIControlStateSelected]; 265 | UIImage *imageSelectedState = [self imageForState:UIControlStateSelected]; 266 | 267 | NSRange range = NSMakeRange(0, textSelectedState.length); 268 | 269 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:self.cornerRadius]; 270 | CGContextSetFillColorWithColor(context, self.tintColor.CGColor); 271 | [path fill]; 272 | NSAttributedString *attributedString = self.titleLabel.attributedText; 273 | 274 | NSDictionary *dict = [attributedString attributesAtIndex:0 effectiveRange:&range]; 275 | 276 | CGContextSetBlendMode(context, kCGBlendModeDestinationOut); 277 | 278 | [textSelectedState drawInRect:self.titleLabel.frame withAttributes:dict]; 279 | 280 | [imageSelectedState drawAtPoint:self.imageView.frame.origin blendMode:kCGBlendModeDestinationOut alpha:1]; 281 | 282 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 283 | UIGraphicsEndImageContext(); 284 | 285 | return image; 286 | } 287 | 288 | @end 289 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A00551C61938497A009FF21A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551C51938497A009FF21A /* Foundation.framework */; }; 11 | A00551C81938497A009FF21A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551C71938497A009FF21A /* CoreGraphics.framework */; }; 12 | A00551CA1938497A009FF21A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551C91938497A009FF21A /* UIKit.framework */; }; 13 | A00551D01938497A009FF21A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A00551CE1938497A009FF21A /* InfoPlist.strings */; }; 14 | A00551D21938497A009FF21A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A00551D11938497A009FF21A /* main.m */; }; 15 | A00551D61938497A009FF21A /* SWAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A00551D51938497A009FF21A /* SWAppDelegate.m */; }; 16 | A00551D91938497A009FF21A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A00551D71938497A009FF21A /* Main.storyboard */; }; 17 | A00551DC1938497A009FF21A /* SWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A00551DB1938497A009FF21A /* SWViewController.m */; }; 18 | A00551DE1938497A009FF21A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A00551DD1938497A009FF21A /* Images.xcassets */; }; 19 | A00551E51938497B009FF21A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551E41938497B009FF21A /* XCTest.framework */; }; 20 | A00551E61938497B009FF21A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551C51938497A009FF21A /* Foundation.framework */; }; 21 | A00551E71938497B009FF21A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A00551C91938497A009FF21A /* UIKit.framework */; }; 22 | A00551EF1938497B009FF21A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A00551ED1938497B009FF21A /* InfoPlist.strings */; }; 23 | A00551F11938497B009FF21A /* SWFrameButtonExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A00551F01938497B009FF21A /* SWFrameButtonExampleTests.m */; }; 24 | A005520119384AAD009FF21A /* SWFrameButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A005520019384AAD009FF21A /* SWFrameButton.m */; }; 25 | A00DF5761C9B3182006F51A2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A00DF5751C9B3182006F51A2 /* LaunchScreen.storyboard */; }; 26 | A0A538201AEEAB7900DF3DE8 /* SWFrameButton.podspec in Resources */ = {isa = PBXBuildFile; fileRef = A0A5381F1AEEAB7900DF3DE8 /* SWFrameButton.podspec */; }; 27 | A0CAF4531AEF391A002FD35D /* SWSecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A0CAF4521AEF391A002FD35D /* SWSecondViewController.m */; }; 28 | A0EDFFB31CC687F600C6A025 /* SWTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A0EDFFB21CC687F600C6A025 /* SWTableViewCell.m */; }; 29 | A0EDFFB61CC6882D00C6A025 /* SWTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A0EDFFB51CC6882D00C6A025 /* SWTableViewController.m */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | A00551E81938497B009FF21A /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = A00551BA1938497A009FF21A /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = A00551C11938497A009FF21A; 38 | remoteInfo = SWFrameButtonExample; 39 | }; 40 | /* End PBXContainerItemProxy section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | A00551C21938497A009FF21A /* SWFrameButtonExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SWFrameButtonExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | A00551C51938497A009FF21A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | A00551C71938497A009FF21A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 46 | A00551C91938497A009FF21A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | A00551CD1938497A009FF21A /* SWFrameButtonExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SWFrameButtonExample-Info.plist"; sourceTree = ""; }; 48 | A00551CF1938497A009FF21A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 49 | A00551D11938497A009FF21A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | A00551D31938497A009FF21A /* SWFrameButtonExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SWFrameButtonExample-Prefix.pch"; sourceTree = ""; }; 51 | A00551D41938497A009FF21A /* SWAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWAppDelegate.h; sourceTree = ""; }; 52 | A00551D51938497A009FF21A /* SWAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWAppDelegate.m; sourceTree = ""; }; 53 | A00551D81938497A009FF21A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | A00551DA1938497A009FF21A /* SWViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWViewController.h; sourceTree = ""; }; 55 | A00551DB1938497A009FF21A /* SWViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWViewController.m; sourceTree = ""; }; 56 | A00551DD1938497A009FF21A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 57 | A00551E31938497B009FF21A /* SWFrameButtonExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SWFrameButtonExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | A00551E41938497B009FF21A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 59 | A00551EC1938497B009FF21A /* SWFrameButtonExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SWFrameButtonExampleTests-Info.plist"; sourceTree = ""; }; 60 | A00551EE1938497B009FF21A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 61 | A00551F01938497B009FF21A /* SWFrameButtonExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWFrameButtonExampleTests.m; sourceTree = ""; }; 62 | A00551FF19384AAD009FF21A /* SWFrameButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWFrameButton.h; sourceTree = ""; }; 63 | A005520019384AAD009FF21A /* SWFrameButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWFrameButton.m; sourceTree = ""; }; 64 | A00DF5751C9B3182006F51A2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 65 | A0A5381F1AEEAB7900DF3DE8 /* SWFrameButton.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SWFrameButton.podspec; path = ../../SWFrameButton.podspec; sourceTree = ""; }; 66 | A0CAF4511AEF391A002FD35D /* SWSecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWSecondViewController.h; sourceTree = ""; }; 67 | A0CAF4521AEF391A002FD35D /* SWSecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWSecondViewController.m; sourceTree = ""; }; 68 | A0E9F8901AEE8DD4007223D2 /* MyPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; name = MyPlayground.playground; path = ../MyPlayground.playground; sourceTree = ""; }; 69 | A0EDFFB11CC687F600C6A025 /* SWTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWTableViewCell.h; sourceTree = ""; }; 70 | A0EDFFB21CC687F600C6A025 /* SWTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWTableViewCell.m; sourceTree = ""; }; 71 | A0EDFFB41CC6882D00C6A025 /* SWTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWTableViewController.h; sourceTree = ""; }; 72 | A0EDFFB51CC6882D00C6A025 /* SWTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWTableViewController.m; sourceTree = ""; }; 73 | /* End PBXFileReference section */ 74 | 75 | /* Begin PBXFrameworksBuildPhase section */ 76 | A00551BF1938497A009FF21A /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | A00551C81938497A009FF21A /* CoreGraphics.framework in Frameworks */, 81 | A00551CA1938497A009FF21A /* UIKit.framework in Frameworks */, 82 | A00551C61938497A009FF21A /* Foundation.framework in Frameworks */, 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | A00551E01938497B009FF21A /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | A00551E51938497B009FF21A /* XCTest.framework in Frameworks */, 91 | A00551E71938497B009FF21A /* UIKit.framework in Frameworks */, 92 | A00551E61938497B009FF21A /* Foundation.framework in Frameworks */, 93 | ); 94 | runOnlyForDeploymentPostprocessing = 0; 95 | }; 96 | /* End PBXFrameworksBuildPhase section */ 97 | 98 | /* Begin PBXGroup section */ 99 | A00551B91938497A009FF21A = { 100 | isa = PBXGroup; 101 | children = ( 102 | A0E9F8901AEE8DD4007223D2 /* MyPlayground.playground */, 103 | A00551CB1938497A009FF21A /* SWFrameButtonExample */, 104 | A00551EA1938497B009FF21A /* SWFrameButtonExampleTests */, 105 | A00551C41938497A009FF21A /* Frameworks */, 106 | A00551C31938497A009FF21A /* Products */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | A00551C31938497A009FF21A /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | A00551C21938497A009FF21A /* SWFrameButtonExample.app */, 114 | A00551E31938497B009FF21A /* SWFrameButtonExampleTests.xctest */, 115 | ); 116 | name = Products; 117 | sourceTree = ""; 118 | }; 119 | A00551C41938497A009FF21A /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | A00551C51938497A009FF21A /* Foundation.framework */, 123 | A00551C71938497A009FF21A /* CoreGraphics.framework */, 124 | A00551C91938497A009FF21A /* UIKit.framework */, 125 | A00551E41938497B009FF21A /* XCTest.framework */, 126 | ); 127 | name = Frameworks; 128 | sourceTree = ""; 129 | }; 130 | A00551CB1938497A009FF21A /* SWFrameButtonExample */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | A0A5381F1AEEAB7900DF3DE8 /* SWFrameButton.podspec */, 134 | A00551FE19384AA5009FF21A /* SWFrameButton */, 135 | A00551D41938497A009FF21A /* SWAppDelegate.h */, 136 | A00551D51938497A009FF21A /* SWAppDelegate.m */, 137 | A00551D71938497A009FF21A /* Main.storyboard */, 138 | A00551DA1938497A009FF21A /* SWViewController.h */, 139 | A00551DB1938497A009FF21A /* SWViewController.m */, 140 | A0EDFFB11CC687F600C6A025 /* SWTableViewCell.h */, 141 | A0EDFFB21CC687F600C6A025 /* SWTableViewCell.m */, 142 | A0CAF4511AEF391A002FD35D /* SWSecondViewController.h */, 143 | A0EDFFB41CC6882D00C6A025 /* SWTableViewController.h */, 144 | A0EDFFB51CC6882D00C6A025 /* SWTableViewController.m */, 145 | A0CAF4521AEF391A002FD35D /* SWSecondViewController.m */, 146 | A00DF5751C9B3182006F51A2 /* LaunchScreen.storyboard */, 147 | A00551DD1938497A009FF21A /* Images.xcassets */, 148 | A00551CC1938497A009FF21A /* Supporting Files */, 149 | ); 150 | path = SWFrameButtonExample; 151 | sourceTree = ""; 152 | }; 153 | A00551CC1938497A009FF21A /* Supporting Files */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | A00551CD1938497A009FF21A /* SWFrameButtonExample-Info.plist */, 157 | A00551CE1938497A009FF21A /* InfoPlist.strings */, 158 | A00551D11938497A009FF21A /* main.m */, 159 | A00551D31938497A009FF21A /* SWFrameButtonExample-Prefix.pch */, 160 | ); 161 | name = "Supporting Files"; 162 | sourceTree = ""; 163 | }; 164 | A00551EA1938497B009FF21A /* SWFrameButtonExampleTests */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | A00551F01938497B009FF21A /* SWFrameButtonExampleTests.m */, 168 | A00551EB1938497B009FF21A /* Supporting Files */, 169 | ); 170 | path = SWFrameButtonExampleTests; 171 | sourceTree = ""; 172 | }; 173 | A00551EB1938497B009FF21A /* Supporting Files */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | A00551EC1938497B009FF21A /* SWFrameButtonExampleTests-Info.plist */, 177 | A00551ED1938497B009FF21A /* InfoPlist.strings */, 178 | ); 179 | name = "Supporting Files"; 180 | sourceTree = ""; 181 | }; 182 | A00551FE19384AA5009FF21A /* SWFrameButton */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | A00551FF19384AAD009FF21A /* SWFrameButton.h */, 186 | A005520019384AAD009FF21A /* SWFrameButton.m */, 187 | ); 188 | name = SWFrameButton; 189 | path = ../../SWFrameButton; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | A00551C11938497A009FF21A /* SWFrameButtonExample */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = A00551F41938497B009FF21A /* Build configuration list for PBXNativeTarget "SWFrameButtonExample" */; 198 | buildPhases = ( 199 | A00551BE1938497A009FF21A /* Sources */, 200 | A00551BF1938497A009FF21A /* Frameworks */, 201 | A00551C01938497A009FF21A /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | ); 207 | name = SWFrameButtonExample; 208 | productName = SWFrameButtonExample; 209 | productReference = A00551C21938497A009FF21A /* SWFrameButtonExample.app */; 210 | productType = "com.apple.product-type.application"; 211 | }; 212 | A00551E21938497B009FF21A /* SWFrameButtonExampleTests */ = { 213 | isa = PBXNativeTarget; 214 | buildConfigurationList = A00551F71938497B009FF21A /* Build configuration list for PBXNativeTarget "SWFrameButtonExampleTests" */; 215 | buildPhases = ( 216 | A00551DF1938497B009FF21A /* Sources */, 217 | A00551E01938497B009FF21A /* Frameworks */, 218 | A00551E11938497B009FF21A /* Resources */, 219 | ); 220 | buildRules = ( 221 | ); 222 | dependencies = ( 223 | A00551E91938497B009FF21A /* PBXTargetDependency */, 224 | ); 225 | name = SWFrameButtonExampleTests; 226 | productName = SWFrameButtonExampleTests; 227 | productReference = A00551E31938497B009FF21A /* SWFrameButtonExampleTests.xctest */; 228 | productType = "com.apple.product-type.bundle.unit-test"; 229 | }; 230 | /* End PBXNativeTarget section */ 231 | 232 | /* Begin PBXProject section */ 233 | A00551BA1938497A009FF21A /* Project object */ = { 234 | isa = PBXProject; 235 | attributes = { 236 | CLASSPREFIX = SW; 237 | LastUpgradeCheck = 0720; 238 | ORGANIZATIONNAME = "Sarun Wongpatcharapakorn"; 239 | TargetAttributes = { 240 | A00551E21938497B009FF21A = { 241 | TestTargetID = A00551C11938497A009FF21A; 242 | }; 243 | }; 244 | }; 245 | buildConfigurationList = A00551BD1938497A009FF21A /* Build configuration list for PBXProject "SWFrameButtonExample" */; 246 | compatibilityVersion = "Xcode 3.2"; 247 | developmentRegion = English; 248 | hasScannedForEncodings = 0; 249 | knownRegions = ( 250 | en, 251 | Base, 252 | ); 253 | mainGroup = A00551B91938497A009FF21A; 254 | productRefGroup = A00551C31938497A009FF21A /* Products */; 255 | projectDirPath = ""; 256 | projectRoot = ""; 257 | targets = ( 258 | A00551C11938497A009FF21A /* SWFrameButtonExample */, 259 | A00551E21938497B009FF21A /* SWFrameButtonExampleTests */, 260 | ); 261 | }; 262 | /* End PBXProject section */ 263 | 264 | /* Begin PBXResourcesBuildPhase section */ 265 | A00551C01938497A009FF21A /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | A00551DE1938497A009FF21A /* Images.xcassets in Resources */, 270 | A00551D01938497A009FF21A /* InfoPlist.strings in Resources */, 271 | A0A538201AEEAB7900DF3DE8 /* SWFrameButton.podspec in Resources */, 272 | A00DF5761C9B3182006F51A2 /* LaunchScreen.storyboard in Resources */, 273 | A00551D91938497A009FF21A /* Main.storyboard in Resources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | A00551E11938497B009FF21A /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | A00551EF1938497B009FF21A /* InfoPlist.strings in Resources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXResourcesBuildPhase section */ 286 | 287 | /* Begin PBXSourcesBuildPhase section */ 288 | A00551BE1938497A009FF21A /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | A0CAF4531AEF391A002FD35D /* SWSecondViewController.m in Sources */, 293 | A00551DC1938497A009FF21A /* SWViewController.m in Sources */, 294 | A00551D61938497A009FF21A /* SWAppDelegate.m in Sources */, 295 | A00551D21938497A009FF21A /* main.m in Sources */, 296 | A005520119384AAD009FF21A /* SWFrameButton.m in Sources */, 297 | A0EDFFB61CC6882D00C6A025 /* SWTableViewController.m in Sources */, 298 | A0EDFFB31CC687F600C6A025 /* SWTableViewCell.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | A00551DF1938497B009FF21A /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | A00551F11938497B009FF21A /* SWFrameButtonExampleTests.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXTargetDependency section */ 313 | A00551E91938497B009FF21A /* PBXTargetDependency */ = { 314 | isa = PBXTargetDependency; 315 | target = A00551C11938497A009FF21A /* SWFrameButtonExample */; 316 | targetProxy = A00551E81938497B009FF21A /* PBXContainerItemProxy */; 317 | }; 318 | /* End PBXTargetDependency section */ 319 | 320 | /* Begin PBXVariantGroup section */ 321 | A00551CE1938497A009FF21A /* InfoPlist.strings */ = { 322 | isa = PBXVariantGroup; 323 | children = ( 324 | A00551CF1938497A009FF21A /* en */, 325 | ); 326 | name = InfoPlist.strings; 327 | sourceTree = ""; 328 | }; 329 | A00551D71938497A009FF21A /* Main.storyboard */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | A00551D81938497A009FF21A /* Base */, 333 | ); 334 | name = Main.storyboard; 335 | sourceTree = ""; 336 | }; 337 | A00551ED1938497B009FF21A /* InfoPlist.strings */ = { 338 | isa = PBXVariantGroup; 339 | children = ( 340 | A00551EE1938497B009FF21A /* en */, 341 | ); 342 | name = InfoPlist.strings; 343 | sourceTree = ""; 344 | }; 345 | /* End PBXVariantGroup section */ 346 | 347 | /* Begin XCBuildConfiguration section */ 348 | A00551F21938497B009FF21A /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_WARN_BOOL_CONVERSION = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | ENABLE_TESTABILITY = YES; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | }; 385 | name = Debug; 386 | }; 387 | A00551F31938497B009FF21A /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 392 | CLANG_CXX_LIBRARY = "libc++"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_WARN_BOOL_CONVERSION = YES; 396 | CLANG_WARN_CONSTANT_CONVERSION = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 398 | CLANG_WARN_EMPTY_BODY = YES; 399 | CLANG_WARN_ENUM_CONVERSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = YES; 405 | ENABLE_NS_ASSERTIONS = NO; 406 | GCC_C_LANGUAGE_STANDARD = gnu99; 407 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 408 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 409 | GCC_WARN_UNDECLARED_SELECTOR = YES; 410 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 411 | GCC_WARN_UNUSED_FUNCTION = YES; 412 | GCC_WARN_UNUSED_VARIABLE = YES; 413 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 414 | SDKROOT = iphoneos; 415 | VALIDATE_PRODUCT = YES; 416 | }; 417 | name = Release; 418 | }; 419 | A00551F51938497B009FF21A /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 423 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 424 | GCC_PREFIX_HEADER = "SWFrameButtonExample/SWFrameButtonExample-Prefix.pch"; 425 | INFOPLIST_FILE = "SWFrameButtonExample/SWFrameButtonExample-Info.plist"; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | PRODUCT_BUNDLE_IDENTIFIER = "com.sarunw.${PRODUCT_NAME:rfc1034identifier}"; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | WRAPPER_EXTENSION = app; 430 | }; 431 | name = Debug; 432 | }; 433 | A00551F61938497B009FF21A /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 438 | GCC_PREFIX_HEADER = "SWFrameButtonExample/SWFrameButtonExample-Prefix.pch"; 439 | INFOPLIST_FILE = "SWFrameButtonExample/SWFrameButtonExample-Info.plist"; 440 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 441 | PRODUCT_BUNDLE_IDENTIFIER = "com.sarunw.${PRODUCT_NAME:rfc1034identifier}"; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | WRAPPER_EXTENSION = app; 444 | }; 445 | name = Release; 446 | }; 447 | A00551F81938497B009FF21A /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SWFrameButtonExample.app/SWFrameButtonExample"; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(SDKROOT)/Developer/Library/Frameworks", 453 | "$(inherited)", 454 | "$(DEVELOPER_FRAMEWORKS_DIR)", 455 | ); 456 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 457 | GCC_PREFIX_HEADER = "SWFrameButtonExample/SWFrameButtonExample-Prefix.pch"; 458 | GCC_PREPROCESSOR_DEFINITIONS = ( 459 | "DEBUG=1", 460 | "$(inherited)", 461 | ); 462 | INFOPLIST_FILE = "SWFrameButtonExampleTests/SWFrameButtonExampleTests-Info.plist"; 463 | PRODUCT_BUNDLE_IDENTIFIER = "com.sarunw.${PRODUCT_NAME:rfc1034identifier}"; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | TEST_HOST = "$(BUNDLE_LOADER)"; 466 | WRAPPER_EXTENSION = xctest; 467 | }; 468 | name = Debug; 469 | }; 470 | A00551F91938497B009FF21A /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SWFrameButtonExample.app/SWFrameButtonExample"; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(SDKROOT)/Developer/Library/Frameworks", 476 | "$(inherited)", 477 | "$(DEVELOPER_FRAMEWORKS_DIR)", 478 | ); 479 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 480 | GCC_PREFIX_HEADER = "SWFrameButtonExample/SWFrameButtonExample-Prefix.pch"; 481 | INFOPLIST_FILE = "SWFrameButtonExampleTests/SWFrameButtonExampleTests-Info.plist"; 482 | PRODUCT_BUNDLE_IDENTIFIER = "com.sarunw.${PRODUCT_NAME:rfc1034identifier}"; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_HOST = "$(BUNDLE_LOADER)"; 485 | WRAPPER_EXTENSION = xctest; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | A00551BD1938497A009FF21A /* Build configuration list for PBXProject "SWFrameButtonExample" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | A00551F21938497B009FF21A /* Debug */, 496 | A00551F31938497B009FF21A /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | A00551F41938497B009FF21A /* Build configuration list for PBXNativeTarget "SWFrameButtonExample" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | A00551F51938497B009FF21A /* Debug */, 505 | A00551F61938497B009FF21A /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | A00551F71938497B009FF21A /* Build configuration list for PBXNativeTarget "SWFrameButtonExampleTests" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | A00551F81938497B009FF21A /* Debug */, 514 | A00551F91938497B009FF21A /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | /* End XCConfigurationList section */ 520 | }; 521 | rootObject = A00551BA1938497A009FF21A /* Project object */; 522 | } 523 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 34 | 47 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 69 | 70 | 71 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/iphone5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "iphone5.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/iphone5.imageset/iphone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/iphone5.imageset/iphone5.png -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/magic.imageset/873-magic-wand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/magic.imageset/873-magic-wand.png -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/magic.imageset/873-magic-wand@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sarunw/SWFrameButton/5eaae87c46fdfb3748b168f780238656f9a626b9/SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/magic.imageset/873-magic-wand@2x.png -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/Images.xcassets/magic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "873-magic-wand.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "873-magic-wand@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode", 21 | "template-rendering-intent" : "template" 22 | } 23 | } -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWAppDelegate.h: -------------------------------------------------------------------------------- 1 | // SWAppDelegate.h 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface SWAppDelegate : UIResponder 26 | 27 | @property (strong, nonatomic) UIWindow *window; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWAppDelegate.m: -------------------------------------------------------------------------------- 1 | // SWAppDelegate.m 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import "SWAppDelegate.h" 24 | 25 | #import "SWFrameButton.h" 26 | 27 | @implementation SWAppDelegate 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 30 | { 31 | // Override point for customization after application launch. 32 | // [[SWFrameButton appearance] setBorderWidth:3]; 33 | 34 | return YES; 35 | } 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application 38 | { 39 | // 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. 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application 44 | { 45 | // 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. 46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 47 | } 48 | 49 | - (void)applicationWillEnterForeground:(UIApplication *)application 50 | { 51 | // 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. 52 | } 53 | 54 | - (void)applicationDidBecomeActive:(UIApplication *)application 55 | { 56 | // 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. 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWFrameButtonExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWFrameButtonExample-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 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWSecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWSecondViewController.h 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/28/15. 6 | // Copyright (c) 2015 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWSecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWSecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWSecondViewController.m 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/28/15. 6 | // Copyright (c) 2015 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import "SWSecondViewController.h" 10 | 11 | @interface SWSecondViewController () 12 | 13 | @end 14 | 15 | @implementation SWSecondViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWTableViewCell.h 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/19/16. 6 | // Copyright © 2016 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWTableViewCell : UITableViewCell 12 | 13 | @property (weak, nonatomic) IBOutlet UIButton *button; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWTableViewCell.m 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/19/16. 6 | // Copyright © 2016 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import "SWTableViewCell.h" 10 | 11 | @implementation SWTableViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWTableViewController.h 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/19/16. 6 | // Copyright © 2016 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWTableViewController.m 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 4/19/16. 6 | // Copyright © 2016 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import "SWTableViewController.h" 10 | #import "SWTableViewCell.h" 11 | 12 | @interface SWTableViewController () 13 | 14 | @property (nonatomic, strong) NSMutableArray *selected; 15 | 16 | @end 17 | 18 | @implementation SWTableViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.selected = [NSMutableArray array]; 23 | 24 | // Uncomment the following line to preserve selection between presentations. 25 | // self.clearsSelectionOnViewWillAppear = NO; 26 | 27 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 28 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 29 | } 30 | 31 | - (void)didReceiveMemoryWarning { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | #pragma mark - Table view data source 37 | 38 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 39 | return 1; 40 | } 41 | 42 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 43 | return 30; 44 | } 45 | 46 | 47 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 48 | SWTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 49 | 50 | if ([self.selected containsObject:indexPath]) { 51 | cell.button.selected = YES; 52 | } else { 53 | cell.button.selected = NO; 54 | } 55 | 56 | return cell; 57 | } 58 | 59 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 60 | SWTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 61 | if ([self.selected containsObject:indexPath]) { 62 | cell.button.selected = NO; 63 | [self.selected removeObject:indexPath]; 64 | } else { 65 | cell.button.selected = YES; 66 | [self.selected addObject:indexPath]; 67 | } 68 | 69 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWViewController.h: -------------------------------------------------------------------------------- 1 | // SWViewController.h 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface SWViewController : UIViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/SWViewController.m: -------------------------------------------------------------------------------- 1 | // SWViewController.m 2 | // 3 | // Copyright (c) 2014 Sarun Wongpatcharapakorn 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import "SWViewController.h" 24 | #import "SWFrameButton.h" 25 | 26 | @interface SWViewController () 27 | 28 | @end 29 | 30 | @implementation SWViewController 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | // Do any additional setup after loading the view, typically from a nib. 36 | 37 | SWFrameButton *button = [[SWFrameButton alloc] init]; 38 | [button setTitle:@"Selected Button" forState:UIControlStateNormal]; 39 | [button sizeToFit]; 40 | button.center = self.view.center; 41 | [button setSelected:YES]; 42 | [self.view addSubview:button]; 43 | 44 | SWFrameButton *selectableButton = [[SWFrameButton alloc] init]; 45 | [selectableButton setTitle:@"Selectable Button" forState:UIControlStateNormal]; 46 | [selectableButton addTarget:self action:@selector(toggleSelection:) forControlEvents:UIControlEventTouchUpInside]; 47 | UIImage *magic = [UIImage imageNamed:@"magic"]; 48 | [selectableButton setImage:magic forState:UIControlStateNormal]; 49 | [selectableButton sizeToFit]; 50 | selectableButton.center = CGPointMake(self.view.center.x, self.view.center.y + 50); 51 | [self.view addSubview:selectableButton]; 52 | 53 | SWFrameButton *tintButton = [[SWFrameButton alloc] init]; 54 | [tintButton setTitle:@"Green Tint Button" forState:UIControlStateNormal]; 55 | [tintButton setImage:magic forState:UIControlStateNormal]; 56 | [tintButton sizeToFit]; 57 | tintButton.tintColor = [UIColor greenColor]; 58 | tintButton.center = CGPointMake(self.view.center.x, self.view.center.y + 100); 59 | 60 | [self.view addSubview:tintButton]; 61 | 62 | SWFrameButton *dimButton = [[SWFrameButton alloc] init]; 63 | [dimButton setTitle:@"Dim Button" forState:UIControlStateNormal]; 64 | [dimButton addTarget:self action:@selector(toggleDim:) forControlEvents:UIControlEventTouchUpInside]; 65 | [dimButton sizeToFit]; 66 | dimButton.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed; 67 | dimButton.center = CGPointMake(self.view.center.x, self.view.center.y + 150); 68 | [self.view addSubview:dimButton]; 69 | 70 | UIButton *systemButton = [UIButton buttonWithType:UIButtonTypeSystem]; 71 | [systemButton setTitle:@"System Button" forState:UIControlStateNormal]; 72 | [systemButton sizeToFit]; 73 | systemButton.center = CGPointMake(self.view.center.x, self.view.center.y + 200); 74 | [self.view addSubview:systemButton]; 75 | 76 | SWFrameButton *disableButton = [[SWFrameButton alloc] init]; 77 | [disableButton setTitle:@"Disable Button" forState:UIControlStateNormal]; 78 | [disableButton sizeToFit]; 79 | disableButton.enabled = NO; 80 | disableButton.center = CGPointMake(self.view.center.x, self.view.center.y + 250); 81 | [self.view addSubview:disableButton]; 82 | } 83 | 84 | - (void)didReceiveMemoryWarning 85 | { 86 | [super didReceiveMemoryWarning]; 87 | // Dispose of any resources that can be recreated. 88 | } 89 | 90 | #pragma mark - Actions 91 | - (void)toggleSelection:(id)sender 92 | { 93 | UIButton *button = (UIButton *)sender; 94 | button.selected = !button.selected; 95 | } 96 | 97 | - (void)toggleDim:(id)sender 98 | { 99 | if (self.view.tintAdjustmentMode != UIViewTintAdjustmentModeDimmed) { 100 | self.view.tintAdjustmentMode = UIViewTintAdjustmentModeDimmed; 101 | } else { 102 | self.view.tintAdjustmentMode = UIViewTintAdjustmentModeAutomatic; 103 | } 104 | 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SWFrameButtonExample 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 5/30/14. 6 | // Copyright (c) 2014 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SWAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExampleTests/SWFrameButtonExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExampleTests/SWFrameButtonExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWFrameButtonExampleTests.m 3 | // SWFrameButtonExampleTests 4 | // 5 | // Created by Sarun Wongpatcharapakorn on 5/30/14. 6 | // Copyright (c) 2014 Sarun Wongpatcharapakorn. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWFrameButtonExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SWFrameButtonExampleTests 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 | -------------------------------------------------------------------------------- /SWFrameButtonExample/SWFrameButtonExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------