├── Demo-CustomQRCore.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── Demo-CustomQRCore ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── Demo-CustomQRCoreTests ├── Demo_CustomQRCoreTests.m └── Info.plist ├── README.md └── ScreenShot.png /Demo-CustomQRCore.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CB8B244A1940B33900F18015 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8B24491940B33900F18015 /* main.m */; }; 11 | CB8B244D1940B33900F18015 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8B244C1940B33900F18015 /* AppDelegate.m */; }; 12 | CB8B24501940B33900F18015 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8B244F1940B33900F18015 /* ViewController.m */; }; 13 | CB8B24531940B33900F18015 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CB8B24511940B33900F18015 /* Main.storyboard */; }; 14 | CB8B24551940B33900F18015 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB8B24541940B33900F18015 /* Images.xcassets */; }; 15 | CB8B24611940B33A00F18015 /* Demo_CustomQRCoreTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8B24601940B33A00F18015 /* Demo_CustomQRCoreTests.m */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | CB8B245B1940B33A00F18015 /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = CB8B243C1940B33900F18015 /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = CB8B24431940B33900F18015; 24 | remoteInfo = "Demo-CustomQRCore"; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | CB8B24441940B33900F18015 /* Demo-CustomQRCore.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Demo-CustomQRCore.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | CB8B24481940B33900F18015 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | CB8B24491940B33900F18015 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | CB8B244B1940B33900F18015 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 33 | CB8B244C1940B33900F18015 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 34 | CB8B244E1940B33900F18015 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 35 | CB8B244F1940B33900F18015 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 36 | CB8B24521940B33900F18015 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | CB8B24541940B33900F18015 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | CB8B245A1940B33A00F18015 /* Demo-CustomQRCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Demo-CustomQRCoreTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | CB8B245F1940B33A00F18015 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | CB8B24601940B33A00F18015 /* Demo_CustomQRCoreTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Demo_CustomQRCoreTests.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | CB8B24411940B33900F18015 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | CB8B24571940B33A00F18015 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | CB8B243B1940B33900F18015 = { 62 | isa = PBXGroup; 63 | children = ( 64 | CB8B24461940B33900F18015 /* Demo-CustomQRCore */, 65 | CB8B245D1940B33A00F18015 /* Demo-CustomQRCoreTests */, 66 | CB8B24451940B33900F18015 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | CB8B24451940B33900F18015 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | CB8B24441940B33900F18015 /* Demo-CustomQRCore.app */, 74 | CB8B245A1940B33A00F18015 /* Demo-CustomQRCoreTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | CB8B24461940B33900F18015 /* Demo-CustomQRCore */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | CB8B244B1940B33900F18015 /* AppDelegate.h */, 83 | CB8B244C1940B33900F18015 /* AppDelegate.m */, 84 | CB8B244E1940B33900F18015 /* ViewController.h */, 85 | CB8B244F1940B33900F18015 /* ViewController.m */, 86 | CB8B24511940B33900F18015 /* Main.storyboard */, 87 | CB8B24541940B33900F18015 /* Images.xcassets */, 88 | CB8B24471940B33900F18015 /* Supporting Files */, 89 | ); 90 | path = "Demo-CustomQRCore"; 91 | sourceTree = ""; 92 | }; 93 | CB8B24471940B33900F18015 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | CB8B24481940B33900F18015 /* Info.plist */, 97 | CB8B24491940B33900F18015 /* main.m */, 98 | ); 99 | name = "Supporting Files"; 100 | sourceTree = ""; 101 | }; 102 | CB8B245D1940B33A00F18015 /* Demo-CustomQRCoreTests */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | CB8B24601940B33A00F18015 /* Demo_CustomQRCoreTests.m */, 106 | CB8B245E1940B33A00F18015 /* Supporting Files */, 107 | ); 108 | path = "Demo-CustomQRCoreTests"; 109 | sourceTree = ""; 110 | }; 111 | CB8B245E1940B33A00F18015 /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | CB8B245F1940B33A00F18015 /* Info.plist */, 115 | ); 116 | name = "Supporting Files"; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | CB8B24431940B33900F18015 /* Demo-CustomQRCore */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = CB8B24641940B33A00F18015 /* Build configuration list for PBXNativeTarget "Demo-CustomQRCore" */; 125 | buildPhases = ( 126 | CB8B24401940B33900F18015 /* Sources */, 127 | CB8B24411940B33900F18015 /* Frameworks */, 128 | CB8B24421940B33900F18015 /* Resources */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = "Demo-CustomQRCore"; 135 | productName = "Demo-CustomQRCore"; 136 | productReference = CB8B24441940B33900F18015 /* Demo-CustomQRCore.app */; 137 | productType = "com.apple.product-type.application"; 138 | }; 139 | CB8B24591940B33A00F18015 /* Demo-CustomQRCoreTests */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = CB8B24671940B33A00F18015 /* Build configuration list for PBXNativeTarget "Demo-CustomQRCoreTests" */; 142 | buildPhases = ( 143 | CB8B24561940B33A00F18015 /* Sources */, 144 | CB8B24571940B33A00F18015 /* Frameworks */, 145 | CB8B24581940B33A00F18015 /* Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | CB8B245C1940B33A00F18015 /* PBXTargetDependency */, 151 | ); 152 | name = "Demo-CustomQRCoreTests"; 153 | productName = "Demo-CustomQRCoreTests"; 154 | productReference = CB8B245A1940B33A00F18015 /* Demo-CustomQRCoreTests.xctest */; 155 | productType = "com.apple.product-type.bundle.unit-test"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | CB8B243C1940B33900F18015 /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastUpgradeCheck = 0600; 164 | ORGANIZATIONNAME = yourtion; 165 | TargetAttributes = { 166 | CB8B24431940B33900F18015 = { 167 | CreatedOnToolsVersion = 6.0; 168 | }; 169 | CB8B24591940B33A00F18015 = { 170 | CreatedOnToolsVersion = 6.0; 171 | TestTargetID = CB8B24431940B33900F18015; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = CB8B243F1940B33900F18015 /* Build configuration list for PBXProject "Demo-CustomQRCore" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = English; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = CB8B243B1940B33900F18015; 184 | productRefGroup = CB8B24451940B33900F18015 /* Products */; 185 | projectDirPath = ""; 186 | projectRoot = ""; 187 | targets = ( 188 | CB8B24431940B33900F18015 /* Demo-CustomQRCore */, 189 | CB8B24591940B33A00F18015 /* Demo-CustomQRCoreTests */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | CB8B24421940B33900F18015 /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | CB8B24531940B33900F18015 /* Main.storyboard in Resources */, 200 | CB8B24551940B33900F18015 /* Images.xcassets in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | CB8B24581940B33A00F18015 /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | CB8B24401940B33900F18015 /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | CB8B24501940B33900F18015 /* ViewController.m in Sources */, 219 | CB8B244D1940B33900F18015 /* AppDelegate.m in Sources */, 220 | CB8B244A1940B33900F18015 /* main.m in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | CB8B24561940B33A00F18015 /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | CB8B24611940B33A00F18015 /* Demo_CustomQRCoreTests.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | CB8B245C1940B33A00F18015 /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = CB8B24431940B33900F18015 /* Demo-CustomQRCore */; 238 | targetProxy = CB8B245B1940B33A00F18015 /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | CB8B24511940B33900F18015 /* Main.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | CB8B24521940B33900F18015 /* Base */, 247 | ); 248 | name = Main.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | CB8B24621940B33A00F18015 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_MODULES = YES; 261 | CLANG_ENABLE_OBJC_ARC = YES; 262 | CLANG_WARN_BOOL_CONVERSION = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | ENABLE_STRICT_OBJC_MSGSEND = YES; 274 | GCC_C_LANGUAGE_STANDARD = gnu99; 275 | GCC_DYNAMIC_NO_PIC = NO; 276 | GCC_OPTIMIZATION_LEVEL = 0; 277 | GCC_PREPROCESSOR_DEFINITIONS = ( 278 | "DEBUG=1", 279 | "$(inherited)", 280 | ); 281 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 289 | METAL_ENABLE_DEBUG_INFO = YES; 290 | ONLY_ACTIVE_ARCH = YES; 291 | SDKROOT = iphoneos; 292 | }; 293 | name = Debug; 294 | }; 295 | CB8B24631940B33A00F18015 /* Release */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 300 | CLANG_CXX_LIBRARY = "libc++"; 301 | CLANG_ENABLE_MODULES = YES; 302 | CLANG_ENABLE_OBJC_ARC = YES; 303 | CLANG_WARN_BOOL_CONVERSION = YES; 304 | CLANG_WARN_CONSTANT_CONVERSION = YES; 305 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 306 | CLANG_WARN_EMPTY_BODY = YES; 307 | CLANG_WARN_ENUM_CONVERSION = YES; 308 | CLANG_WARN_INT_CONVERSION = YES; 309 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 310 | CLANG_WARN_UNREACHABLE_CODE = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 313 | COPY_PHASE_STRIP = YES; 314 | ENABLE_NS_ASSERTIONS = NO; 315 | ENABLE_STRICT_OBJC_MSGSEND = YES; 316 | GCC_C_LANGUAGE_STANDARD = gnu99; 317 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 318 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 319 | GCC_WARN_UNDECLARED_SELECTOR = YES; 320 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 321 | GCC_WARN_UNUSED_FUNCTION = YES; 322 | GCC_WARN_UNUSED_VARIABLE = YES; 323 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 324 | METAL_ENABLE_DEBUG_INFO = NO; 325 | SDKROOT = iphoneos; 326 | VALIDATE_PRODUCT = YES; 327 | }; 328 | name = Release; 329 | }; 330 | CB8B24651940B33A00F18015 /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 334 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 335 | INFOPLIST_FILE = "Demo-CustomQRCore/Info.plist"; 336 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 337 | PRODUCT_NAME = "$(TARGET_NAME)"; 338 | }; 339 | name = Debug; 340 | }; 341 | CB8B24661940B33A00F18015 /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 345 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 346 | INFOPLIST_FILE = "Demo-CustomQRCore/Info.plist"; 347 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 348 | PRODUCT_NAME = "$(TARGET_NAME)"; 349 | }; 350 | name = Release; 351 | }; 352 | CB8B24681940B33A00F18015 /* Debug */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo-CustomQRCore.app/Demo-CustomQRCore"; 356 | FRAMEWORK_SEARCH_PATHS = ( 357 | "$(SDKROOT)/Developer/Library/Frameworks", 358 | "$(inherited)", 359 | ); 360 | GCC_PREPROCESSOR_DEFINITIONS = ( 361 | "DEBUG=1", 362 | "$(inherited)", 363 | ); 364 | INFOPLIST_FILE = "Demo-CustomQRCoreTests/Info.plist"; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 366 | METAL_ENABLE_DEBUG_INFO = YES; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | TEST_HOST = "$(BUNDLE_LOADER)"; 369 | }; 370 | name = Debug; 371 | }; 372 | CB8B24691940B33A00F18015 /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo-CustomQRCore.app/Demo-CustomQRCore"; 376 | FRAMEWORK_SEARCH_PATHS = ( 377 | "$(SDKROOT)/Developer/Library/Frameworks", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = "Demo-CustomQRCoreTests/Info.plist"; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | METAL_ENABLE_DEBUG_INFO = NO; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | TEST_HOST = "$(BUNDLE_LOADER)"; 385 | }; 386 | name = Release; 387 | }; 388 | /* End XCBuildConfiguration section */ 389 | 390 | /* Begin XCConfigurationList section */ 391 | CB8B243F1940B33900F18015 /* Build configuration list for PBXProject "Demo-CustomQRCore" */ = { 392 | isa = XCConfigurationList; 393 | buildConfigurations = ( 394 | CB8B24621940B33A00F18015 /* Debug */, 395 | CB8B24631940B33A00F18015 /* Release */, 396 | ); 397 | defaultConfigurationIsVisible = 0; 398 | defaultConfigurationName = Release; 399 | }; 400 | CB8B24641940B33A00F18015 /* Build configuration list for PBXNativeTarget "Demo-CustomQRCore" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | CB8B24651940B33A00F18015 /* Debug */, 404 | CB8B24661940B33A00F18015 /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | }; 408 | CB8B24671940B33A00F18015 /* Build configuration list for PBXNativeTarget "Demo-CustomQRCoreTests" */ = { 409 | isa = XCConfigurationList; 410 | buildConfigurations = ( 411 | CB8B24681940B33A00F18015 /* Debug */, 412 | CB8B24691940B33A00F18015 /* Release */, 413 | ); 414 | defaultConfigurationIsVisible = 0; 415 | }; 416 | /* End XCConfigurationList section */ 417 | }; 418 | rootObject = CB8B243C1940B33900F18015 /* Project object */; 419 | } 420 | -------------------------------------------------------------------------------- /Demo-CustomQRCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo-CustomQRCore 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Demo-CustomQRCore 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // 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. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | // 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. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | // 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. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/Base.lproj/Main.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Demo-CustomQRCore/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Demo-CustomQRCore/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | yourtion.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Demo-CustomQRCore 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Demo-CustomQRCore 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | @property (strong, nonatomic) IBOutlet UIImageView *qrcodeView; 13 | 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | UIImage *qrcode = [self createNonInterpolatedUIImageFormCIImage:[self createQRForString:@"http://blog.yourtion.com"] withSize:250.0f]; 23 | UIImage *customQrcode = [self imageBlackToTransparent:qrcode withRed:60.0f andGreen:74.0f andBlue:89.0f]; 24 | self.qrcodeView.image = customQrcode; 25 | // set shadow 26 | self.qrcodeView.layer.shadowOffset = CGSizeMake(0, 2); 27 | self.qrcodeView.layer.shadowRadius = 2; 28 | self.qrcodeView.layer.shadowColor = [UIColor blackColor].CGColor; 29 | self.qrcodeView.layer.shadowOpacity = 0.5; 30 | } 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | 37 | #pragma mark - InterpolatedUIImage 38 | - (UIImage *)createNonInterpolatedUIImageFormCIImage:(CIImage *)image withSize:(CGFloat) size { 39 | CGRect extent = CGRectIntegral(image.extent); 40 | CGFloat scale = MIN(size/CGRectGetWidth(extent), size/CGRectGetHeight(extent)); 41 | // create a bitmap image that we'll draw into a bitmap context at the desired size; 42 | size_t width = CGRectGetWidth(extent) * scale; 43 | size_t height = CGRectGetHeight(extent) * scale; 44 | CGColorSpaceRef cs = CGColorSpaceCreateDeviceGray(); 45 | CGContextRef bitmapRef = CGBitmapContextCreate(nil, width, height, 8, 0, cs, (CGBitmapInfo)kCGImageAlphaNone); 46 | CIContext *context = [CIContext contextWithOptions:nil]; 47 | CGImageRef bitmapImage = [context createCGImage:image fromRect:extent]; 48 | CGContextSetInterpolationQuality(bitmapRef, kCGInterpolationNone); 49 | CGContextScaleCTM(bitmapRef, scale, scale); 50 | CGContextDrawImage(bitmapRef, extent, bitmapImage); 51 | // Create an image with the contents of our bitmap 52 | CGImageRef scaledImage = CGBitmapContextCreateImage(bitmapRef); 53 | // Cleanup 54 | CGContextRelease(bitmapRef); 55 | CGImageRelease(bitmapImage); 56 | return [UIImage imageWithCGImage:scaledImage]; 57 | } 58 | 59 | #pragma mark - QRCodeGenerator 60 | - (CIImage *)createQRForString:(NSString *)qrString { 61 | // Need to convert the string to a UTF-8 encoded NSData object 62 | NSData *stringData = [qrString dataUsingEncoding:NSUTF8StringEncoding]; 63 | // Create the filter 64 | CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; 65 | // Set the message content and error-correction level 66 | [qrFilter setValue:stringData forKey:@"inputMessage"]; 67 | [qrFilter setValue:@"M" forKey:@"inputCorrectionLevel"]; 68 | // Send the image back 69 | return qrFilter.outputImage; 70 | } 71 | 72 | #pragma mark - imageToTransparent 73 | void ProviderReleaseData (void *info, const void *data, size_t size){ 74 | free((void*)data); 75 | } 76 | - (UIImage*)imageBlackToTransparent:(UIImage*)image withRed:(CGFloat)red andGreen:(CGFloat)green andBlue:(CGFloat)blue{ 77 | const int imageWidth = image.size.width; 78 | const int imageHeight = image.size.height; 79 | size_t bytesPerRow = imageWidth * 4; 80 | uint32_t* rgbImageBuf = (uint32_t*)malloc(bytesPerRow * imageHeight); 81 | // create context 82 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 83 | CGContextRef context = CGBitmapContextCreate(rgbImageBuf, imageWidth, imageHeight, 8, bytesPerRow, colorSpace, 84 | kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast); 85 | CGContextDrawImage(context, CGRectMake(0, 0, imageWidth, imageHeight), image.CGImage); 86 | // traverse pixe 87 | int pixelNum = imageWidth * imageHeight; 88 | uint32_t* pCurPtr = rgbImageBuf; 89 | for (int i = 0; i < pixelNum; i++, pCurPtr++){ 90 | if ((*pCurPtr & 0xFFFFFF00) < 0x99999900){ 91 | // change color 92 | uint8_t* ptr = (uint8_t*)pCurPtr; 93 | ptr[3] = red; //0~255 94 | ptr[2] = green; 95 | ptr[1] = blue; 96 | }else{ 97 | uint8_t* ptr = (uint8_t*)pCurPtr; 98 | ptr[0] = 0; 99 | } 100 | } 101 | // context to image 102 | CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, rgbImageBuf, bytesPerRow * imageHeight, ProviderReleaseData); 103 | CGImageRef imageRef = CGImageCreate(imageWidth, imageHeight, 8, 32, bytesPerRow, colorSpace, 104 | kCGImageAlphaLast | kCGBitmapByteOrder32Little, dataProvider, 105 | NULL, true, kCGRenderingIntentDefault); 106 | CGDataProviderRelease(dataProvider); 107 | UIImage* resultUIImage = [UIImage imageWithCGImage:imageRef]; 108 | // release 109 | CGImageRelease(imageRef); 110 | CGContextRelease(context); 111 | CGColorSpaceRelease(colorSpace); 112 | return resultUIImage; 113 | } 114 | @end 115 | -------------------------------------------------------------------------------- /Demo-CustomQRCore/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo-CustomQRCore 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demo-CustomQRCoreTests/Demo_CustomQRCoreTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Demo_CustomQRCoreTests.m 3 | // Demo-CustomQRCoreTests 4 | // 5 | // Created by YourtionGuo on 6/5/14. 6 | // Copyright (c) 2014 yourtion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Demo_CustomQRCoreTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Demo_CustomQRCoreTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | XCTAssert(YES, @"Pass"); 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Demo-CustomQRCoreTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | yourtion.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Demo-CustomQRCode 2 | ================= 3 | 4 | Demo for CustomQRCode( http://blog.yourtion.com/custom-cifilter-qrcode-generator.html ) 5 | 6 | ScreenShot: 7 | 8 | ![](ScreenShot.png) -------------------------------------------------------------------------------- /ScreenShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelenLiu/Demo_CustomQRCode/d98090202f7a3681d26377ac7a0233632cdf6588/ScreenShot.png --------------------------------------------------------------------------------