├── README.md ├── TB_InteractiveNotifications.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── TB_InteractiveNotifications.xccheckout │ └── xcuserdata │ │ └── Bitwaker.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Bitwaker.xcuserdatad │ └── xcschemes │ ├── TB_InteractiveNotifications.xcscheme │ └── xcschememanagement.plist ├── TB_InteractiveNotifications ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Counter.swift ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ └── Icon-60@2x.png ├── Info.plist └── ViewController.swift └── TB_InteractiveNotificationsTests ├── Info.plist └── TB_InteractiveNotificationsTests.swift /README.md: -------------------------------------------------------------------------------- 1 | TB_InteractiveNotifications 2 | =========================== 3 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DA9A893119D9674800FE3F92 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9A893019D9674800FE3F92 /* AppDelegate.swift */; }; 11 | DA9A893319D9674800FE3F92 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9A893219D9674800FE3F92 /* ViewController.swift */; }; 12 | DA9A893619D9674800FE3F92 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DA9A893419D9674800FE3F92 /* Main.storyboard */; }; 13 | DA9A893819D9674800FE3F92 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA9A893719D9674800FE3F92 /* Images.xcassets */; }; 14 | DA9A893B19D9674800FE3F92 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA9A893919D9674800FE3F92 /* LaunchScreen.xib */; }; 15 | DA9A894719D9674800FE3F92 /* TB_InteractiveNotificationsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9A894619D9674800FE3F92 /* TB_InteractiveNotificationsTests.swift */; }; 16 | DA9A895119D9751700FE3F92 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9A895019D9751700FE3F92 /* Counter.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | DA9A894119D9674800FE3F92 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = DA9A892319D9674800FE3F92 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = DA9A892A19D9674800FE3F92; 25 | remoteInfo = TB_InteractiveNotifications; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | DA9A892B19D9674800FE3F92 /* TB_InteractiveNotifications.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TB_InteractiveNotifications.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | DA9A892F19D9674800FE3F92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | DA9A893019D9674800FE3F92 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33 | DA9A893219D9674800FE3F92 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | DA9A893519D9674800FE3F92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 35 | DA9A893719D9674800FE3F92 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 36 | DA9A893A19D9674800FE3F92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 37 | DA9A894019D9674800FE3F92 /* TB_InteractiveNotificationsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TB_InteractiveNotificationsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | DA9A894519D9674800FE3F92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | DA9A894619D9674800FE3F92 /* TB_InteractiveNotificationsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TB_InteractiveNotificationsTests.swift; sourceTree = ""; }; 40 | DA9A895019D9751700FE3F92 /* Counter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | DA9A892819D9674800FE3F92 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | DA9A893D19D9674800FE3F92 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | DA9A892219D9674800FE3F92 = { 62 | isa = PBXGroup; 63 | children = ( 64 | DA9A892D19D9674800FE3F92 /* TB_InteractiveNotifications */, 65 | DA9A894319D9674800FE3F92 /* TB_InteractiveNotificationsTests */, 66 | DA9A892C19D9674800FE3F92 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | DA9A892C19D9674800FE3F92 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | DA9A892B19D9674800FE3F92 /* TB_InteractiveNotifications.app */, 74 | DA9A894019D9674800FE3F92 /* TB_InteractiveNotificationsTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | DA9A892D19D9674800FE3F92 /* TB_InteractiveNotifications */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | DA9A893019D9674800FE3F92 /* AppDelegate.swift */, 83 | DA9A893219D9674800FE3F92 /* ViewController.swift */, 84 | DA9A893419D9674800FE3F92 /* Main.storyboard */, 85 | DA9A893719D9674800FE3F92 /* Images.xcassets */, 86 | DA9A893919D9674800FE3F92 /* LaunchScreen.xib */, 87 | DA9A892E19D9674800FE3F92 /* Supporting Files */, 88 | DA9A895019D9751700FE3F92 /* Counter.swift */, 89 | ); 90 | path = TB_InteractiveNotifications; 91 | sourceTree = ""; 92 | }; 93 | DA9A892E19D9674800FE3F92 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | DA9A892F19D9674800FE3F92 /* Info.plist */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | DA9A894319D9674800FE3F92 /* TB_InteractiveNotificationsTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | DA9A894619D9674800FE3F92 /* TB_InteractiveNotificationsTests.swift */, 105 | DA9A894419D9674800FE3F92 /* Supporting Files */, 106 | ); 107 | path = TB_InteractiveNotificationsTests; 108 | sourceTree = ""; 109 | }; 110 | DA9A894419D9674800FE3F92 /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | DA9A894519D9674800FE3F92 /* Info.plist */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | DA9A892A19D9674800FE3F92 /* TB_InteractiveNotifications */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = DA9A894A19D9674800FE3F92 /* Build configuration list for PBXNativeTarget "TB_InteractiveNotifications" */; 124 | buildPhases = ( 125 | DA9A892719D9674800FE3F92 /* Sources */, 126 | DA9A892819D9674800FE3F92 /* Frameworks */, 127 | DA9A892919D9674800FE3F92 /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = TB_InteractiveNotifications; 134 | productName = TB_InteractiveNotifications; 135 | productReference = DA9A892B19D9674800FE3F92 /* TB_InteractiveNotifications.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | DA9A893F19D9674800FE3F92 /* TB_InteractiveNotificationsTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = DA9A894D19D9674800FE3F92 /* Build configuration list for PBXNativeTarget "TB_InteractiveNotificationsTests" */; 141 | buildPhases = ( 142 | DA9A893C19D9674800FE3F92 /* Sources */, 143 | DA9A893D19D9674800FE3F92 /* Frameworks */, 144 | DA9A893E19D9674800FE3F92 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | DA9A894219D9674800FE3F92 /* PBXTargetDependency */, 150 | ); 151 | name = TB_InteractiveNotificationsTests; 152 | productName = TB_InteractiveNotificationsTests; 153 | productReference = DA9A894019D9674800FE3F92 /* TB_InteractiveNotificationsTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | DA9A892319D9674800FE3F92 /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 0600; 163 | ORGANIZATIONNAME = "Yari D'areglia"; 164 | TargetAttributes = { 165 | DA9A892A19D9674800FE3F92 = { 166 | CreatedOnToolsVersion = 6.0; 167 | }; 168 | DA9A893F19D9674800FE3F92 = { 169 | CreatedOnToolsVersion = 6.0; 170 | TestTargetID = DA9A892A19D9674800FE3F92; 171 | }; 172 | }; 173 | }; 174 | buildConfigurationList = DA9A892619D9674800FE3F92 /* Build configuration list for PBXProject "TB_InteractiveNotifications" */; 175 | compatibilityVersion = "Xcode 3.2"; 176 | developmentRegion = English; 177 | hasScannedForEncodings = 0; 178 | knownRegions = ( 179 | en, 180 | Base, 181 | ); 182 | mainGroup = DA9A892219D9674800FE3F92; 183 | productRefGroup = DA9A892C19D9674800FE3F92 /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | DA9A892A19D9674800FE3F92 /* TB_InteractiveNotifications */, 188 | DA9A893F19D9674800FE3F92 /* TB_InteractiveNotificationsTests */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | DA9A892919D9674800FE3F92 /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | DA9A893619D9674800FE3F92 /* Main.storyboard in Resources */, 199 | DA9A893B19D9674800FE3F92 /* LaunchScreen.xib in Resources */, 200 | DA9A893819D9674800FE3F92 /* Images.xcassets in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | DA9A893E19D9674800FE3F92 /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | DA9A892719D9674800FE3F92 /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | DA9A893319D9674800FE3F92 /* ViewController.swift in Sources */, 219 | DA9A893119D9674800FE3F92 /* AppDelegate.swift in Sources */, 220 | DA9A895119D9751700FE3F92 /* Counter.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | DA9A893C19D9674800FE3F92 /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | DA9A894719D9674800FE3F92 /* TB_InteractiveNotificationsTests.swift in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | DA9A894219D9674800FE3F92 /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = DA9A892A19D9674800FE3F92 /* TB_InteractiveNotifications */; 238 | targetProxy = DA9A894119D9674800FE3F92 /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | DA9A893419D9674800FE3F92 /* Main.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | DA9A893519D9674800FE3F92 /* Base */, 247 | ); 248 | name = Main.storyboard; 249 | sourceTree = ""; 250 | }; 251 | DA9A893919D9674800FE3F92 /* LaunchScreen.xib */ = { 252 | isa = PBXVariantGroup; 253 | children = ( 254 | DA9A893A19D9674800FE3F92 /* Base */, 255 | ); 256 | name = LaunchScreen.xib; 257 | sourceTree = ""; 258 | }; 259 | /* End PBXVariantGroup section */ 260 | 261 | /* Begin XCBuildConfiguration section */ 262 | DA9A894819D9674800FE3F92 /* Debug */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ALWAYS_SEARCH_USER_PATHS = NO; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BOOL_CONVERSION = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu99; 283 | GCC_DYNAMIC_NO_PIC = NO; 284 | GCC_OPTIMIZATION_LEVEL = 0; 285 | GCC_PREPROCESSOR_DEFINITIONS = ( 286 | "DEBUG=1", 287 | "$(inherited)", 288 | ); 289 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = YES; 298 | ONLY_ACTIVE_ARCH = YES; 299 | SDKROOT = iphoneos; 300 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 301 | }; 302 | name = Debug; 303 | }; 304 | DA9A894919D9674800FE3F92 /* Release */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 322 | COPY_PHASE_STRIP = YES; 323 | ENABLE_NS_ASSERTIONS = NO; 324 | ENABLE_STRICT_OBJC_MSGSEND = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 328 | GCC_WARN_UNDECLARED_SELECTOR = YES; 329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 330 | GCC_WARN_UNUSED_FUNCTION = YES; 331 | GCC_WARN_UNUSED_VARIABLE = YES; 332 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 333 | MTL_ENABLE_DEBUG_INFO = NO; 334 | SDKROOT = iphoneos; 335 | VALIDATE_PRODUCT = YES; 336 | }; 337 | name = Release; 338 | }; 339 | DA9A894B19D9674800FE3F92 /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 343 | INFOPLIST_FILE = TB_InteractiveNotifications/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 345 | PRODUCT_NAME = "$(TARGET_NAME)"; 346 | }; 347 | name = Debug; 348 | }; 349 | DA9A894C19D9674800FE3F92 /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | INFOPLIST_FILE = TB_InteractiveNotifications/Info.plist; 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | }; 357 | name = Release; 358 | }; 359 | DA9A894E19D9674800FE3F92 /* Debug */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | BUNDLE_LOADER = "$(TEST_HOST)"; 363 | FRAMEWORK_SEARCH_PATHS = ( 364 | "$(SDKROOT)/Developer/Library/Frameworks", 365 | "$(inherited)", 366 | ); 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | INFOPLIST_FILE = TB_InteractiveNotificationsTests/Info.plist; 372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 373 | PRODUCT_NAME = "$(TARGET_NAME)"; 374 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TB_InteractiveNotifications.app/TB_InteractiveNotifications"; 375 | }; 376 | name = Debug; 377 | }; 378 | DA9A894F19D9674800FE3F92 /* Release */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | BUNDLE_LOADER = "$(TEST_HOST)"; 382 | FRAMEWORK_SEARCH_PATHS = ( 383 | "$(SDKROOT)/Developer/Library/Frameworks", 384 | "$(inherited)", 385 | ); 386 | INFOPLIST_FILE = TB_InteractiveNotificationsTests/Info.plist; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TB_InteractiveNotifications.app/TB_InteractiveNotifications"; 390 | }; 391 | name = Release; 392 | }; 393 | /* End XCBuildConfiguration section */ 394 | 395 | /* Begin XCConfigurationList section */ 396 | DA9A892619D9674800FE3F92 /* Build configuration list for PBXProject "TB_InteractiveNotifications" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | DA9A894819D9674800FE3F92 /* Debug */, 400 | DA9A894919D9674800FE3F92 /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | DA9A894A19D9674800FE3F92 /* Build configuration list for PBXNativeTarget "TB_InteractiveNotifications" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | DA9A894B19D9674800FE3F92 /* Debug */, 409 | DA9A894C19D9674800FE3F92 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | DA9A894D19D9674800FE3F92 /* Build configuration list for PBXNativeTarget "TB_InteractiveNotificationsTests" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | DA9A894E19D9674800FE3F92 /* Debug */, 418 | DA9A894F19D9674800FE3F92 /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | defaultConfigurationName = Release; 422 | }; 423 | /* End XCConfigurationList section */ 424 | }; 425 | rootObject = DA9A892319D9674800FE3F92 /* Project object */; 426 | } 427 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/project.xcworkspace/xcshareddata/TB_InteractiveNotifications.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | B54B4F8C-B5C9-425A-AD93-EE9E95E101D3 9 | IDESourceControlProjectName 10 | TB_InteractiveNotifications 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | EC0145EE77D99183990657B5570111333262E864 14 | https://github.com/ariok/TB_InteractiveNotifications.git 15 | 16 | IDESourceControlProjectPath 17 | TB_InteractiveNotifications.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | EC0145EE77D99183990657B5570111333262E864 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/ariok/TB_InteractiveNotifications.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | EC0145EE77D99183990657B5570111333262E864 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | EC0145EE77D99183990657B5570111333262E864 36 | IDESourceControlWCCName 37 | TB_InteractiveNotifications 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/project.xcworkspace/xcuserdata/Bitwaker.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ariok/TB_InteractiveNotifications/f8509f00ee7235322281367785ee971d1307d3d1/TB_InteractiveNotifications.xcodeproj/project.xcworkspace/xcuserdata/Bitwaker.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/xcuserdata/Bitwaker.xcuserdatad/xcschemes/TB_InteractiveNotifications.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications.xcodeproj/xcuserdata/Bitwaker.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TB_InteractiveNotifications.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DA9A892A19D9674800FE3F92 16 | 17 | primary 18 | 19 | 20 | DA9A893F19D9674800FE3F92 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TB_InteractiveNotifications 4 | // 5 | // Created by Yari D'areglia on 29/09/14. 6 | // Copyright (c) 2014 Yari D'areglia. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | enum Actions:String{ 16 | case increment = "INCREMENT_ACTION" 17 | case decrement = "DECREMENT_ACTION" 18 | case reset = "RESET_ACTION" 19 | } 20 | 21 | var categoryID:String { 22 | get{ 23 | return "COUNTER_CATEGORY" 24 | } 25 | } 26 | 27 | var window: UIWindow? 28 | 29 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 30 | 31 | // Todo: Check if settings are already registered 32 | registerNotification() 33 | 34 | return true 35 | } 36 | 37 | // Register notification settings 38 | func registerNotification() { 39 | 40 | // 1. Create the actions ************************************************** 41 | 42 | // increment Action 43 | let incrementAction = UIMutableUserNotificationAction() 44 | incrementAction.identifier = Actions.increment.toRaw() 45 | incrementAction.title = "ADD +1!" 46 | incrementAction.activationMode = UIUserNotificationActivationMode.Background 47 | incrementAction.authenticationRequired = true 48 | incrementAction.destructive = false 49 | 50 | // decrement Action 51 | let decrementAction = UIMutableUserNotificationAction() 52 | decrementAction.identifier = Actions.decrement.toRaw() 53 | decrementAction.title = "SUB -1" 54 | decrementAction.activationMode = UIUserNotificationActivationMode.Background 55 | decrementAction.authenticationRequired = true 56 | decrementAction.destructive = false 57 | 58 | // reset Action 59 | let resetAction = UIMutableUserNotificationAction() 60 | resetAction.identifier = Actions.reset.toRaw() 61 | resetAction.title = "RESET" 62 | resetAction.activationMode = UIUserNotificationActivationMode.Foreground 63 | // NOT USED resetAction.authenticationRequired = true 64 | resetAction.destructive = true 65 | 66 | 67 | // 2. Create the category *********************************************** 68 | 69 | // Category 70 | let counterCategory = UIMutableUserNotificationCategory() 71 | counterCategory.identifier = categoryID 72 | 73 | // A. Set actions for the default context 74 | counterCategory.setActions([incrementAction, decrementAction, resetAction], 75 | forContext: UIUserNotificationActionContext.Default) 76 | 77 | // B. Set actions for the minimal context 78 | counterCategory.setActions([incrementAction, decrementAction], 79 | forContext: UIUserNotificationActionContext.Minimal) 80 | 81 | 82 | // 3. Notification Registration ***************************************** 83 | 84 | let types = UIUserNotificationType.Alert | UIUserNotificationType.Sound 85 | let settings = UIUserNotificationSettings(forTypes: types, categories: NSSet(object: counterCategory)) 86 | UIApplication.sharedApplication().registerUserNotificationSettings(settings) 87 | } 88 | 89 | // Schedule the Notifications with repeat 90 | func scheduleNotification() { 91 | //UIApplication.sharedApplication().cancelAllLocalNotifications() 92 | 93 | // Schedule the notification ******************************************** 94 | if UIApplication.sharedApplication().scheduledLocalNotifications.count == 0 { 95 | 96 | let notification = UILocalNotification() 97 | notification.alertBody = "Hey! Update your counter ;)" 98 | notification.soundName = UILocalNotificationDefaultSoundName 99 | notification.fireDate = NSDate() 100 | notification.category = categoryID 101 | notification.repeatInterval = NSCalendarUnit.CalendarUnitMinute 102 | 103 | UIApplication.sharedApplication().scheduleLocalNotification(notification) 104 | } 105 | } 106 | 107 | 108 | // MARK: Application Delegate 109 | 110 | func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) { 111 | scheduleNotification() 112 | } 113 | 114 | func application(application: UIApplication, 115 | handleActionWithIdentifier identifier: String?, 116 | forLocalNotification notification: UILocalNotification, 117 | completionHandler: () -> Void) { 118 | 119 | // Handle notification action ***************************************** 120 | if notification.category == categoryID { 121 | 122 | let action:Actions = Actions.fromRaw(identifier!)! 123 | let counter = Counter(); 124 | 125 | switch action{ 126 | 127 | case Actions.increment: 128 | counter++ 129 | 130 | case Actions.decrement: 131 | counter-- 132 | 133 | case Actions.reset: 134 | counter.currentTotal = 0 135 | 136 | } 137 | } 138 | 139 | completionHandler() 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 60 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Counter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Counter.swift 3 | // TB_InteractiveNotifications 4 | // 5 | // Created by Yari D'areglia on 29/09/14. 6 | // Copyright (c) 2014 Yari D'areglia. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Counter { 12 | 13 | var UD_KEY:String { 14 | return "TotalCount" 15 | } 16 | 17 | var currentTotal:Int { 18 | get{ 19 | let userDefault = NSUserDefaults.standardUserDefaults() 20 | return userDefault.integerForKey(UD_KEY) 21 | } 22 | set(newValue){ 23 | let userDefault = NSUserDefaults.standardUserDefaults() 24 | userDefault.setInteger(newValue, forKey: UD_KEY) 25 | userDefault.synchronize() 26 | 27 | // Post a notification to let observers know about the new value 28 | let notificationCenter = NSNotificationCenter.defaultCenter() 29 | let notification = NSNotification(name: "COUNTER_UPDATED", object: nil) 30 | notificationCenter.postNotification(notification) 31 | } 32 | } 33 | } 34 | 35 | postfix func ++ (counter:Counter){ 36 | counter.currentTotal += 1 37 | } 38 | 39 | postfix func -- (counter:Counter){ 40 | counter.currentTotal -= 1 41 | } -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "Icon-60@2x.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "idiom" : "iphone", 31 | "size" : "60x60", 32 | "scale" : "3x" 33 | } 34 | ], 35 | "info" : { 36 | "version" : 1, 37 | "author" : "xcode" 38 | } 39 | } -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ariok/TB_InteractiveNotifications/f8509f00ee7235322281367785ee971d1307d3d1/TB_InteractiveNotifications/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /TB_InteractiveNotifications/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.bitwaker.$(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 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | CFBundleDisplayName 34 | Counter 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /TB_InteractiveNotifications/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // TB_InteractiveNotifications 4 | // 5 | // Created by Yari D'areglia on 29/09/14. 6 | // Copyright (c) 2014 Yari D'areglia. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ViewController: UIViewController { 13 | let counter = Counter() 14 | 15 | @IBOutlet weak var totalLabel: UILabel! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | // set the label value 21 | totalLabel.text = "\(counter.currentTotal)" 22 | 23 | // Register for Counter notifications 24 | NSNotificationCenter.defaultCenter().addObserver(self, selector: "updateUI:", name: "COUNTER_UPDATED", object: nil) 25 | } 26 | 27 | // MARK: UI Functions 28 | @IBAction func resetCount() { 29 | counter.currentTotal = 0 30 | } 31 | 32 | @IBAction func incrementTotal(){ 33 | counter++ 34 | } 35 | 36 | @IBAction func decrementTotal(){ 37 | counter-- 38 | } 39 | 40 | func updateUI(notification:NSNotification){ 41 | totalLabel.text = "\(counter.currentTotal)" 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /TB_InteractiveNotificationsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.bitwaker.$(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 | CFBundleDisplayName 22 | Counter 23 | CFBundleVersion 24 | 1 25 | 26 | 27 | -------------------------------------------------------------------------------- /TB_InteractiveNotificationsTests/TB_InteractiveNotificationsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TB_InteractiveNotificationsTests.swift 3 | // TB_InteractiveNotificationsTests 4 | // 5 | // Created by Yari D'areglia on 29/09/14. 6 | // Copyright (c) 2014 Yari D'areglia. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class TB_InteractiveNotificationsTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------