├── README.md ├── Test.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── jsantiago.xcuserdatad │ └── xcschemes │ ├── Test.xcscheme │ └── xcschememanagement.plist ├── Test ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── Main_iPad.storyboard │ └── Main_iPhone.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Test-Info.plist ├── Test-Prefix.pch ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m └── TestTests ├── TestTests-Info.plist ├── TestTests.m └── en.lproj └── InfoPlist.strings /README.md: -------------------------------------------------------------------------------- 1 | # Detecting Home button vs Lock button - iOS 7 2 | 3 | 4 | This project describes how to detect when a user presses the home button to leave your application and when they press the lock button to put your app into the background. 5 | 6 | 7 | It utilizes CSNotificationCenter to detect Darwin notifications. 8 | 9 | 10 | *credit goes out to [wqq on stackoverflow](http://stackoverflow.com/users/889286/wqq)* 11 | -------------------------------------------------------------------------------- /Test.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D2171B7E18B659F9004095FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B7D18B659F9004095FA /* Foundation.framework */; }; 11 | D2171B8018B659F9004095FA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B7F18B659F9004095FA /* CoreGraphics.framework */; }; 12 | D2171B8218B659F9004095FA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B8118B659F9004095FA /* UIKit.framework */; }; 13 | D2171B8818B659F9004095FA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D2171B8618B659F9004095FA /* InfoPlist.strings */; }; 14 | D2171B8A18B659F9004095FA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D2171B8918B659F9004095FA /* main.m */; }; 15 | D2171B8E18B659F9004095FA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D2171B8D18B659F9004095FA /* AppDelegate.m */; }; 16 | D2171B9118B659F9004095FA /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2171B8F18B659F9004095FA /* Main_iPhone.storyboard */; }; 17 | D2171B9418B659F9004095FA /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2171B9218B659F9004095FA /* Main_iPad.storyboard */; }; 18 | D2171B9718B659F9004095FA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2171B9618B659F9004095FA /* ViewController.m */; }; 19 | D2171B9918B659F9004095FA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D2171B9818B659F9004095FA /* Images.xcassets */; }; 20 | D2171BA018B659F9004095FA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B9F18B659F9004095FA /* XCTest.framework */; }; 21 | D2171BA118B659F9004095FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B7D18B659F9004095FA /* Foundation.framework */; }; 22 | D2171BA218B659F9004095FA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2171B8118B659F9004095FA /* UIKit.framework */; }; 23 | D2171BAA18B659F9004095FA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D2171BA818B659F9004095FA /* InfoPlist.strings */; }; 24 | D2171BAC18B659F9004095FA /* TestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D2171BAB18B659F9004095FA /* TestTests.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | D2171BA318B659F9004095FA /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = D2171B7218B659F9004095FA /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = D2171B7918B659F9004095FA; 33 | remoteInfo = Test; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | D2171B7A18B659F9004095FA /* Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Test.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | D2171B7D18B659F9004095FA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | D2171B7F18B659F9004095FA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | D2171B8118B659F9004095FA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | D2171B8518B659F9004095FA /* Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Test-Info.plist"; sourceTree = ""; }; 43 | D2171B8718B659F9004095FA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | D2171B8918B659F9004095FA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | D2171B8B18B659F9004095FA /* Test-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Test-Prefix.pch"; sourceTree = ""; }; 46 | D2171B8C18B659F9004095FA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | D2171B8D18B659F9004095FA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | D2171B9018B659F9004095FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 49 | D2171B9318B659F9004095FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 50 | D2171B9518B659F9004095FA /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | D2171B9618B659F9004095FA /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 52 | D2171B9818B659F9004095FA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | D2171B9E18B659F9004095FA /* TestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | D2171B9F18B659F9004095FA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 55 | D2171BA718B659F9004095FA /* TestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestTests-Info.plist"; sourceTree = ""; }; 56 | D2171BA918B659F9004095FA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | D2171BAB18B659F9004095FA /* TestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestTests.m; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | D2171B7718B659F9004095FA /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | D2171B8018B659F9004095FA /* CoreGraphics.framework in Frameworks */, 66 | D2171B8218B659F9004095FA /* UIKit.framework in Frameworks */, 67 | D2171B7E18B659F9004095FA /* Foundation.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | D2171B9B18B659F9004095FA /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | D2171BA018B659F9004095FA /* XCTest.framework in Frameworks */, 76 | D2171BA218B659F9004095FA /* UIKit.framework in Frameworks */, 77 | D2171BA118B659F9004095FA /* Foundation.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | D2171B7118B659F9004095FA = { 85 | isa = PBXGroup; 86 | children = ( 87 | D2171B8318B659F9004095FA /* Test */, 88 | D2171BA518B659F9004095FA /* TestTests */, 89 | D2171B7C18B659F9004095FA /* Frameworks */, 90 | D2171B7B18B659F9004095FA /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | D2171B7B18B659F9004095FA /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | D2171B7A18B659F9004095FA /* Test.app */, 98 | D2171B9E18B659F9004095FA /* TestTests.xctest */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | D2171B7C18B659F9004095FA /* Frameworks */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | D2171B7D18B659F9004095FA /* Foundation.framework */, 107 | D2171B7F18B659F9004095FA /* CoreGraphics.framework */, 108 | D2171B8118B659F9004095FA /* UIKit.framework */, 109 | D2171B9F18B659F9004095FA /* XCTest.framework */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | D2171B8318B659F9004095FA /* Test */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | D2171B8C18B659F9004095FA /* AppDelegate.h */, 118 | D2171B8D18B659F9004095FA /* AppDelegate.m */, 119 | D2171B8F18B659F9004095FA /* Main_iPhone.storyboard */, 120 | D2171B9218B659F9004095FA /* Main_iPad.storyboard */, 121 | D2171B9518B659F9004095FA /* ViewController.h */, 122 | D2171B9618B659F9004095FA /* ViewController.m */, 123 | D2171B9818B659F9004095FA /* Images.xcassets */, 124 | D2171B8418B659F9004095FA /* Supporting Files */, 125 | ); 126 | path = Test; 127 | sourceTree = ""; 128 | }; 129 | D2171B8418B659F9004095FA /* Supporting Files */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | D2171B8518B659F9004095FA /* Test-Info.plist */, 133 | D2171B8618B659F9004095FA /* InfoPlist.strings */, 134 | D2171B8918B659F9004095FA /* main.m */, 135 | D2171B8B18B659F9004095FA /* Test-Prefix.pch */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | D2171BA518B659F9004095FA /* TestTests */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | D2171BAB18B659F9004095FA /* TestTests.m */, 144 | D2171BA618B659F9004095FA /* Supporting Files */, 145 | ); 146 | path = TestTests; 147 | sourceTree = ""; 148 | }; 149 | D2171BA618B659F9004095FA /* Supporting Files */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | D2171BA718B659F9004095FA /* TestTests-Info.plist */, 153 | D2171BA818B659F9004095FA /* InfoPlist.strings */, 154 | ); 155 | name = "Supporting Files"; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | D2171B7918B659F9004095FA /* Test */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = D2171BAF18B659F9004095FA /* Build configuration list for PBXNativeTarget "Test" */; 164 | buildPhases = ( 165 | D2171B7618B659F9004095FA /* Sources */, 166 | D2171B7718B659F9004095FA /* Frameworks */, 167 | D2171B7818B659F9004095FA /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = Test; 174 | productName = Test; 175 | productReference = D2171B7A18B659F9004095FA /* Test.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | D2171B9D18B659F9004095FA /* TestTests */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = D2171BB218B659F9004095FA /* Build configuration list for PBXNativeTarget "TestTests" */; 181 | buildPhases = ( 182 | D2171B9A18B659F9004095FA /* Sources */, 183 | D2171B9B18B659F9004095FA /* Frameworks */, 184 | D2171B9C18B659F9004095FA /* Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | D2171BA418B659F9004095FA /* PBXTargetDependency */, 190 | ); 191 | name = TestTests; 192 | productName = TestTests; 193 | productReference = D2171B9E18B659F9004095FA /* TestTests.xctest */; 194 | productType = "com.apple.product-type.bundle.unit-test"; 195 | }; 196 | /* End PBXNativeTarget section */ 197 | 198 | /* Begin PBXProject section */ 199 | D2171B7218B659F9004095FA /* Project object */ = { 200 | isa = PBXProject; 201 | attributes = { 202 | LastUpgradeCheck = 0500; 203 | ORGANIZATIONNAME = "IMP Digital Studios"; 204 | TargetAttributes = { 205 | D2171B9D18B659F9004095FA = { 206 | TestTargetID = D2171B7918B659F9004095FA; 207 | }; 208 | }; 209 | }; 210 | buildConfigurationList = D2171B7518B659F9004095FA /* Build configuration list for PBXProject "Test" */; 211 | compatibilityVersion = "Xcode 3.2"; 212 | developmentRegion = English; 213 | hasScannedForEncodings = 0; 214 | knownRegions = ( 215 | en, 216 | Base, 217 | ); 218 | mainGroup = D2171B7118B659F9004095FA; 219 | productRefGroup = D2171B7B18B659F9004095FA /* Products */; 220 | projectDirPath = ""; 221 | projectRoot = ""; 222 | targets = ( 223 | D2171B7918B659F9004095FA /* Test */, 224 | D2171B9D18B659F9004095FA /* TestTests */, 225 | ); 226 | }; 227 | /* End PBXProject section */ 228 | 229 | /* Begin PBXResourcesBuildPhase section */ 230 | D2171B7818B659F9004095FA /* Resources */ = { 231 | isa = PBXResourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | D2171B9418B659F9004095FA /* Main_iPad.storyboard in Resources */, 235 | D2171B9918B659F9004095FA /* Images.xcassets in Resources */, 236 | D2171B9118B659F9004095FA /* Main_iPhone.storyboard in Resources */, 237 | D2171B8818B659F9004095FA /* InfoPlist.strings in Resources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | D2171B9C18B659F9004095FA /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | D2171BAA18B659F9004095FA /* InfoPlist.strings in Resources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXResourcesBuildPhase section */ 250 | 251 | /* Begin PBXSourcesBuildPhase section */ 252 | D2171B7618B659F9004095FA /* Sources */ = { 253 | isa = PBXSourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | D2171B9718B659F9004095FA /* ViewController.m in Sources */, 257 | D2171B8E18B659F9004095FA /* AppDelegate.m in Sources */, 258 | D2171B8A18B659F9004095FA /* main.m in Sources */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | D2171B9A18B659F9004095FA /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | D2171BAC18B659F9004095FA /* TestTests.m in Sources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXSourcesBuildPhase section */ 271 | 272 | /* Begin PBXTargetDependency section */ 273 | D2171BA418B659F9004095FA /* PBXTargetDependency */ = { 274 | isa = PBXTargetDependency; 275 | target = D2171B7918B659F9004095FA /* Test */; 276 | targetProxy = D2171BA318B659F9004095FA /* PBXContainerItemProxy */; 277 | }; 278 | /* End PBXTargetDependency section */ 279 | 280 | /* Begin PBXVariantGroup section */ 281 | D2171B8618B659F9004095FA /* InfoPlist.strings */ = { 282 | isa = PBXVariantGroup; 283 | children = ( 284 | D2171B8718B659F9004095FA /* en */, 285 | ); 286 | name = InfoPlist.strings; 287 | sourceTree = ""; 288 | }; 289 | D2171B8F18B659F9004095FA /* Main_iPhone.storyboard */ = { 290 | isa = PBXVariantGroup; 291 | children = ( 292 | D2171B9018B659F9004095FA /* Base */, 293 | ); 294 | name = Main_iPhone.storyboard; 295 | sourceTree = ""; 296 | }; 297 | D2171B9218B659F9004095FA /* Main_iPad.storyboard */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | D2171B9318B659F9004095FA /* Base */, 301 | ); 302 | name = Main_iPad.storyboard; 303 | sourceTree = ""; 304 | }; 305 | D2171BA818B659F9004095FA /* InfoPlist.strings */ = { 306 | isa = PBXVariantGroup; 307 | children = ( 308 | D2171BA918B659F9004095FA /* en */, 309 | ); 310 | name = InfoPlist.strings; 311 | sourceTree = ""; 312 | }; 313 | /* End PBXVariantGroup section */ 314 | 315 | /* Begin XCBuildConfiguration section */ 316 | D2171BAD18B659F9004095FA /* Debug */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ALWAYS_SEARCH_USER_PATHS = NO; 320 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 322 | CLANG_CXX_LIBRARY = "libc++"; 323 | CLANG_ENABLE_MODULES = YES; 324 | CLANG_ENABLE_OBJC_ARC = YES; 325 | CLANG_WARN_BOOL_CONVERSION = YES; 326 | CLANG_WARN_CONSTANT_CONVERSION = YES; 327 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 328 | CLANG_WARN_EMPTY_BODY = YES; 329 | CLANG_WARN_ENUM_CONVERSION = YES; 330 | CLANG_WARN_INT_CONVERSION = YES; 331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 334 | COPY_PHASE_STRIP = NO; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_OPTIMIZATION_LEVEL = 0; 338 | GCC_PREPROCESSOR_DEFINITIONS = ( 339 | "DEBUG=1", 340 | "$(inherited)", 341 | ); 342 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 350 | ONLY_ACTIVE_ARCH = YES; 351 | SDKROOT = iphoneos; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | }; 354 | name = Debug; 355 | }; 356 | D2171BAE18B659F9004095FA /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 361 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 362 | CLANG_CXX_LIBRARY = "libc++"; 363 | CLANG_ENABLE_MODULES = YES; 364 | CLANG_ENABLE_OBJC_ARC = YES; 365 | CLANG_WARN_BOOL_CONVERSION = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = YES; 375 | ENABLE_NS_ASSERTIONS = NO; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 384 | SDKROOT = iphoneos; 385 | TARGETED_DEVICE_FAMILY = "1,2"; 386 | VALIDATE_PRODUCT = YES; 387 | }; 388 | name = Release; 389 | }; 390 | D2171BB018B659F9004095FA /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 394 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 395 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 396 | GCC_PREFIX_HEADER = "Test/Test-Prefix.pch"; 397 | INFOPLIST_FILE = "Test/Test-Info.plist"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | WRAPPER_EXTENSION = app; 400 | }; 401 | name = Debug; 402 | }; 403 | D2171BB118B659F9004095FA /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 407 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 408 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 409 | GCC_PREFIX_HEADER = "Test/Test-Prefix.pch"; 410 | INFOPLIST_FILE = "Test/Test-Info.plist"; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | WRAPPER_EXTENSION = app; 413 | }; 414 | name = Release; 415 | }; 416 | D2171BB318B659F9004095FA /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 420 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Test.app/Test"; 421 | FRAMEWORK_SEARCH_PATHS = ( 422 | "$(SDKROOT)/Developer/Library/Frameworks", 423 | "$(inherited)", 424 | "$(DEVELOPER_FRAMEWORKS_DIR)", 425 | ); 426 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 427 | GCC_PREFIX_HEADER = "Test/Test-Prefix.pch"; 428 | GCC_PREPROCESSOR_DEFINITIONS = ( 429 | "DEBUG=1", 430 | "$(inherited)", 431 | ); 432 | INFOPLIST_FILE = "TestTests/TestTests-Info.plist"; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | TEST_HOST = "$(BUNDLE_LOADER)"; 435 | WRAPPER_EXTENSION = xctest; 436 | }; 437 | name = Debug; 438 | }; 439 | D2171BB418B659F9004095FA /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 443 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Test.app/Test"; 444 | FRAMEWORK_SEARCH_PATHS = ( 445 | "$(SDKROOT)/Developer/Library/Frameworks", 446 | "$(inherited)", 447 | "$(DEVELOPER_FRAMEWORKS_DIR)", 448 | ); 449 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 450 | GCC_PREFIX_HEADER = "Test/Test-Prefix.pch"; 451 | INFOPLIST_FILE = "TestTests/TestTests-Info.plist"; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | TEST_HOST = "$(BUNDLE_LOADER)"; 454 | WRAPPER_EXTENSION = xctest; 455 | }; 456 | name = Release; 457 | }; 458 | /* End XCBuildConfiguration section */ 459 | 460 | /* Begin XCConfigurationList section */ 461 | D2171B7518B659F9004095FA /* Build configuration list for PBXProject "Test" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | D2171BAD18B659F9004095FA /* Debug */, 465 | D2171BAE18B659F9004095FA /* Release */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | D2171BAF18B659F9004095FA /* Build configuration list for PBXNativeTarget "Test" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | D2171BB018B659F9004095FA /* Debug */, 474 | D2171BB118B659F9004095FA /* Release */, 475 | ); 476 | defaultConfigurationIsVisible = 0; 477 | defaultConfigurationName = Release; 478 | }; 479 | D2171BB218B659F9004095FA /* Build configuration list for PBXNativeTarget "TestTests" */ = { 480 | isa = XCConfigurationList; 481 | buildConfigurations = ( 482 | D2171BB318B659F9004095FA /* Debug */, 483 | D2171BB418B659F9004095FA /* Release */, 484 | ); 485 | defaultConfigurationIsVisible = 0; 486 | defaultConfigurationName = Release; 487 | }; 488 | /* End XCConfigurationList section */ 489 | }; 490 | rootObject = D2171B7218B659F9004095FA /* Project object */; 491 | } 492 | -------------------------------------------------------------------------------- /Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Test.xcodeproj/xcuserdata/jsantiago.xcuserdatad/xcschemes/Test.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Test.xcodeproj/xcuserdata/jsantiago.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Test.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D2171B7918B659F9004095FA 16 | 17 | primary 18 | 19 | 20 | D2171B9D18B659F9004095FA 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Test/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Test 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Test/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Test 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | static void displayStatusChanged(CFNotificationCenterRef center, 14 | void *observer, 15 | CFStringRef name, 16 | const void *object, 17 | CFDictionaryRef userInfo) { 18 | if (name == CFSTR("com.apple.springboard.lockcomplete")) { 19 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"kDisplayStatusLocked"]; 20 | [[NSUserDefaults standardUserDefaults] synchronize]; 21 | } 22 | } 23 | 24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 25 | { 26 | // Override point for customization after application launch. 27 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), 28 | NULL, 29 | displayStatusChanged, 30 | CFSTR("com.apple.springboard.lockcomplete"), 31 | NULL, 32 | CFNotificationSuspensionBehaviorDeliverImmediately); 33 | return YES; 34 | } 35 | 36 | - (void)applicationWillResignActive:(UIApplication *)application 37 | { 38 | // 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. 39 | // 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. 40 | } 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application 43 | { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | UIApplicationState state = [[UIApplication sharedApplication] applicationState]; 47 | if (state == UIApplicationStateInactive) { 48 | NSLog(@"Sent to background by locking screen"); 49 | } else if (state == UIApplicationStateBackground) { 50 | if (![[NSUserDefaults standardUserDefaults] boolForKey:@"kDisplayStatusLocked"]) { 51 | NSLog(@"Sent to background by home button/switching to other app"); 52 | } else { 53 | NSLog(@"Sent to background by locking screen"); 54 | } 55 | } 56 | } 57 | 58 | - (void)applicationWillEnterForeground:(UIApplication *)application 59 | { 60 | // 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. 61 | [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"kDisplayStatusLocked"]; 62 | [[NSUserDefaults standardUserDefaults] synchronize]; 63 | } 64 | 65 | - (void)applicationDidBecomeActive:(UIApplication *)application 66 | { 67 | // 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. 68 | } 69 | 70 | - (void)applicationWillTerminate:(UIApplication *)application 71 | { 72 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 73 | } 74 | 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Test/Base.lproj/Main_iPad.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 | -------------------------------------------------------------------------------- /Test/Base.lproj/Main_iPhone.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 | -------------------------------------------------------------------------------- /Test/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 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Test/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 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Test/Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.your-domain.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Test/Test-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 | -------------------------------------------------------------------------------- /Test/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Test 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Test/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Test 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Test/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Test/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Test 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. 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 | -------------------------------------------------------------------------------- /TestTests/TestTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.impdigitalstudios.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TestTests/TestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestTests.m 3 | // TestTests 4 | // 5 | // Created by Jose Santiago Jr on 2/20/14. 6 | // Copyright (c) 2014 IMP Digital Studios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TestTests 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 | -------------------------------------------------------------------------------- /TestTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------