├── .gitignore ├── DBAlertController-Demo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DBAlertController.podspec ├── DBAlertController.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── DBAlertController.xcscheme ├── DBAlertController.xcworkspace └── contents.xcworkspacedata ├── DBAlertControllerTests ├── DBAlertControllerTests.swift └── Info.plist ├── Example ├── AppDelegate.swift ├── Base.lproj │ └── LaunchScreen.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ModalViewController.swift └── ViewController.swift ├── LICENSE ├── README.md └── Source ├── DBAlertController.h ├── DBAlertController.swift └── Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ 28 | 29 | # Carthage 30 | # 31 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 32 | # Carthage/Checkouts 33 | 34 | Carthage/Build 35 | -------------------------------------------------------------------------------- /DBAlertController-Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8810EDC61BF102A200A5B6F6 /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5A95F01B56A1570082B467 /* ModalViewController.swift */; }; 11 | 8810EDC71BF102A400A5B6F6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5A95F11B56A1570082B467 /* ViewController.swift */; }; 12 | 8810EDCA1BF1031600A5B6F6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8810EDC81BF1031600A5B6F6 /* Images.xcassets */; }; 13 | 88EA9CA61BF11D1C00BF55B4 /* DBAlertController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88EA9CA51BF11CA100BF55B4 /* DBAlertController.framework */; }; 14 | 88EA9CA71BF11D1C00BF55B4 /* DBAlertController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 88EA9CA51BF11CA100BF55B4 /* DBAlertController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 88EA9CAD1BF11EE000BF55B4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88EA9CAB1BF11EE000BF55B4 /* LaunchScreen.xib */; }; 16 | FC1DE8D61B0196910019E38D /* DBAlertControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC1DE8D51B0196910019E38D /* DBAlertControllerTests.swift */; }; 17 | FC5A95F21B56A1570082B467 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5A95EB1B56A1570082B467 /* AppDelegate.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 88EA9CA41BF11CA100BF55B4 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 88EA9CA01BF11CA100BF55B4 /* DBAlertController.xcodeproj */; 24 | proxyType = 2; 25 | remoteGlobalIDString = 88ADD97C1BF1019D00957A9E; 26 | remoteInfo = DBAlertController; 27 | }; 28 | 88EA9CA81BF11D1C00BF55B4 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 88EA9CA01BF11CA100BF55B4 /* DBAlertController.xcodeproj */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 88ADD97B1BF1019D00957A9E; 33 | remoteInfo = DBAlertController; 34 | }; 35 | FC1DE8D01B0196910019E38D /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = FC1DE8B21B0196910019E38D /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = FC1DE8B91B0196910019E38D; 40 | remoteInfo = DBAlertController; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXCopyFilesBuildPhase section */ 45 | 88EA9CAA1BF11D1C00BF55B4 /* Embed Frameworks */ = { 46 | isa = PBXCopyFilesBuildPhase; 47 | buildActionMask = 2147483647; 48 | dstPath = ""; 49 | dstSubfolderSpec = 10; 50 | files = ( 51 | 88EA9CA71BF11D1C00BF55B4 /* DBAlertController.framework in Embed Frameworks */, 52 | ); 53 | name = "Embed Frameworks"; 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXCopyFilesBuildPhase section */ 57 | 58 | /* Begin PBXFileReference section */ 59 | 8810EDC81BF1031600A5B6F6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = SOURCE_ROOT; }; 60 | 8810EDC91BF1031600A5B6F6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = SOURCE_ROOT; }; 61 | 88EA9CA01BF11CA100BF55B4 /* DBAlertController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = DBAlertController.xcodeproj; sourceTree = ""; }; 62 | 88EA9CAC1BF11EE000BF55B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Example/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; 63 | FC1DE8BA1B0196910019E38D /* DBAlertController-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DBAlertController-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | FC1DE8CF1B0196910019E38D /* DBAlertController-Demo.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "DBAlertController-Demo.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | FC1DE8D41B0196910019E38D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | FC1DE8D51B0196910019E38D /* DBAlertControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DBAlertControllerTests.swift; sourceTree = ""; }; 67 | FC5A95EB1B56A1570082B467 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; 68 | FC5A95F01B56A1570082B467 /* ModalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ModalViewController.swift; path = Example/ModalViewController.swift; sourceTree = SOURCE_ROOT; }; 69 | FC5A95F11B56A1570082B467 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = Example/ViewController.swift; sourceTree = SOURCE_ROOT; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | FC1DE8B71B0196910019E38D /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 88EA9CA61BF11D1C00BF55B4 /* DBAlertController.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | FC1DE8CC1B0196910019E38D /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 88EA9CA11BF11CA100BF55B4 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 88EA9CA51BF11CA100BF55B4 /* DBAlertController.framework */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | FC1DE8B11B0196910019E38D = { 100 | isa = PBXGroup; 101 | children = ( 102 | FC1DE8BC1B0196910019E38D /* Source */, 103 | FC1DE8D21B0196910019E38D /* DBAlertControllerTests */, 104 | FC1DE8BB1B0196910019E38D /* Products */, 105 | 88EA9CA01BF11CA100BF55B4 /* DBAlertController.xcodeproj */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | FC1DE8BB1B0196910019E38D /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | FC1DE8BA1B0196910019E38D /* DBAlertController-Demo.app */, 113 | FC1DE8CF1B0196910019E38D /* DBAlertController-Demo.xctest */, 114 | ); 115 | name = Products; 116 | sourceTree = ""; 117 | }; 118 | FC1DE8BC1B0196910019E38D /* Source */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | FC5A95EB1B56A1570082B467 /* AppDelegate.swift */, 122 | FC5A95F01B56A1570082B467 /* ModalViewController.swift */, 123 | FC5A95F11B56A1570082B467 /* ViewController.swift */, 124 | FC5A95E71B56A0F90082B467 /* Supporting Files */, 125 | ); 126 | name = Source; 127 | path = DBAlertController; 128 | sourceTree = ""; 129 | }; 130 | FC1DE8D21B0196910019E38D /* DBAlertControllerTests */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | FC1DE8D51B0196910019E38D /* DBAlertControllerTests.swift */, 134 | FC1DE8D31B0196910019E38D /* Supporting Files */, 135 | ); 136 | path = DBAlertControllerTests; 137 | sourceTree = ""; 138 | }; 139 | FC1DE8D31B0196910019E38D /* Supporting Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | FC1DE8D41B0196910019E38D /* Info.plist */, 143 | ); 144 | name = "Supporting Files"; 145 | sourceTree = ""; 146 | }; 147 | FC5A95E71B56A0F90082B467 /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 88EA9CAB1BF11EE000BF55B4 /* LaunchScreen.xib */, 151 | 8810EDC81BF1031600A5B6F6 /* Images.xcassets */, 152 | 8810EDC91BF1031600A5B6F6 /* Info.plist */, 153 | ); 154 | name = "Supporting Files"; 155 | path = Pod; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | FC1DE8B91B0196910019E38D /* DBAlertController-Demo */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = FC1DE8D91B0196910019E38D /* Build configuration list for PBXNativeTarget "DBAlertController-Demo" */; 164 | buildPhases = ( 165 | FC1DE8B61B0196910019E38D /* Sources */, 166 | FC1DE8B71B0196910019E38D /* Frameworks */, 167 | FC1DE8B81B0196910019E38D /* Resources */, 168 | 88EA9CAA1BF11D1C00BF55B4 /* Embed Frameworks */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | 88EA9CA91BF11D1C00BF55B4 /* PBXTargetDependency */, 174 | ); 175 | name = "DBAlertController-Demo"; 176 | productName = DBAlertController; 177 | productReference = FC1DE8BA1B0196910019E38D /* DBAlertController-Demo.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | FC1DE8CE1B0196910019E38D /* DBAlertController-DemoTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = FC1DE8DC1B0196910019E38D /* Build configuration list for PBXNativeTarget "DBAlertController-DemoTests" */; 183 | buildPhases = ( 184 | FC1DE8CB1B0196910019E38D /* Sources */, 185 | FC1DE8CC1B0196910019E38D /* Frameworks */, 186 | FC1DE8CD1B0196910019E38D /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | FC1DE8D11B0196910019E38D /* PBXTargetDependency */, 192 | ); 193 | name = "DBAlertController-DemoTests"; 194 | productName = DBAlertControllerTests; 195 | productReference = FC1DE8CF1B0196910019E38D /* DBAlertController-Demo.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | FC1DE8B21B0196910019E38D /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastSwiftMigration = 0700; 205 | LastSwiftUpdateCheck = 0700; 206 | LastUpgradeCheck = 0720; 207 | ORGANIZATIONNAME = "Dylan Bettermann"; 208 | TargetAttributes = { 209 | FC1DE8B91B0196910019E38D = { 210 | CreatedOnToolsVersion = 6.3.1; 211 | LastSwiftMigration = 0800; 212 | }; 213 | FC1DE8CE1B0196910019E38D = { 214 | CreatedOnToolsVersion = 6.3.1; 215 | LastSwiftMigration = 0800; 216 | TestTargetID = FC1DE8B91B0196910019E38D; 217 | }; 218 | }; 219 | }; 220 | buildConfigurationList = FC1DE8B51B0196910019E38D /* Build configuration list for PBXProject "DBAlertController-Demo" */; 221 | compatibilityVersion = "Xcode 3.2"; 222 | developmentRegion = English; 223 | hasScannedForEncodings = 0; 224 | knownRegions = ( 225 | en, 226 | Base, 227 | ); 228 | mainGroup = FC1DE8B11B0196910019E38D; 229 | productRefGroup = FC1DE8BB1B0196910019E38D /* Products */; 230 | projectDirPath = ""; 231 | projectReferences = ( 232 | { 233 | ProductGroup = 88EA9CA11BF11CA100BF55B4 /* Products */; 234 | ProjectRef = 88EA9CA01BF11CA100BF55B4 /* DBAlertController.xcodeproj */; 235 | }, 236 | ); 237 | projectRoot = ""; 238 | targets = ( 239 | FC1DE8B91B0196910019E38D /* DBAlertController-Demo */, 240 | FC1DE8CE1B0196910019E38D /* DBAlertController-DemoTests */, 241 | ); 242 | }; 243 | /* End PBXProject section */ 244 | 245 | /* Begin PBXReferenceProxy section */ 246 | 88EA9CA51BF11CA100BF55B4 /* DBAlertController.framework */ = { 247 | isa = PBXReferenceProxy; 248 | fileType = wrapper.framework; 249 | path = DBAlertController.framework; 250 | remoteRef = 88EA9CA41BF11CA100BF55B4 /* PBXContainerItemProxy */; 251 | sourceTree = BUILT_PRODUCTS_DIR; 252 | }; 253 | /* End PBXReferenceProxy section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | FC1DE8B81B0196910019E38D /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 8810EDCA1BF1031600A5B6F6 /* Images.xcassets in Resources */, 261 | 88EA9CAD1BF11EE000BF55B4 /* LaunchScreen.xib in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | FC1DE8CD1B0196910019E38D /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXResourcesBuildPhase section */ 273 | 274 | /* Begin PBXSourcesBuildPhase section */ 275 | FC1DE8B61B0196910019E38D /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | FC5A95F21B56A1570082B467 /* AppDelegate.swift in Sources */, 280 | 8810EDC61BF102A200A5B6F6 /* ModalViewController.swift in Sources */, 281 | 8810EDC71BF102A400A5B6F6 /* ViewController.swift in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | FC1DE8CB1B0196910019E38D /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | FC1DE8D61B0196910019E38D /* DBAlertControllerTests.swift in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXSourcesBuildPhase section */ 294 | 295 | /* Begin PBXTargetDependency section */ 296 | 88EA9CA91BF11D1C00BF55B4 /* PBXTargetDependency */ = { 297 | isa = PBXTargetDependency; 298 | name = DBAlertController; 299 | targetProxy = 88EA9CA81BF11D1C00BF55B4 /* PBXContainerItemProxy */; 300 | }; 301 | FC1DE8D11B0196910019E38D /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = FC1DE8B91B0196910019E38D /* DBAlertController-Demo */; 304 | targetProxy = FC1DE8D01B0196910019E38D /* PBXContainerItemProxy */; 305 | }; 306 | /* End PBXTargetDependency section */ 307 | 308 | /* Begin PBXVariantGroup section */ 309 | 88EA9CAB1BF11EE000BF55B4 /* LaunchScreen.xib */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | 88EA9CAC1BF11EE000BF55B4 /* Base */, 313 | ); 314 | name = LaunchScreen.xib; 315 | sourceTree = ""; 316 | }; 317 | /* End PBXVariantGroup section */ 318 | 319 | /* Begin XCBuildConfiguration section */ 320 | FC1DE8D71B0196910019E38D /* Debug */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | ALWAYS_SEARCH_USER_PATHS = NO; 324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 325 | CLANG_CXX_LIBRARY = "libc++"; 326 | CLANG_ENABLE_MODULES = YES; 327 | CLANG_ENABLE_OBJC_ARC = YES; 328 | CLANG_WARN_BOOL_CONVERSION = YES; 329 | CLANG_WARN_CONSTANT_CONVERSION = YES; 330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 331 | CLANG_WARN_EMPTY_BODY = YES; 332 | CLANG_WARN_ENUM_CONVERSION = YES; 333 | CLANG_WARN_INT_CONVERSION = YES; 334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 335 | CLANG_WARN_UNREACHABLE_CODE = YES; 336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 338 | COPY_PHASE_STRIP = NO; 339 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | ENABLE_TESTABILITY = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_NO_COMMON_BLOCKS = YES; 345 | GCC_OPTIMIZATION_LEVEL = 0; 346 | GCC_PREPROCESSOR_DEFINITIONS = ( 347 | "DEBUG=1", 348 | "$(inherited)", 349 | ); 350 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 362 | SWIFT_VERSION = 2.3; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | }; 365 | name = Debug; 366 | }; 367 | FC1DE8D81B0196910019E38D /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 372 | CLANG_CXX_LIBRARY = "libc++"; 373 | CLANG_ENABLE_MODULES = YES; 374 | CLANG_ENABLE_OBJC_ARC = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 378 | CLANG_WARN_EMPTY_BODY = YES; 379 | CLANG_WARN_ENUM_CONVERSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 382 | CLANG_WARN_UNREACHABLE_CODE = YES; 383 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 384 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 385 | COPY_PHASE_STRIP = NO; 386 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 387 | ENABLE_NS_ASSERTIONS = NO; 388 | ENABLE_STRICT_OBJC_MSGSEND = YES; 389 | GCC_C_LANGUAGE_STANDARD = gnu99; 390 | GCC_NO_COMMON_BLOCKS = YES; 391 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 392 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 393 | GCC_WARN_UNDECLARED_SELECTOR = YES; 394 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 395 | GCC_WARN_UNUSED_FUNCTION = YES; 396 | GCC_WARN_UNUSED_VARIABLE = YES; 397 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 398 | MTL_ENABLE_DEBUG_INFO = NO; 399 | SDKROOT = iphoneos; 400 | SWIFT_VERSION = 2.3; 401 | TARGETED_DEVICE_FAMILY = "1,2"; 402 | VALIDATE_PRODUCT = YES; 403 | }; 404 | name = Release; 405 | }; 406 | FC1DE8DA1B0196910019E38D /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 411 | INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; 412 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 413 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 414 | PRODUCT_BUNDLE_IDENTIFIER = "com.dylanbettermann.$(PRODUCT_NAME:rfc1034identifier)"; 415 | PRODUCT_NAME = "DBAlertController-Demo"; 416 | SWIFT_VERSION = 2.3; 417 | }; 418 | name = Debug; 419 | }; 420 | FC1DE8DB1B0196910019E38D /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 424 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 425 | INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 428 | PRODUCT_BUNDLE_IDENTIFIER = "com.dylanbettermann.$(PRODUCT_NAME:rfc1034identifier)"; 429 | PRODUCT_NAME = "DBAlertController-Demo"; 430 | SWIFT_VERSION = 2.3; 431 | }; 432 | name = Release; 433 | }; 434 | FC1DE8DD1B0196910019E38D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | BUNDLE_LOADER = "$(TEST_HOST)"; 438 | FRAMEWORK_SEARCH_PATHS = ( 439 | "$(SDKROOT)/Developer/Library/Frameworks", 440 | "$(inherited)", 441 | ); 442 | GCC_PREPROCESSOR_DEFINITIONS = ( 443 | "DEBUG=1", 444 | "$(inherited)", 445 | ); 446 | INFOPLIST_FILE = DBAlertControllerTests/Info.plist; 447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 448 | PRODUCT_BUNDLE_IDENTIFIER = "com.dylanbettermann.$(PRODUCT_NAME:rfc1034identifier)"; 449 | PRODUCT_NAME = "DBAlertController-Demo"; 450 | SWIFT_VERSION = 2.3; 451 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DBAlertController-Demo.app/DBAlertController-Demo"; 452 | }; 453 | name = Debug; 454 | }; 455 | FC1DE8DE1B0196910019E38D /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | BUNDLE_LOADER = "$(TEST_HOST)"; 459 | FRAMEWORK_SEARCH_PATHS = ( 460 | "$(SDKROOT)/Developer/Library/Frameworks", 461 | "$(inherited)", 462 | ); 463 | INFOPLIST_FILE = DBAlertControllerTests/Info.plist; 464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 465 | PRODUCT_BUNDLE_IDENTIFIER = "com.dylanbettermann.$(PRODUCT_NAME:rfc1034identifier)"; 466 | PRODUCT_NAME = "DBAlertController-Demo"; 467 | SWIFT_VERSION = 2.3; 468 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DBAlertController-Demo.app/DBAlertController-Demo"; 469 | }; 470 | name = Release; 471 | }; 472 | /* End XCBuildConfiguration section */ 473 | 474 | /* Begin XCConfigurationList section */ 475 | FC1DE8B51B0196910019E38D /* Build configuration list for PBXProject "DBAlertController-Demo" */ = { 476 | isa = XCConfigurationList; 477 | buildConfigurations = ( 478 | FC1DE8D71B0196910019E38D /* Debug */, 479 | FC1DE8D81B0196910019E38D /* Release */, 480 | ); 481 | defaultConfigurationIsVisible = 0; 482 | defaultConfigurationName = Release; 483 | }; 484 | FC1DE8D91B0196910019E38D /* Build configuration list for PBXNativeTarget "DBAlertController-Demo" */ = { 485 | isa = XCConfigurationList; 486 | buildConfigurations = ( 487 | FC1DE8DA1B0196910019E38D /* Debug */, 488 | FC1DE8DB1B0196910019E38D /* Release */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | FC1DE8DC1B0196910019E38D /* Build configuration list for PBXNativeTarget "DBAlertController-DemoTests" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | FC1DE8DD1B0196910019E38D /* Debug */, 497 | FC1DE8DE1B0196910019E38D /* Release */, 498 | ); 499 | defaultConfigurationIsVisible = 0; 500 | defaultConfigurationName = Release; 501 | }; 502 | /* End XCConfigurationList section */ 503 | }; 504 | rootObject = FC1DE8B21B0196910019E38D /* Project object */; 505 | } 506 | -------------------------------------------------------------------------------- /DBAlertController-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DBAlertController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "DBAlertController" 3 | s.version = "0.3.0" 4 | s.summary = "A UIAlertController subclass that's independent of the view controller it's presented from." 5 | s.homepage = "https://github.com/dbettermann/DBAlertController" 6 | s.license = 'MIT' 7 | s.author = { "Dylan Bettermann" => "dylan.bettermann@gmail.com" } 8 | s.source = { :git => "https://github.com/dbettermann/DBAlertController.git", :tag => s.version.to_s } 9 | s.social_media_url = 'https://twitter.com/dbettermann' 10 | 11 | s.platform = :ios, '8.0' 12 | s.requires_arc = true 13 | 14 | s.source_files = 'Source/*.swift' 15 | end 16 | -------------------------------------------------------------------------------- /DBAlertController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8810EDC31BF1026500A5B6F6 /* DBAlertController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8810EDC01BF1026500A5B6F6 /* DBAlertController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 8810EDC41BF1026500A5B6F6 /* DBAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8810EDC11BF1026500A5B6F6 /* DBAlertController.swift */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 8810EDC01BF1026500A5B6F6 /* DBAlertController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBAlertController.h; path = Source/DBAlertController.h; sourceTree = SOURCE_ROOT; }; 16 | 8810EDC11BF1026500A5B6F6 /* DBAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DBAlertController.swift; path = Source/DBAlertController.swift; sourceTree = SOURCE_ROOT; }; 17 | 8810EDC21BF1026500A5B6F6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Source/Info.plist; sourceTree = SOURCE_ROOT; }; 18 | 88ADD97C1BF1019D00957A9E /* DBAlertController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DBAlertController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | /* End PBXFileReference section */ 20 | 21 | /* Begin PBXFrameworksBuildPhase section */ 22 | 88ADD9781BF1019D00957A9E /* Frameworks */ = { 23 | isa = PBXFrameworksBuildPhase; 24 | buildActionMask = 2147483647; 25 | files = ( 26 | ); 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXFrameworksBuildPhase section */ 30 | 31 | /* Begin PBXGroup section */ 32 | 8810EDCC1BF1037200A5B6F6 /* Supporting Files */ = { 33 | isa = PBXGroup; 34 | children = ( 35 | 8810EDC01BF1026500A5B6F6 /* DBAlertController.h */, 36 | 8810EDC21BF1026500A5B6F6 /* Info.plist */, 37 | ); 38 | name = "Supporting Files"; 39 | sourceTree = ""; 40 | }; 41 | 88ADD9721BF1019D00957A9E = { 42 | isa = PBXGroup; 43 | children = ( 44 | 88ADD97E1BF1019D00957A9E /* Source */, 45 | 88ADD97D1BF1019D00957A9E /* Products */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | 88ADD97D1BF1019D00957A9E /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 88ADD97C1BF1019D00957A9E /* DBAlertController.framework */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | 88ADD97E1BF1019D00957A9E /* Source */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 8810EDC11BF1026500A5B6F6 /* DBAlertController.swift */, 61 | 8810EDCC1BF1037200A5B6F6 /* Supporting Files */, 62 | ); 63 | name = Source; 64 | path = DBAlertController; 65 | sourceTree = ""; 66 | }; 67 | /* End PBXGroup section */ 68 | 69 | /* Begin PBXHeadersBuildPhase section */ 70 | 88ADD9791BF1019D00957A9E /* Headers */ = { 71 | isa = PBXHeadersBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | 8810EDC31BF1026500A5B6F6 /* DBAlertController.h in Headers */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXHeadersBuildPhase section */ 79 | 80 | /* Begin PBXNativeTarget section */ 81 | 88ADD97B1BF1019D00957A9E /* DBAlertController */ = { 82 | isa = PBXNativeTarget; 83 | buildConfigurationList = 88ADD9841BF1019D00957A9E /* Build configuration list for PBXNativeTarget "DBAlertController" */; 84 | buildPhases = ( 85 | 88ADD9771BF1019D00957A9E /* Sources */, 86 | 88ADD9781BF1019D00957A9E /* Frameworks */, 87 | 88ADD9791BF1019D00957A9E /* Headers */, 88 | 88ADD97A1BF1019D00957A9E /* Resources */, 89 | ); 90 | buildRules = ( 91 | ); 92 | dependencies = ( 93 | ); 94 | name = DBAlertController; 95 | productName = DBAlertController; 96 | productReference = 88ADD97C1BF1019D00957A9E /* DBAlertController.framework */; 97 | productType = "com.apple.product-type.framework"; 98 | }; 99 | /* End PBXNativeTarget section */ 100 | 101 | /* Begin PBXProject section */ 102 | 88ADD9731BF1019D00957A9E /* Project object */ = { 103 | isa = PBXProject; 104 | attributes = { 105 | LastUpgradeCheck = 0720; 106 | ORGANIZATIONNAME = "Dylan Bettermann"; 107 | TargetAttributes = { 108 | 88ADD97B1BF1019D00957A9E = { 109 | CreatedOnToolsVersion = 7.1; 110 | LastSwiftMigration = 0800; 111 | }; 112 | }; 113 | }; 114 | buildConfigurationList = 88ADD9761BF1019D00957A9E /* Build configuration list for PBXProject "DBAlertController" */; 115 | compatibilityVersion = "Xcode 3.2"; 116 | developmentRegion = English; 117 | hasScannedForEncodings = 0; 118 | knownRegions = ( 119 | en, 120 | ); 121 | mainGroup = 88ADD9721BF1019D00957A9E; 122 | productRefGroup = 88ADD97D1BF1019D00957A9E /* Products */; 123 | projectDirPath = ""; 124 | projectRoot = ""; 125 | targets = ( 126 | 88ADD97B1BF1019D00957A9E /* DBAlertController */, 127 | ); 128 | }; 129 | /* End PBXProject section */ 130 | 131 | /* Begin PBXResourcesBuildPhase section */ 132 | 88ADD97A1BF1019D00957A9E /* Resources */ = { 133 | isa = PBXResourcesBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXResourcesBuildPhase section */ 140 | 141 | /* Begin PBXSourcesBuildPhase section */ 142 | 88ADD9771BF1019D00957A9E /* Sources */ = { 143 | isa = PBXSourcesBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | 8810EDC41BF1026500A5B6F6 /* DBAlertController.swift in Sources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXSourcesBuildPhase section */ 151 | 152 | /* Begin XCBuildConfiguration section */ 153 | 88ADD9821BF1019D00957A9E /* Debug */ = { 154 | isa = XCBuildConfiguration; 155 | buildSettings = { 156 | ALWAYS_SEARCH_USER_PATHS = NO; 157 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 158 | CLANG_CXX_LIBRARY = "libc++"; 159 | CLANG_ENABLE_MODULES = YES; 160 | CLANG_ENABLE_OBJC_ARC = YES; 161 | CLANG_WARN_BOOL_CONVERSION = YES; 162 | CLANG_WARN_CONSTANT_CONVERSION = YES; 163 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 164 | CLANG_WARN_EMPTY_BODY = YES; 165 | CLANG_WARN_ENUM_CONVERSION = YES; 166 | CLANG_WARN_INT_CONVERSION = YES; 167 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 168 | CLANG_WARN_UNREACHABLE_CODE = YES; 169 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 170 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 171 | COPY_PHASE_STRIP = NO; 172 | CURRENT_PROJECT_VERSION = 1; 173 | DEBUG_INFORMATION_FORMAT = dwarf; 174 | ENABLE_STRICT_OBJC_MSGSEND = YES; 175 | ENABLE_TESTABILITY = YES; 176 | GCC_C_LANGUAGE_STANDARD = gnu99; 177 | GCC_DYNAMIC_NO_PIC = NO; 178 | GCC_NO_COMMON_BLOCKS = YES; 179 | GCC_OPTIMIZATION_LEVEL = 0; 180 | GCC_PREPROCESSOR_DEFINITIONS = ( 181 | "DEBUG=1", 182 | "$(inherited)", 183 | ); 184 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 185 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 186 | GCC_WARN_UNDECLARED_SELECTOR = YES; 187 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 188 | GCC_WARN_UNUSED_FUNCTION = YES; 189 | GCC_WARN_UNUSED_VARIABLE = YES; 190 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 191 | MTL_ENABLE_DEBUG_INFO = YES; 192 | ONLY_ACTIVE_ARCH = YES; 193 | SDKROOT = iphoneos; 194 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 195 | SWIFT_VERSION = 2.3; 196 | TARGETED_DEVICE_FAMILY = "1,2"; 197 | VERSIONING_SYSTEM = "apple-generic"; 198 | VERSION_INFO_PREFIX = ""; 199 | }; 200 | name = Debug; 201 | }; 202 | 88ADD9831BF1019D00957A9E /* Release */ = { 203 | isa = XCBuildConfiguration; 204 | buildSettings = { 205 | ALWAYS_SEARCH_USER_PATHS = NO; 206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 207 | CLANG_CXX_LIBRARY = "libc++"; 208 | CLANG_ENABLE_MODULES = YES; 209 | CLANG_ENABLE_OBJC_ARC = YES; 210 | CLANG_WARN_BOOL_CONVERSION = YES; 211 | CLANG_WARN_CONSTANT_CONVERSION = YES; 212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 213 | CLANG_WARN_EMPTY_BODY = YES; 214 | CLANG_WARN_ENUM_CONVERSION = YES; 215 | CLANG_WARN_INT_CONVERSION = YES; 216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 217 | CLANG_WARN_UNREACHABLE_CODE = YES; 218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 220 | COPY_PHASE_STRIP = NO; 221 | CURRENT_PROJECT_VERSION = 1; 222 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 223 | ENABLE_NS_ASSERTIONS = NO; 224 | ENABLE_STRICT_OBJC_MSGSEND = YES; 225 | GCC_C_LANGUAGE_STANDARD = gnu99; 226 | GCC_NO_COMMON_BLOCKS = YES; 227 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 228 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 229 | GCC_WARN_UNDECLARED_SELECTOR = YES; 230 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 231 | GCC_WARN_UNUSED_FUNCTION = YES; 232 | GCC_WARN_UNUSED_VARIABLE = YES; 233 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 234 | MTL_ENABLE_DEBUG_INFO = NO; 235 | SDKROOT = iphoneos; 236 | SWIFT_VERSION = 2.3; 237 | TARGETED_DEVICE_FAMILY = "1,2"; 238 | VALIDATE_PRODUCT = YES; 239 | VERSIONING_SYSTEM = "apple-generic"; 240 | VERSION_INFO_PREFIX = ""; 241 | }; 242 | name = Release; 243 | }; 244 | 88ADD9851BF1019D00957A9E /* Debug */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | CLANG_ENABLE_MODULES = YES; 248 | DEFINES_MODULE = YES; 249 | DYLIB_COMPATIBILITY_VERSION = 1; 250 | DYLIB_CURRENT_VERSION = 1; 251 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 252 | INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; 253 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 254 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 255 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 256 | PRODUCT_BUNDLE_IDENTIFIER = com.dylanbettermann.DBAlertController; 257 | PRODUCT_NAME = "$(TARGET_NAME)"; 258 | SKIP_INSTALL = YES; 259 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 260 | SWIFT_VERSION = 2.3; 261 | }; 262 | name = Debug; 263 | }; 264 | 88ADD9861BF1019D00957A9E /* Release */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | CLANG_ENABLE_MODULES = YES; 268 | DEFINES_MODULE = YES; 269 | DYLIB_COMPATIBILITY_VERSION = 1; 270 | DYLIB_CURRENT_VERSION = 1; 271 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 272 | INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; 273 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 274 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 275 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 276 | PRODUCT_BUNDLE_IDENTIFIER = com.dylanbettermann.DBAlertController; 277 | PRODUCT_NAME = "$(TARGET_NAME)"; 278 | SKIP_INSTALL = YES; 279 | SWIFT_VERSION = 2.3; 280 | }; 281 | name = Release; 282 | }; 283 | /* End XCBuildConfiguration section */ 284 | 285 | /* Begin XCConfigurationList section */ 286 | 88ADD9761BF1019D00957A9E /* Build configuration list for PBXProject "DBAlertController" */ = { 287 | isa = XCConfigurationList; 288 | buildConfigurations = ( 289 | 88ADD9821BF1019D00957A9E /* Debug */, 290 | 88ADD9831BF1019D00957A9E /* Release */, 291 | ); 292 | defaultConfigurationIsVisible = 0; 293 | defaultConfigurationName = Release; 294 | }; 295 | 88ADD9841BF1019D00957A9E /* Build configuration list for PBXNativeTarget "DBAlertController" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | 88ADD9851BF1019D00957A9E /* Debug */, 299 | 88ADD9861BF1019D00957A9E /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | /* End XCConfigurationList section */ 305 | }; 306 | rootObject = 88ADD9731BF1019D00957A9E /* Project object */; 307 | } 308 | -------------------------------------------------------------------------------- /DBAlertController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DBAlertController.xcodeproj/xcshareddata/xcschemes/DBAlertController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /DBAlertController.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DBAlertControllerTests/DBAlertControllerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DBAlertControllerTests.swift 3 | // DBAlertControllerTests 4 | // 5 | // Created by Dylan Bettermann on 5/11/15. 6 | // Copyright (c) 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class DBAlertControllerTests: 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 | -------------------------------------------------------------------------------- /DBAlertControllerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DBAlertController 4 | // 5 | // Created by Dylan Bettermann on 5/11/15. 6 | // Copyright (c) 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import DBAlertController 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | 19 | window = UIWindow(frame: UIScreen.mainScreen().bounds) 20 | window!.rootViewController = UINavigationController(rootViewController: ViewController()) 21 | 22 | window!.makeKeyAndVisible() 23 | 24 | return true 25 | } 26 | 27 | func applicationDidBecomeActive(application: UIApplication) { 28 | let oldAlertController = UIAlertController(title: "UIAlertController", message: "This is the UIAlertController instance. Start the demo by pressing the Present button to present a modal UIViewController.", preferredStyle: .Alert) 29 | oldAlertController.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) 30 | window!.rootViewController?.presentViewController(oldAlertController, animated: true, completion: nil) 31 | 32 | let newAlertController = DBAlertController(title: "DBAlertController", message: "This is the DBAlertController instance.", preferredStyle: .Alert) 33 | newAlertController.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) 34 | newAlertController.show() 35 | } 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | 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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarStyle 32 | UIStatusBarStyleDefault 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ModalViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModalViewController.swift 3 | // DBAlertController 4 | // 5 | // Created by Dylan Bettermann on 5/12/15. 6 | // Copyright (c) 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ModalViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | title = "Modal View Controller" 17 | 18 | view.backgroundColor = UIColor.whiteColor() 19 | 20 | navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Dismiss", style: .Plain, target: self, action: #selector(dismiss)) 21 | } 22 | 23 | func dismiss() { 24 | presentingViewController?.dismissViewControllerAnimated(true, completion: nil) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DBAlertController 4 | // 5 | // Created by Dylan Bettermann on 5/11/15. 6 | // Copyright (c) 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | title = "DBAlertController Demo" 17 | 18 | view.backgroundColor = UIColor.whiteColor() 19 | 20 | navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Present", style: .Plain, target: self, action: #selector(present)) 21 | } 22 | 23 | func present() { 24 | let modalViewController = UINavigationController(rootViewController: ModalViewController()) 25 | modalViewController.modalPresentationStyle = .FormSheet 26 | presentViewController(modalViewController, animated: true, completion: { 27 | let instructions = UIAlertController(title: "Instructions", message: "Now press the home button. When you resume the app, the default UIAlertController will not be presented and you will receive a warning message in your console. The DBAlertController will be presented.", preferredStyle: .Alert) 28 | instructions.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) 29 | modalViewController.presentViewController(instructions, animated: true, completion: nil) 30 | }) 31 | } 32 | 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dylan Bettermann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DBAlertController 2 | Adding UIAlertView's show() functionality to UIAlertController. 3 | 4 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 5 | [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/DBAlertController.svg)](https://img.shields.io/cocoapods/v/DBAlertController.svg) 6 | 7 | ## Background 8 | Have you ever needed to present an alert without knowing the visible view controller? In case you're drawing a blank, let me give an example. 9 | 10 | ### Example - App Updates 11 | Assume we have an app in the App Store and we want to let the users know there is an update. How would we do that? 12 | 13 | #### iOS 7 and earlier - UIAlertView 14 | **AppDelegate.swift** 15 | ```swift 16 | func applicationDidBecomeActive(application: UIApplication) { 17 | if update { 18 | UIAlertView(title: "Update Available", message: "Would you like to update your app?", delegate: self, cancelButtonTitle: "Yes!").show() 19 | } 20 | } 21 | ``` 22 | Easy, right? We don't have to worry about which view controller is visible. UIAlertView seems to find the visible view controller and add itself as a subview. 23 | 24 | UIAlertView and system alerts might actually use their own UIWindow just like DBAlertController, but I digress. 25 | 26 | #### iOS 8 and newer - UIAlertController 27 | **AppDelegate.swift** 28 | ```swift 29 | func applicationDidBecomeActive(application: UIApplication) { 30 | if update { 31 | let alertController = UIAlertController(title: "Update Available", message: "Would you like to update your app?", preferredStyle: .Alert) 32 | alertController.addAction(UIAlertAction(title: "Yes!", style: .Default, handler: nil)) 33 | 34 | window!.rootViewController?.presentViewController(alertController, animated: true, completion: nil) 35 | } 36 | } 37 | ``` 38 | This will work... but only if the rootViewController's view is in the window hierarchy. 39 | 40 | What if the rootViewController's view is *not* in the window hierarchy? 41 | 42 | 1. The UIAlertController does not appear. 43 | 2. You get a warning message written to your console. Something like: 44 | ``` 45 | 015-05-13 08:09:58.923 DBAlertController[1002:15635] Warning: Attempt to present on whose view is not in the window hierarchy! 46 | ``` 47 | 48 | There's a demo of this scenario in the source. Pull it down and try it yourself. 49 | 50 | ## Fixing the issue 51 | DBAlertController fixes the issue above by presenting the UIAlertController on its own UIWindow. 52 | 53 | ## Installation 54 | 55 | ### Cocoapods 56 | Add `pod 'DBAlertController'` to your Podfile. 57 | 58 | ### Carthage 59 | Add `github "dbettermann/DBAlertController"` to your Cartfile. 60 | 61 | ### Manual 62 | Copy and paste DBAlertController.swift into your project. 63 | 64 | ## Usage 65 | 66 | ```swift 67 | let alertController = DBAlertController(title: "DBAlertController", message: "Hello World!", preferredStyle: .Alert) 68 | alertController.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) 69 | alertController.show() 70 | ``` 71 | Here is the full signature for `show()`: 72 | ```swift 73 | func show(animated flag: Bool = true, completion: (() -> Void)? = nil) 74 | ``` 75 | As you can see, you can also pass an animated flag and completion closure that get passed along to 76 | ```swift 77 | presentViewController(alertController, animated: flag, completion: completion) 78 | ``` 79 | 80 | ## Feedback 81 | All feedback is welcome. [Tweet](https://twitter.com/dbettermann "@dbettermann") at me or send me an [email](mailto:dylan.bettermann@gmail.com) with any questions, comments, or issues. 82 | -------------------------------------------------------------------------------- /Source/DBAlertController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBAlertController.h 3 | // DBAlertController 4 | // 5 | // Created by Dylan.Bettermann on 11/9/15. 6 | // Copyright © 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for DBAlertController. 12 | FOUNDATION_EXPORT double DBAlertControllerVersionNumber; 13 | 14 | //! Project version string for DBAlertController. 15 | FOUNDATION_EXPORT const unsigned char DBAlertControllerVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/DBAlertController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DBAlertController.swift 3 | // DBAlertController 4 | // 5 | // Created by Dylan Bettermann on 5/11/15. 6 | // Copyright (c) 2015 Dylan Bettermann. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class DBAlertController: UIAlertController { 12 | 13 | /// The UIWindow that will be at the top of the window hierarchy. The DBAlertController instance is presented on the rootViewController of this window. 14 | private lazy var alertWindow: UIWindow = { 15 | let window = UIWindow(frame: UIScreen.mainScreen().bounds) 16 | window.rootViewController = DBClearViewController() 17 | window.backgroundColor = UIColor.clearColor() 18 | window.windowLevel = UIWindowLevelAlert 19 | return window 20 | }() 21 | 22 | /** 23 | Present the DBAlertController on top of the visible UIViewController. 24 | 25 | - parameter flag: Pass true to animate the presentation; otherwise, pass false. The presentation is animated by default. 26 | - parameter completion: The closure to execute after the presentation finishes. 27 | */ 28 | public func show(animated flag: Bool = true, completion: (() -> Void)? = nil) { 29 | if let rootViewController = alertWindow.rootViewController { 30 | alertWindow.makeKeyAndVisible() 31 | 32 | rootViewController.presentViewController(self, animated: flag, completion: completion) 33 | } 34 | } 35 | 36 | } 37 | 38 | // In the case of view controller-based status bar style, make sure we use the same style for our view controller 39 | private class DBClearViewController: UIViewController { 40 | 41 | private override func preferredStatusBarStyle() -> UIStatusBarStyle { 42 | return UIApplication.sharedApplication().statusBarStyle 43 | } 44 | 45 | private override func prefersStatusBarHidden() -> Bool { 46 | return UIApplication.sharedApplication().statusBarHidden 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.3.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | --------------------------------------------------------------------------------