├── .gitignore ├── LICENSE ├── README.md ├── StrapButton.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Oskur.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Oskur.xcuserdatad │ └── xcschemes │ ├── StrapButton.xcscheme │ └── xcschememanagement.plist ├── StrapButton ├── AppDelegate.h ├── AppDelegate.m ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── FontAwesome.ttf ├── NSString+FontAwesome.h ├── NSString+FontAwesome.m ├── StrapButton-Info.plist ├── StrapButton-Prefix.pch ├── UIButton+Bootstrap.h ├── UIButton+Bootstrap.m ├── ViewController.h ├── ViewController.m ├── en.lproj │ ├── InfoPlist.strings │ └── ViewController_iPhone.xib └── main.m └── screen.png /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.xcuserstate 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 OskarGroth 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Looking for flat NSButtons for macOS? 2 | Check out [FlatButton](https://github.com/OskarGroth/FlatButton) 3 | 4 | UIButton-Bootstrap 5 | ================== 6 | Simple UIButton category that adds nice and flat Bootstrap 3.0 button styles. 7 | 8 | No subclass, no images. Quartz Core drawing. Highly customizable. 9 | 10 | ![UIButton+Bootstrap](screen.png "Screenshot") 11 | 12 | ## How-To 13 | * Drag the `UIButton+Bootstrap`, `NSString+FontAwesome` and `FontAwesome.ttf` files to your project 14 | * Import the category with `#import "UIButton+Bootstrap.h"` 15 | * Add `Fonts provided by application` key to `Info.plist` and include `FontAwesome.ttf` 16 | 17 | Create an UIButton with `UIButtonTypeCustom`. 18 | 19 | Then set the style by: 20 | 21 | ````objective-c 22 | [yourButton primaryStyle]; 23 | 24 | [yourOtherButton successStyle]; 25 | 26 | etc. 27 | ```` 28 | 29 | And icons by: 30 | 31 | ````objective-c 32 | [yourButton addAwesomeIcon:FAIconBookmark beforeTitle:YES]; 33 | 34 | [yourOtherButton addAwesomeIcon:FAIconCalendar beforeTitle:NO]; 35 | 36 | etc. 37 | ```` 38 | 39 | ### Credits 40 | BButton by mattlawer: https://github.com/mattlawer/BButton 41 | 42 | FontAwesome-iOS by leberwurstsaft: https://github.com/leberwurstsaft/FontAwesome-for-iOS 43 | 44 | ## License 45 | The MIT License (MIT) 46 | 47 | Copyright (c) 2013 Oskar Groth 48 | 49 | Permission is hereby granted, free of charge, to any person obtaining a copy of 50 | this software and associated documentation files (the "Software"), to deal in 51 | the Software without restriction, including without limitation the rights to 52 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 53 | the Software, and to permit persons to whom the Software is furnished to do so, 54 | subject to the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be included in all 57 | copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 60 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 61 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 62 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 63 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 64 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 65 | -------------------------------------------------------------------------------- /StrapButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7F46950117F986C500903E7E /* NSString+FontAwesome.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F46950017F986C500903E7E /* NSString+FontAwesome.m */; }; 11 | 7F46950317F9870A00903E7E /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7F46950217F9870A00903E7E /* FontAwesome.ttf */; }; 12 | 7FF213FD17F8909800C7AF2A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FF213FC17F8909800C7AF2A /* UIKit.framework */; }; 13 | 7FF213FF17F8909800C7AF2A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FF213FE17F8909800C7AF2A /* Foundation.framework */; }; 14 | 7FF2140117F8909800C7AF2A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FF2140017F8909800C7AF2A /* CoreGraphics.framework */; }; 15 | 7FF2140717F8909800C7AF2A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7FF2140517F8909800C7AF2A /* InfoPlist.strings */; }; 16 | 7FF2140917F8909800C7AF2A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF2140817F8909800C7AF2A /* main.m */; }; 17 | 7FF2140D17F8909800C7AF2A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF2140C17F8909800C7AF2A /* AppDelegate.m */; }; 18 | 7FF2140F17F8909800C7AF2A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 7FF2140E17F8909800C7AF2A /* Default.png */; }; 19 | 7FF2141117F8909800C7AF2A /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7FF2141017F8909800C7AF2A /* Default@2x.png */; }; 20 | 7FF2141317F8909800C7AF2A /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7FF2141217F8909800C7AF2A /* Default-568h@2x.png */; }; 21 | 7FF2141617F8909800C7AF2A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF2141517F8909800C7AF2A /* ViewController.m */; }; 22 | 7FF2141917F8909800C7AF2A /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7FF2141717F8909800C7AF2A /* ViewController_iPhone.xib */; }; 23 | 7FF2142417F890C100C7AF2A /* UIButton+Bootstrap.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF2142317F890C100C7AF2A /* UIButton+Bootstrap.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 7F4694FF17F986C500903E7E /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = ""; }; 28 | 7F46950017F986C500903E7E /* NSString+FontAwesome.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+FontAwesome.m"; sourceTree = ""; }; 29 | 7F46950217F9870A00903E7E /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontAwesome.ttf; sourceTree = ""; }; 30 | 7FF213F917F8909800C7AF2A /* StrapButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StrapButton.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 7FF213FC17F8909800C7AF2A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 32 | 7FF213FE17F8909800C7AF2A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 33 | 7FF2140017F8909800C7AF2A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 34 | 7FF2140417F8909800C7AF2A /* StrapButton-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StrapButton-Info.plist"; sourceTree = ""; }; 35 | 7FF2140617F8909800C7AF2A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 36 | 7FF2140817F8909800C7AF2A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | 7FF2140A17F8909800C7AF2A /* StrapButton-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StrapButton-Prefix.pch"; sourceTree = ""; }; 38 | 7FF2140B17F8909800C7AF2A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 7FF2140C17F8909800C7AF2A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 7FF2140E17F8909800C7AF2A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 41 | 7FF2141017F8909800C7AF2A /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 42 | 7FF2141217F8909800C7AF2A /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 43 | 7FF2141417F8909800C7AF2A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 7FF2141517F8909800C7AF2A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 7FF2141817F8909800C7AF2A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = ""; }; 46 | 7FF2142217F890C100C7AF2A /* UIButton+Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Bootstrap.h"; sourceTree = ""; }; 47 | 7FF2142317F890C100C7AF2A /* UIButton+Bootstrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Bootstrap.m"; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 7FF213F617F8909800C7AF2A /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 7FF213FD17F8909800C7AF2A /* UIKit.framework in Frameworks */, 56 | 7FF213FF17F8909800C7AF2A /* Foundation.framework in Frameworks */, 57 | 7FF2140117F8909800C7AF2A /* CoreGraphics.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 7FF213F017F8909800C7AF2A = { 65 | isa = PBXGroup; 66 | children = ( 67 | 7FF2140217F8909800C7AF2A /* StrapButton */, 68 | 7FF213FB17F8909800C7AF2A /* Frameworks */, 69 | 7FF213FA17F8909800C7AF2A /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | 7FF213FA17F8909800C7AF2A /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 7FF213F917F8909800C7AF2A /* StrapButton.app */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 7FF213FB17F8909800C7AF2A /* Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 7FF213FC17F8909800C7AF2A /* UIKit.framework */, 85 | 7FF213FE17F8909800C7AF2A /* Foundation.framework */, 86 | 7FF2140017F8909800C7AF2A /* CoreGraphics.framework */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | 7FF2140217F8909800C7AF2A /* StrapButton */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 7FF2140B17F8909800C7AF2A /* AppDelegate.h */, 95 | 7FF2140C17F8909800C7AF2A /* AppDelegate.m */, 96 | 7FF2141417F8909800C7AF2A /* ViewController.h */, 97 | 7FF2141517F8909800C7AF2A /* ViewController.m */, 98 | 7F4694FF17F986C500903E7E /* NSString+FontAwesome.h */, 99 | 7F46950017F986C500903E7E /* NSString+FontAwesome.m */, 100 | 7FF2142217F890C100C7AF2A /* UIButton+Bootstrap.h */, 101 | 7FF2142317F890C100C7AF2A /* UIButton+Bootstrap.m */, 102 | 7F46950217F9870A00903E7E /* FontAwesome.ttf */, 103 | 7FF2141717F8909800C7AF2A /* ViewController_iPhone.xib */, 104 | 7FF2140317F8909800C7AF2A /* Supporting Files */, 105 | ); 106 | path = StrapButton; 107 | sourceTree = ""; 108 | }; 109 | 7FF2140317F8909800C7AF2A /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 7FF2140417F8909800C7AF2A /* StrapButton-Info.plist */, 113 | 7FF2140517F8909800C7AF2A /* InfoPlist.strings */, 114 | 7FF2140817F8909800C7AF2A /* main.m */, 115 | 7FF2140A17F8909800C7AF2A /* StrapButton-Prefix.pch */, 116 | 7FF2140E17F8909800C7AF2A /* Default.png */, 117 | 7FF2141017F8909800C7AF2A /* Default@2x.png */, 118 | 7FF2141217F8909800C7AF2A /* Default-568h@2x.png */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | 7FF213F817F8909800C7AF2A /* StrapButton */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = 7FF2141F17F8909800C7AF2A /* Build configuration list for PBXNativeTarget "StrapButton" */; 129 | buildPhases = ( 130 | 7FF213F517F8909800C7AF2A /* Sources */, 131 | 7FF213F617F8909800C7AF2A /* Frameworks */, 132 | 7FF213F717F8909800C7AF2A /* Resources */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = StrapButton; 139 | productName = StrapButton; 140 | productReference = 7FF213F917F8909800C7AF2A /* StrapButton.app */; 141 | productType = "com.apple.product-type.application"; 142 | }; 143 | /* End PBXNativeTarget section */ 144 | 145 | /* Begin PBXProject section */ 146 | 7FF213F117F8909800C7AF2A /* Project object */ = { 147 | isa = PBXProject; 148 | attributes = { 149 | LastUpgradeCheck = 0460; 150 | ORGANIZATIONNAME = "Oskar Groth"; 151 | }; 152 | buildConfigurationList = 7FF213F417F8909800C7AF2A /* Build configuration list for PBXProject "StrapButton" */; 153 | compatibilityVersion = "Xcode 3.2"; 154 | developmentRegion = English; 155 | hasScannedForEncodings = 0; 156 | knownRegions = ( 157 | en, 158 | ); 159 | mainGroup = 7FF213F017F8909800C7AF2A; 160 | productRefGroup = 7FF213FA17F8909800C7AF2A /* Products */; 161 | projectDirPath = ""; 162 | projectRoot = ""; 163 | targets = ( 164 | 7FF213F817F8909800C7AF2A /* StrapButton */, 165 | ); 166 | }; 167 | /* End PBXProject section */ 168 | 169 | /* Begin PBXResourcesBuildPhase section */ 170 | 7FF213F717F8909800C7AF2A /* Resources */ = { 171 | isa = PBXResourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 7FF2140717F8909800C7AF2A /* InfoPlist.strings in Resources */, 175 | 7FF2140F17F8909800C7AF2A /* Default.png in Resources */, 176 | 7FF2141117F8909800C7AF2A /* Default@2x.png in Resources */, 177 | 7FF2141317F8909800C7AF2A /* Default-568h@2x.png in Resources */, 178 | 7FF2141917F8909800C7AF2A /* ViewController_iPhone.xib in Resources */, 179 | 7F46950317F9870A00903E7E /* FontAwesome.ttf in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 7FF213F517F8909800C7AF2A /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 7FF2140917F8909800C7AF2A /* main.m in Sources */, 191 | 7FF2140D17F8909800C7AF2A /* AppDelegate.m in Sources */, 192 | 7FF2141617F8909800C7AF2A /* ViewController.m in Sources */, 193 | 7FF2142417F890C100C7AF2A /* UIButton+Bootstrap.m in Sources */, 194 | 7F46950117F986C500903E7E /* NSString+FontAwesome.m in Sources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXSourcesBuildPhase section */ 199 | 200 | /* Begin PBXVariantGroup section */ 201 | 7FF2140517F8909800C7AF2A /* InfoPlist.strings */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 7FF2140617F8909800C7AF2A /* en */, 205 | ); 206 | name = InfoPlist.strings; 207 | sourceTree = ""; 208 | }; 209 | 7FF2141717F8909800C7AF2A /* ViewController_iPhone.xib */ = { 210 | isa = PBXVariantGroup; 211 | children = ( 212 | 7FF2141817F8909800C7AF2A /* en */, 213 | ); 214 | name = ViewController_iPhone.xib; 215 | sourceTree = ""; 216 | }; 217 | /* End PBXVariantGroup section */ 218 | 219 | /* Begin XCBuildConfiguration section */ 220 | 7FF2141D17F8909800C7AF2A /* Debug */ = { 221 | isa = XCBuildConfiguration; 222 | buildSettings = { 223 | ALWAYS_SEARCH_USER_PATHS = NO; 224 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 225 | CLANG_CXX_LIBRARY = "libc++"; 226 | CLANG_ENABLE_OBJC_ARC = YES; 227 | CLANG_WARN_CONSTANT_CONVERSION = YES; 228 | CLANG_WARN_EMPTY_BODY = YES; 229 | CLANG_WARN_ENUM_CONVERSION = YES; 230 | CLANG_WARN_INT_CONVERSION = YES; 231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 232 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 233 | COPY_PHASE_STRIP = NO; 234 | GCC_C_LANGUAGE_STANDARD = gnu99; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_OPTIMIZATION_LEVEL = 0; 237 | GCC_PREPROCESSOR_DEFINITIONS = ( 238 | "DEBUG=1", 239 | "$(inherited)", 240 | ); 241 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 242 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 243 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 244 | GCC_WARN_UNUSED_VARIABLE = YES; 245 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 246 | ONLY_ACTIVE_ARCH = YES; 247 | SDKROOT = iphoneos; 248 | TARGETED_DEVICE_FAMILY = "1,2"; 249 | }; 250 | name = Debug; 251 | }; 252 | 7FF2141E17F8909800C7AF2A /* Release */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 257 | CLANG_CXX_LIBRARY = "libc++"; 258 | CLANG_ENABLE_OBJC_ARC = YES; 259 | CLANG_WARN_CONSTANT_CONVERSION = YES; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INT_CONVERSION = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 265 | COPY_PHASE_STRIP = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu99; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 271 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 272 | SDKROOT = iphoneos; 273 | TARGETED_DEVICE_FAMILY = "1,2"; 274 | VALIDATE_PRODUCT = YES; 275 | }; 276 | name = Release; 277 | }; 278 | 7FF2142017F8909800C7AF2A /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 282 | GCC_PREFIX_HEADER = "StrapButton/StrapButton-Prefix.pch"; 283 | INFOPLIST_FILE = "StrapButton/StrapButton-Info.plist"; 284 | PRODUCT_NAME = "$(TARGET_NAME)"; 285 | WRAPPER_EXTENSION = app; 286 | }; 287 | name = Debug; 288 | }; 289 | 7FF2142117F8909800C7AF2A /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 293 | GCC_PREFIX_HEADER = "StrapButton/StrapButton-Prefix.pch"; 294 | INFOPLIST_FILE = "StrapButton/StrapButton-Info.plist"; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | WRAPPER_EXTENSION = app; 297 | }; 298 | name = Release; 299 | }; 300 | /* End XCBuildConfiguration section */ 301 | 302 | /* Begin XCConfigurationList section */ 303 | 7FF213F417F8909800C7AF2A /* Build configuration list for PBXProject "StrapButton" */ = { 304 | isa = XCConfigurationList; 305 | buildConfigurations = ( 306 | 7FF2141D17F8909800C7AF2A /* Debug */, 307 | 7FF2141E17F8909800C7AF2A /* Release */, 308 | ); 309 | defaultConfigurationIsVisible = 0; 310 | defaultConfigurationName = Release; 311 | }; 312 | 7FF2141F17F8909800C7AF2A /* Build configuration list for PBXNativeTarget "StrapButton" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | 7FF2142017F8909800C7AF2A /* Debug */, 316 | 7FF2142117F8909800C7AF2A /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | /* End XCConfigurationList section */ 322 | }; 323 | rootObject = 7FF213F117F8909800C7AF2A /* Project object */; 324 | } 325 | -------------------------------------------------------------------------------- /StrapButton.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StrapButton.xcodeproj/project.xcworkspace/xcuserdata/Oskur.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/StrapButton.xcodeproj/project.xcworkspace/xcuserdata/Oskur.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /StrapButton.xcodeproj/xcuserdata/Oskur.xcuserdatad/xcschemes/StrapButton.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /StrapButton.xcodeproj/xcuserdata/Oskur.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | StrapButton.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7FF213F817F8909800C7AF2A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /StrapButton/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // StrapButton 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /StrapButton/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // StrapButton 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil]; 18 | self.window.rootViewController = self.viewController; 19 | [self.window makeKeyAndVisible]; 20 | return YES; 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /StrapButton/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/StrapButton/Default-568h@2x.png -------------------------------------------------------------------------------- /StrapButton/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/StrapButton/Default.png -------------------------------------------------------------------------------- /StrapButton/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/StrapButton/Default@2x.png -------------------------------------------------------------------------------- /StrapButton/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/StrapButton/FontAwesome.ttf -------------------------------------------------------------------------------- /StrapButton/NSString+FontAwesome.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+FontAwesome.h 3 | // 4 | // Created by Pit Garbe on 27.09.12. 5 | // Copyright (c) 2012 Pit Garbe. All rights reserved. 6 | // 7 | // https://github.com/leberwurstsaft/FontAwesome-for-iOS 8 | // 9 | // 10 | // * The Font Awesome font is licensed under the SIL Open Font License 11 | // http://scripts.sil.org/OFL 12 | // 13 | // 14 | // * Font Awesome CSS, LESS, and SASS files are licensed under the MIT License 15 | // http://opensource.org/licenses/mit-license.html 16 | // 17 | // 18 | // * The Font Awesome pictograms are licensed under the CC BY 3.0 License 19 | // http://creativecommons.org/licenses/by/3.0 20 | // 21 | // 22 | // * Attribution is no longer required in Font Awesome 3.0, but much appreciated: 23 | // "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" 24 | // 25 | // 26 | // ----------------------------------------- 27 | // Edited and refactored by Jesse Squires on 2 April, 2013. 28 | // 29 | // http://github.com/jessesquires/BButton 30 | // 31 | // http://hexedbits.com 32 | // 33 | 34 | #import 35 | 36 | typedef enum { 37 | FAIconGlass = 0, 38 | FAIconMusic, 39 | FAIconSearch, 40 | FAIconEnvelope, 41 | FAIconHeart, 42 | FAIconStar, 43 | FAIconStarEmpty, 44 | FAIconUser, 45 | FAIconFilm, 46 | FAIconThLarge, 47 | FAIconTh, 48 | FAIconThList, 49 | FAIconOk, 50 | FAIconRemove, 51 | FAIconZoomIn, 52 | FAIconZoomOut, 53 | FAIconOff, 54 | FAIconSignal, 55 | FAIconCog, 56 | FAIconTrash, 57 | FAIconHome, 58 | FAIconFile, 59 | FAIconTime, 60 | FAIconRoad, 61 | FAIconDownloadAlt, 62 | FAIconDownload, 63 | FAIconUpload, 64 | FAIconInbox, 65 | FAIconPlayCircle, 66 | FAIconRepeat, 67 | FAIconRefresh, 68 | FAIconListAlt, 69 | FAIconLock, 70 | FAIconFlag, 71 | FAIconHeadphones, 72 | FAIconVolumeOff, 73 | FAIconVolumeDown, 74 | FAIconVolumeUp, 75 | FAIconQrcode, 76 | FAIconBarcode, 77 | FAIconTag, 78 | FAIconTags, 79 | FAIconBook, 80 | FAIconBookmark, 81 | FAIconPrint, 82 | FAIconCamera, 83 | FAIconFont, 84 | FAIconBold, 85 | FAIconItalic, 86 | FAIconTextHeight, 87 | FAIconTextWidth, 88 | FAIconAlignLeft, 89 | FAIconAlignCenter, 90 | FAIconAlignRight, 91 | FAIconAlignJustify, 92 | FAIconList, 93 | FAIconIndentLeft, 94 | FAIconIndentRight, 95 | FAIconFacetimeVideo, 96 | FAIconPicture, 97 | FAIconPencil, 98 | FAIconMapMarker, 99 | FAIconAdjust, 100 | FAIconTint, 101 | FAIconEdit, 102 | FAIconShare, 103 | FAIconCheck, 104 | FAIconMove, 105 | FAIconStepBackward, 106 | FAIconFastBackward, 107 | FAIconBackward, 108 | FAIconPlay, 109 | FAIconPause, 110 | FAIconStop, 111 | FAIconForward, 112 | FAIconFastForward, 113 | FAIconStepForward, 114 | FAIconEject, 115 | FAIconChevronLeft, 116 | FAIconChevronRight, 117 | FAIconPlusSign, 118 | FAIconMinusSign, 119 | FAIconRemoveSign, 120 | FAIconOkSign, 121 | FAIconQuestionSign, 122 | FAIconInfoSign, 123 | FAIconScreenshot, 124 | FAIconRemoveCircle, 125 | FAIconOkCircle, 126 | FAIconBanCircle, 127 | FAIconArrowLeft, 128 | FAIconArrowRight, 129 | FAIconArrowUp, 130 | FAIconArrowDown, 131 | FAIconShareAlt, 132 | FAIconResizeFull, 133 | FAIconResizeSmall, 134 | FAIconPlus, 135 | FAIconMinus, 136 | FAIconAsterisk, 137 | FAIconExclamationSign, 138 | FAIconGift, 139 | FAIconLeaf, 140 | FAIconFire, 141 | FAIconEyeOpen, 142 | FAIconEyeClose, 143 | FAIconWarningSign, 144 | FAIconPlane, 145 | FAIconCalendar, 146 | FAIconRandom, 147 | FAIconComment, 148 | FAIconMagnet, 149 | FAIconChevronUp, 150 | FAIconChevronDown, 151 | FAIconRetweet, 152 | FAIconShoppingCart, 153 | FAIconFolderClose, 154 | FAIconFolderOpen, 155 | FAIconResizeVertical, 156 | FAIconResizeHorizontal, 157 | FAIconBarChart, 158 | FAIconTwitterSign, 159 | FAIconFacebookSign, 160 | FAIconCameraRetro, 161 | FAIconKey, 162 | FAIconCogs, 163 | FAIconComments, 164 | FAIconThumbsUp, 165 | FAIconThumbsDown, 166 | FAIconStarHalf, 167 | FAIconHeartEmpty, 168 | FAIconSignout, 169 | FAIconLinkedinSign, 170 | FAIconPushpin, 171 | FAIconExternalLink, 172 | FAIconSignin, 173 | FAIconTrophy, 174 | FAIconGithubSign, 175 | FAIconUploadAlt, 176 | FAIconLemon, 177 | FAIconPhone, 178 | FAIconCheckEmpty, 179 | FAIconBookmarkEmpty, 180 | FAIconPhoneSign, 181 | FAIconTwitter, 182 | FAIconFacebook, 183 | FAIconGithub, 184 | FAIconUnlock, 185 | FAIconCreditCard, 186 | FAIconRss, 187 | FAIconHdd, 188 | FAIconBullhorn, 189 | FAIconBell, 190 | FAIconCertificate, 191 | FAIconHandRight, 192 | FAIconHandLeft, 193 | FAIconHandUp, 194 | FAIconHandDown, 195 | FAIconCircleArrowLeft, 196 | FAIconCircleArrowRight, 197 | FAIconCircleArrowUp, 198 | FAIconCircleArrowDown, 199 | FAIconGlobe, 200 | FAIconWrench, 201 | FAIconTasks, 202 | FAIconFilter, 203 | FAIconBriefcase, 204 | FAIconFullscreen, 205 | FAIconGroup, 206 | FAIconLink, 207 | FAIconCloud, 208 | FAIconBeaker, 209 | FAIconCut, 210 | FAIconCopy, 211 | FAIconPaperClip, 212 | FAIconSave, 213 | FAIconSignBlank, 214 | FAIconReorder, 215 | FAIconListUl, 216 | FAIconListOl, 217 | FAIconStrikethrough, 218 | FAIconUnderline, 219 | FAIconTable, 220 | FAIconMagic, 221 | FAIconTruck, 222 | FAIconPinterest, 223 | FAIconPinterestSign, 224 | FAIconGooglePlusSign, 225 | FAIconGooglePlus, 226 | FAIconMoney, 227 | FAIconCaretDown, 228 | FAIconCaretUp, 229 | FAIconCaretLeft, 230 | FAIconCaretRight, 231 | FAIconColumns, 232 | FAIconSort, 233 | FAIconSortDown, 234 | FAIconSortUp, 235 | FAIconEnvelopeAlt, 236 | FAIconLinkedin, 237 | FAIconUndo, 238 | FAIconLegal, 239 | FAIconDashboard, 240 | FAIconCommentAlt, 241 | FAIconCommentsAlt, 242 | FAIconBolt, 243 | FAIconSitemap, 244 | FAIconUmbrella, 245 | FAIconPaste, 246 | FAIconUserMd 247 | } FAIcon; 248 | 249 | 250 | @interface NSString (FontAwesome) 251 | 252 | + (NSString *)stringFromAwesomeIcon:(FAIcon)icon; 253 | - (NSString *)trimWhitespace; 254 | - (BOOL)isEmpty; 255 | 256 | @end -------------------------------------------------------------------------------- /StrapButton/NSString+FontAwesome.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+FontAwesome.m 3 | // 4 | // Created by Pit Garbe on 27.09.12. 5 | // Copyright (c) 2012 Pit Garbe. All rights reserved. 6 | // 7 | // https://github.com/leberwurstsaft/FontAwesome-for-iOS 8 | // 9 | // 10 | // * The Font Awesome font is licensed under the SIL Open Font License 11 | // http://scripts.sil.org/OFL 12 | // 13 | // 14 | // * Font Awesome CSS, LESS, and SASS files are licensed under the MIT License 15 | // http://opensource.org/licenses/mit-license.html 16 | // 17 | // 18 | // * The Font Awesome pictograms are licensed under the CC BY 3.0 License 19 | // http://creativecommons.org/licenses/by/3.0 20 | // 21 | // 22 | // * Attribution is no longer required in Font Awesome 3.0, but much appreciated: 23 | // "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" 24 | // 25 | // 26 | // ----------------------------------------- 27 | // Edited and refactored by Jesse Squires on 2 April, 2013. 28 | // 29 | // http://github.com/jessesquires/BButton 30 | // 31 | // http://hexedbits.com 32 | // 33 | 34 | #import "NSString+FontAwesome.h" 35 | 36 | static const NSArray *awesomeStrings; 37 | 38 | 39 | @implementation NSString (FontAwesome) 40 | 41 | + (NSString *)stringFromAwesomeIcon:(FAIcon)icon 42 | { 43 | if(!awesomeStrings) { 44 | awesomeStrings = [NSArray arrayWithObjects:@"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", nil]; 45 | } 46 | 47 | return [awesomeStrings objectAtIndex:icon]; 48 | } 49 | 50 | - (NSString *)trimWhitespace 51 | { 52 | NSMutableString *str = [self mutableCopy]; 53 | CFStringTrimWhitespace((__bridge CFMutableStringRef)str); 54 | return str; 55 | } 56 | 57 | - (BOOL)isEmpty 58 | { 59 | return [[self trimWhitespace] isEqualToString:@""]; 60 | } 61 | 62 | @end -------------------------------------------------------------------------------- /StrapButton/StrapButton-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | Groths.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIAppFonts 38 | 39 | FontAwesome.ttf 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /StrapButton/StrapButton-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'StrapButton' target in the 'StrapButton' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /StrapButton/UIButton+Bootstrap.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Bootstrap.h 3 | // UIButton+Bootstrap 4 | // 5 | // Created by Oskar Groth on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSString+FontAwesome.h" 11 | @interface UIButton (Bootstrap) 12 | - (void)addAwesomeIcon:(FAIcon)icon beforeTitle:(BOOL)before; 13 | -(void)bootstrapStyle; 14 | -(void)defaultStyle; 15 | -(void)primaryStyle; 16 | -(void)successStyle; 17 | -(void)infoStyle; 18 | -(void)warningStyle; 19 | -(void)dangerStyle; 20 | @end 21 | -------------------------------------------------------------------------------- /StrapButton/UIButton+Bootstrap.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Bootstrap.m 3 | // UIButton+Bootstrap 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | #import "UIButton+Bootstrap.h" 9 | #import 10 | @implementation UIButton (Bootstrap) 11 | 12 | -(void)bootstrapStyle{ 13 | self.layer.borderWidth = 1; 14 | self.layer.cornerRadius = 4.0; 15 | self.layer.masksToBounds = YES; 16 | [self setAdjustsImageWhenHighlighted:NO]; 17 | [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 18 | [self.titleLabel setFont:[UIFont fontWithName:@"FontAwesome" size:self.titleLabel.font.pointSize]]; 19 | } 20 | 21 | -(void)defaultStyle{ 22 | [self bootstrapStyle]; 23 | [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 24 | [self setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; 25 | self.backgroundColor = [UIColor whiteColor]; 26 | self.layer.borderColor = [[UIColor colorWithRed:204/255.0 green:204/255.0 blue:204/255.0 alpha:1] CGColor]; 27 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1]] forState:UIControlStateHighlighted]; 28 | } 29 | 30 | -(void)primaryStyle{ 31 | [self bootstrapStyle]; 32 | self.backgroundColor = [UIColor colorWithRed:66/255.0 green:139/255.0 blue:202/255.0 alpha:1]; 33 | self.layer.borderColor = [[UIColor colorWithRed:53/255.0 green:126/255.0 blue:189/255.0 alpha:1] CGColor]; 34 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:51/255.0 green:119/255.0 blue:172/255.0 alpha:1]] forState:UIControlStateHighlighted]; 35 | } 36 | 37 | -(void)successStyle{ 38 | [self bootstrapStyle]; 39 | self.backgroundColor = [UIColor colorWithRed:92/255.0 green:184/255.0 blue:92/255.0 alpha:1]; 40 | self.layer.borderColor = [[UIColor colorWithRed:76/255.0 green:174/255.0 blue:76/255.0 alpha:1] CGColor]; 41 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:69/255.0 green:164/255.0 blue:84/255.0 alpha:1]] forState:UIControlStateHighlighted]; 42 | } 43 | 44 | -(void)infoStyle{ 45 | [self bootstrapStyle]; 46 | self.backgroundColor = [UIColor colorWithRed:91/255.0 green:192/255.0 blue:222/255.0 alpha:1]; 47 | self.layer.borderColor = [[UIColor colorWithRed:70/255.0 green:184/255.0 blue:218/255.0 alpha:1] CGColor]; 48 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:57/255.0 green:180/255.0 blue:211/255.0 alpha:1]] forState:UIControlStateHighlighted]; 49 | } 50 | 51 | -(void)warningStyle{ 52 | [self bootstrapStyle]; 53 | self.backgroundColor = [UIColor colorWithRed:240/255.0 green:173/255.0 blue:78/255.0 alpha:1]; 54 | self.layer.borderColor = [[UIColor colorWithRed:238/255.0 green:162/255.0 blue:54/255.0 alpha:1] CGColor]; 55 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:237/255.0 green:155/255.0 blue:67/255.0 alpha:1]] forState:UIControlStateHighlighted]; 56 | } 57 | 58 | -(void)dangerStyle{ 59 | [self bootstrapStyle]; 60 | self.backgroundColor = [UIColor colorWithRed:217/255.0 green:83/255.0 blue:79/255.0 alpha:1]; 61 | self.layer.borderColor = [[UIColor colorWithRed:212/255.0 green:63/255.0 blue:58/255.0 alpha:1] CGColor]; 62 | [self setBackgroundImage:[self buttonImageFromColor:[UIColor colorWithRed:210/255.0 green:48/255.0 blue:51/255.0 alpha:1]] forState:UIControlStateHighlighted]; 63 | } 64 | 65 | - (void)addAwesomeIcon:(FAIcon)icon beforeTitle:(BOOL)before 66 | { 67 | NSString *iconString = [NSString stringFromAwesomeIcon:icon]; 68 | self.titleLabel.font = [UIFont fontWithName:@"FontAwesome" 69 | size:self.titleLabel.font.pointSize]; 70 | 71 | NSString *title = [NSString stringWithFormat:@"%@", iconString]; 72 | 73 | if(self.titleLabel.text) { 74 | if(before) 75 | title = [title stringByAppendingFormat:@" %@", self.titleLabel.text]; 76 | else 77 | title = [NSString stringWithFormat:@"%@ %@", self.titleLabel.text, iconString]; 78 | } 79 | 80 | [self setTitle:title forState:UIControlStateNormal]; 81 | } 82 | 83 | - (UIImage *) buttonImageFromColor:(UIColor *)color { 84 | CGRect rect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); 85 | UIGraphicsBeginImageContext(rect.size); 86 | CGContextRef context = UIGraphicsGetCurrentContext(); 87 | CGContextSetFillColorWithColor(context, [color CGColor]); 88 | CGContextFillRect(context, rect); 89 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 90 | UIGraphicsEndImageContext(); 91 | return img; 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /StrapButton/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // StrapButton 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | @property (strong, nonatomic) IBOutlet UIButton *defaultButton; 13 | @property (strong, nonatomic) IBOutlet UIButton *primaryButton; 14 | @property (strong, nonatomic) IBOutlet UIButton *successButton; 15 | @property (strong, nonatomic) IBOutlet UIButton *infoButton; 16 | @property (strong, nonatomic) IBOutlet UIButton *warningButton; 17 | @property (strong, nonatomic) IBOutlet UIButton *dangerButton; 18 | @property (strong, nonatomic) IBOutlet UIButton *bookmarkButton; 19 | @property (strong, nonatomic) IBOutlet UIButton *doneButton; 20 | @property (strong, nonatomic) IBOutlet UIButton *deleteButton; 21 | @property (strong, nonatomic) IBOutlet UIButton *downloadButton; 22 | @property (strong, nonatomic) IBOutlet UIButton *calendarButton; 23 | @property (strong, nonatomic) IBOutlet UIButton *favoriteButton; 24 | @end 25 | -------------------------------------------------------------------------------- /StrapButton/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // StrapButton 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIButton+Bootstrap.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | [self.defaultButton defaultStyle]; 22 | [self.primaryButton primaryStyle]; 23 | [self.successButton successStyle]; 24 | [self.infoButton infoStyle]; 25 | [self.warningButton warningStyle]; 26 | [self.dangerButton dangerStyle]; 27 | 28 | [self.bookmarkButton primaryStyle]; 29 | [self.bookmarkButton addAwesomeIcon:FAIconBookmark beforeTitle:YES]; 30 | 31 | [self.doneButton successStyle]; 32 | [self.doneButton addAwesomeIcon:FAIconCheck beforeTitle:NO]; 33 | 34 | [self.deleteButton dangerStyle]; 35 | [self.deleteButton addAwesomeIcon:FAIconRemove beforeTitle:YES]; 36 | 37 | [self.downloadButton defaultStyle]; 38 | [self.downloadButton addAwesomeIcon:FAIconDownloadAlt beforeTitle:NO]; 39 | 40 | [self.calendarButton infoStyle]; 41 | [self.calendarButton addAwesomeIcon:FAIconCalendar beforeTitle:NO]; 42 | 43 | [self.favoriteButton warningStyle]; 44 | [self.favoriteButton addAwesomeIcon:FAIconStar beforeTitle:NO]; 45 | 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /StrapButton/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /StrapButton/en.lproj/ViewController_iPhone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 13A584 6 | 3084 7 | 1262 8 | 695.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUIButton 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{20, 27}, {120, 40}} 42 | 43 | 44 | 45 | _NS:9 46 | NO 47 | IBCocoaTouchFramework 48 | 0 49 | 0 50 | Default 51 | 52 | 3 53 | MQA 54 | 55 | 56 | 1 57 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 58 | 59 | 60 | 3 61 | MC41AA 62 | 63 | 64 | 2 65 | 17 66 | 67 | 68 | Helvetica-Bold 69 | 17 70 | 16 71 | 72 | 73 | 74 | 75 | 292 76 | {{182, 29}, {100, 35}} 77 | 78 | 79 | 80 | _NS:9 81 | NO 82 | IBCocoaTouchFramework 83 | 0 84 | 0 85 | Bookmark 86 | 87 | 88 | 1 89 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 90 | 91 | 92 | 93 | 2 94 | 15 95 | 96 | 97 | Helvetica-Bold 98 | 15 99 | 16 100 | 101 | 102 | 103 | 104 | 292 105 | {{200, 100}, {65, 28}} 106 | 107 | 108 | 109 | _NS:9 110 | NO 111 | IBCocoaTouchFramework 112 | 0 113 | 0 114 | Done 115 | 116 | 117 | 1 118 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 119 | 120 | 121 | 122 | 2 123 | 13 124 | 125 | 126 | Helvetica-Bold 127 | 13 128 | 16 129 | 130 | 131 | 132 | 133 | 292 134 | {{193, 162}, {78, 38}} 135 | 136 | 137 | 138 | _NS:9 139 | NO 140 | IBCocoaTouchFramework 141 | 0 142 | 0 143 | Delete 144 | 145 | 146 | 1 147 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 292 156 | {{172, 231}, {120, 40}} 157 | 158 | 159 | 160 | _NS:9 161 | NO 162 | IBCocoaTouchFramework 163 | 0 164 | 0 165 | Download 166 | 167 | 168 | 1 169 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 292 178 | {{215, 302}, {35, 35}} 179 | 180 | 181 | 182 | _NS:9 183 | 184 | 1 185 | MC4zNzc5OTc5ODE4IDAuODk2MDUwNDY1IDAuOTI2MjE5NzA2NgA 186 | 187 | NO 188 | IBCocoaTouchFramework 189 | 0 190 | 0 191 | 192 | 193 | 1 194 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 292 203 | {{215, 372}, {35, 35}} 204 | 205 | 206 | 207 | _NS:9 208 | 209 | 1 210 | MC45NTM5NDIxMjM3IDAuODc5OTk4NzYxOCAwLjQ1MjgyMjI2MjgAA 211 | 212 | NO 213 | IBCocoaTouchFramework 214 | 0 215 | 0 216 | 217 | 218 | 1 219 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 292 228 | {{20, 94}, {120, 40}} 229 | 230 | 231 | 232 | _NS:9 233 | NO 234 | IBCocoaTouchFramework 235 | 0 236 | 0 237 | Primary 238 | 239 | 240 | 1 241 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 292 250 | {{20, 161}, {120, 40}} 251 | 252 | 253 | 254 | _NS:9 255 | NO 256 | IBCocoaTouchFramework 257 | 0 258 | 0 259 | Success 260 | 261 | 262 | 1 263 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 292 272 | {{20, 231}, {120, 40}} 273 | 274 | 275 | 276 | _NS:9 277 | NO 278 | IBCocoaTouchFramework 279 | 0 280 | 0 281 | Info 282 | 283 | 284 | 1 285 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 292 294 | {{20, 300}, {120, 40}} 295 | 296 | 297 | 298 | _NS:9 299 | NO 300 | IBCocoaTouchFramework 301 | 0 302 | 0 303 | Warning 304 | 305 | 306 | 1 307 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 292 316 | {{20, 370}, {120, 40}} 317 | 318 | 319 | 320 | _NS:9 321 | NO 322 | IBCocoaTouchFramework 323 | 0 324 | 0 325 | Danger 326 | 327 | 328 | 1 329 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 330 | 331 | 332 | 333 | 334 | 335 | 336 | {{0, 20}, {320, 548}} 337 | 338 | 339 | 340 | 341 | 1 342 | MSAxIDEAA 343 | 344 | NO 345 | 346 | 347 | IBUIScreenMetrics 348 | 349 | YES 350 | 351 | 352 | 353 | 354 | 355 | {320, 568} 356 | {568, 320} 357 | 358 | 359 | IBCocoaTouchFramework 360 | Retina 4 Full Screen 361 | 2 362 | 363 | IBCocoaTouchFramework 364 | 365 | 366 | 367 | 368 | 369 | 370 | view 371 | 372 | 373 | 374 | 7 375 | 376 | 377 | 378 | defaultButton 379 | 380 | 381 | 382 | 100 383 | 384 | 385 | 386 | primaryButton 387 | 388 | 389 | 390 | 101 391 | 392 | 393 | 394 | successButton 395 | 396 | 397 | 398 | 102 399 | 400 | 401 | 402 | infoButton 403 | 404 | 405 | 406 | 103 407 | 408 | 409 | 410 | warningButton 411 | 412 | 413 | 414 | 104 415 | 416 | 417 | 418 | dangerButton 419 | 420 | 421 | 422 | 105 423 | 424 | 425 | 426 | bookmarkButton 427 | 428 | 429 | 430 | 158 431 | 432 | 433 | 434 | deleteButton 435 | 436 | 437 | 438 | 160 439 | 440 | 441 | 442 | doneButton 443 | 444 | 445 | 446 | 161 447 | 448 | 449 | 450 | downloadButton 451 | 452 | 453 | 454 | 162 455 | 456 | 457 | 458 | calendarButton 459 | 460 | 461 | 462 | 163 463 | 464 | 465 | 466 | favoriteButton 467 | 468 | 469 | 470 | 164 471 | 472 | 473 | 474 | 475 | 476 | 0 477 | 478 | 479 | 480 | 481 | 482 | -1 483 | 484 | 485 | File's Owner 486 | 487 | 488 | -2 489 | 490 | 491 | 492 | 493 | 6 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 8 513 | 514 | 515 | 516 | 517 | 518 | 18 519 | 520 | 521 | 522 | 523 | 524 | 37 525 | 526 | 527 | 528 | 529 | 530 | 45 531 | 532 | 533 | 534 | 535 | 536 | 53 537 | 538 | 539 | 540 | 541 | 542 | 69 543 | 544 | 545 | 546 | 547 | 548 | 152 549 | 550 | 551 | 552 | 553 | 153 554 | 555 | 556 | 557 | 558 | 154 559 | 560 | 561 | 562 | 563 | 155 564 | 565 | 566 | 567 | 568 | 156 569 | 570 | 571 | Button - Calendar 572 | 573 | 574 | 157 575 | 576 | 577 | Button - Favorite 578 | 579 | 580 | 581 | 582 | ViewController 583 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 584 | UIResponder 585 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 586 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 587 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 588 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 589 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 590 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 591 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 592 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 593 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 594 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 595 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 596 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 597 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 598 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 599 | 600 | 601 | 602 | 603 | 604 | 164 605 | 606 | 607 | 608 | 609 | ViewController 610 | UIViewController 611 | 612 | UIButton 613 | UIButton 614 | UIButton 615 | UIButton 616 | UIButton 617 | UIButton 618 | UIButton 619 | UIButton 620 | UIButton 621 | UIButton 622 | UIButton 623 | UIButton 624 | 625 | 626 | 627 | bookmarkButton 628 | UIButton 629 | 630 | 631 | calendarButton 632 | UIButton 633 | 634 | 635 | dangerButton 636 | UIButton 637 | 638 | 639 | defaultButton 640 | UIButton 641 | 642 | 643 | deleteButton 644 | UIButton 645 | 646 | 647 | doneButton 648 | UIButton 649 | 650 | 651 | downloadButton 652 | UIButton 653 | 654 | 655 | favoriteButton 656 | UIButton 657 | 658 | 659 | infoButton 660 | UIButton 661 | 662 | 663 | primaryButton 664 | UIButton 665 | 666 | 667 | successButton 668 | UIButton 669 | 670 | 671 | warningButton 672 | UIButton 673 | 674 | 675 | 676 | IBProjectSource 677 | ./Classes/ViewController.h 678 | 679 | 680 | 681 | 682 | 0 683 | IBCocoaTouchFramework 684 | YES 685 | 3 686 | 2083 687 | 688 | 689 | -------------------------------------------------------------------------------- /StrapButton/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // StrapButton 4 | // 5 | // Created by Oskur on 2013-09-29. 6 | // Copyright (c) 2013 Oskar Groth. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OskarGroth/UIButton-Bootstrap/34d1fe69f602c17f244ce5fb9882a9d77631332e/screen.png --------------------------------------------------------------------------------