├── .gitignore ├── .swift-version ├── .travis.yml ├── Example ├── .DS_Store ├── Example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Example.xcscheme ├── Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── ExampleUITests │ ├── ExampleUITests.swift │ └── Info.plist ├── Podfile └── Podfile.lock ├── Images ├── classy.png └── ugly.png ├── LICENSE ├── PopupViewController.podspec ├── PopupViewController.xcworkspace └── contents.xcworkspacedata ├── PopupViewController ├── .DS_Store ├── Podfile ├── Podfile.lock ├── PopupViewController.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── PopupViewController.xcscheme │ │ └── PopupViewControllerTests.xcscheme ├── PopupViewController │ ├── Info.plist │ ├── PopupViewController.h │ └── PopupViewController.swift └── PopupViewControllerTests │ ├── Info.plist │ └── PopupViewControllerTests.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | 65 | .DS_Store 66 | 67 | Example/.DS_Store 68 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode7.3 3 | xcode_workspace: PopupViewController.xcworkspace 4 | podfile: 5 | - Example/podfile 6 | xcode_scheme: 7 | - Example 8 | - PopupViewController 9 | - PopupViewControllerTests 10 | -------------------------------------------------------------------------------- /Example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/PopupViewController/c8f0cf72a4b5741edc94a2b97cc5d5dd1453b461/Example/.DS_Store -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 25BBE5A3C20D4110DA157F6E /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F588243DE51DEE3B8BCEF7BA /* Pods_Example.framework */; }; 11 | 9F55610B1D86AAB000610533 /* PopupViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F55610A1D86AAB000610533 /* PopupViewController.framework */; }; 12 | 9F55610C1D86AAB000610533 /* PopupViewController.framework in Copy frameworks */ = {isa = PBXBuildFile; fileRef = 9F55610A1D86AAB000610533 /* PopupViewController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 13 | 9F9D54751D081D12005B259C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9D54741D081D12005B259C /* AppDelegate.swift */; }; 14 | 9F9D54771D081D12005B259C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9D54761D081D12005B259C /* ViewController.swift */; }; 15 | 9F9D547A1D081D12005B259C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F9D54781D081D12005B259C /* Main.storyboard */; }; 16 | 9F9D547C1D081D12005B259C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9F9D547B1D081D12005B259C /* Assets.xcassets */; }; 17 | 9F9D547F1D081D12005B259C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F9D547D1D081D12005B259C /* LaunchScreen.storyboard */; }; 18 | 9F9D54B91D0852D8005B259C /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9D54B81D0852D8005B259C /* ExampleUITests.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 9F9D54BB1D0852D8005B259C /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 9F9D54691D081D11005B259C /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 9F9D54701D081D12005B259C; 27 | remoteInfo = Example; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXCopyFilesBuildPhase section */ 32 | 9F9D54A11D081E8B005B259C /* Copy frameworks */ = { 33 | isa = PBXCopyFilesBuildPhase; 34 | buildActionMask = 2147483647; 35 | dstPath = ""; 36 | dstSubfolderSpec = 10; 37 | files = ( 38 | 9F55610C1D86AAB000610533 /* PopupViewController.framework in Copy frameworks */, 39 | ); 40 | name = "Copy frameworks"; 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXCopyFilesBuildPhase section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 161C88F8C97E0B798550212B /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 47 | 9F55610A1D86AAB000610533 /* PopupViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PopupViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 9F9D54711D081D12005B259C /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 9F9D54741D081D12005B259C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50 | 9F9D54761D081D12005B259C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 51 | 9F9D54791D081D12005B259C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 9F9D547B1D081D12005B259C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 9F9D547E1D081D12005B259C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 9F9D54801D081D12005B259C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 9F9D54A31D082241005B259C /* PopupViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PopupViewController.framework; path = "../../../../../../Library/Developer/Xcode/DerivedData/PopupViewController-bylhkwvukaykkgdygchciphxfldt/Build/Products/Debug-iphonesimulator/PopupViewController.framework"; sourceTree = ""; }; 56 | 9F9D54B61D0852D8005B259C /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 9F9D54B81D0852D8005B259C /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; 58 | 9F9D54BA1D0852D8005B259C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | A24CE37A0E77BB3AEF80B571 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 60 | F588243DE51DEE3B8BCEF7BA /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 9F9D546E1D081D12005B259C /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9F55610B1D86AAB000610533 /* PopupViewController.framework in Frameworks */, 69 | 25BBE5A3C20D4110DA157F6E /* Pods_Example.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 9F9D54B31D0852D8005B259C /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 9F9D54681D081D11005B259C = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9F55610A1D86AAB000610533 /* PopupViewController.framework */, 87 | 9F9D54A31D082241005B259C /* PopupViewController.framework */, 88 | 9F9D54731D081D12005B259C /* Example */, 89 | 9F9D54B71D0852D8005B259C /* ExampleUITests */, 90 | 9F9D54721D081D12005B259C /* Products */, 91 | AD851A0A3C9046487B3D530F /* Pods */, 92 | DDF5DA49678EB47DDE0D4B83 /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 9F9D54721D081D12005B259C /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 9F9D54711D081D12005B259C /* Example.app */, 100 | 9F9D54B61D0852D8005B259C /* ExampleUITests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 9F9D54731D081D12005B259C /* Example */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 9F9D54741D081D12005B259C /* AppDelegate.swift */, 109 | 9F9D54761D081D12005B259C /* ViewController.swift */, 110 | 9F9D54781D081D12005B259C /* Main.storyboard */, 111 | 9F9D547B1D081D12005B259C /* Assets.xcassets */, 112 | 9F9D547D1D081D12005B259C /* LaunchScreen.storyboard */, 113 | 9F9D54801D081D12005B259C /* Info.plist */, 114 | ); 115 | path = Example; 116 | sourceTree = ""; 117 | }; 118 | 9F9D54B71D0852D8005B259C /* ExampleUITests */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 9F9D54B81D0852D8005B259C /* ExampleUITests.swift */, 122 | 9F9D54BA1D0852D8005B259C /* Info.plist */, 123 | ); 124 | path = ExampleUITests; 125 | sourceTree = ""; 126 | }; 127 | AD851A0A3C9046487B3D530F /* Pods */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | A24CE37A0E77BB3AEF80B571 /* Pods-Example.debug.xcconfig */, 131 | 161C88F8C97E0B798550212B /* Pods-Example.release.xcconfig */, 132 | ); 133 | name = Pods; 134 | sourceTree = ""; 135 | }; 136 | DDF5DA49678EB47DDE0D4B83 /* Frameworks */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | F588243DE51DEE3B8BCEF7BA /* Pods_Example.framework */, 140 | ); 141 | name = Frameworks; 142 | sourceTree = ""; 143 | }; 144 | /* End PBXGroup section */ 145 | 146 | /* Begin PBXNativeTarget section */ 147 | 9F9D54701D081D12005B259C /* Example */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = 9F9D54831D081D12005B259C /* Build configuration list for PBXNativeTarget "Example" */; 150 | buildPhases = ( 151 | 33A5F182A28B50194F864B87 /* [CP] Check Pods Manifest.lock */, 152 | 9F9D546D1D081D12005B259C /* Sources */, 153 | 9F9D546E1D081D12005B259C /* Frameworks */, 154 | 9F9D546F1D081D12005B259C /* Resources */, 155 | 9F9D54A11D081E8B005B259C /* Copy frameworks */, 156 | 29321844DE7923BA591F0B55 /* [CP] Embed Pods Frameworks */, 157 | BEFF62B2A9F2D3DD0D5DC721 /* [CP] Copy Pods Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | ); 163 | name = Example; 164 | productName = Example; 165 | productReference = 9F9D54711D081D12005B259C /* Example.app */; 166 | productType = "com.apple.product-type.application"; 167 | }; 168 | 9F9D54B51D0852D8005B259C /* ExampleUITests */ = { 169 | isa = PBXNativeTarget; 170 | buildConfigurationList = 9F9D54BF1D0852D8005B259C /* Build configuration list for PBXNativeTarget "ExampleUITests" */; 171 | buildPhases = ( 172 | 9F9D54B21D0852D8005B259C /* Sources */, 173 | 9F9D54B31D0852D8005B259C /* Frameworks */, 174 | 9F9D54B41D0852D8005B259C /* Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | 9F9D54BC1D0852D8005B259C /* PBXTargetDependency */, 180 | ); 181 | name = ExampleUITests; 182 | productName = ExampleUITests; 183 | productReference = 9F9D54B61D0852D8005B259C /* ExampleUITests.xctest */; 184 | productType = "com.apple.product-type.bundle.ui-testing"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 9F9D54691D081D11005B259C /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastSwiftUpdateCheck = 0730; 193 | LastUpgradeCheck = 0800; 194 | ORGANIZATIONNAME = "Thomas Ricouard"; 195 | TargetAttributes = { 196 | 9F9D54701D081D12005B259C = { 197 | CreatedOnToolsVersion = 7.3.1; 198 | DevelopmentTeam = Z6P74P6T99; 199 | LastSwiftMigration = 0800; 200 | }; 201 | 9F9D54B51D0852D8005B259C = { 202 | CreatedOnToolsVersion = 7.3.1; 203 | LastSwiftMigration = 0800; 204 | TestTargetID = 9F9D54701D081D12005B259C; 205 | }; 206 | }; 207 | }; 208 | buildConfigurationList = 9F9D546C1D081D11005B259C /* Build configuration list for PBXProject "Example" */; 209 | compatibilityVersion = "Xcode 3.2"; 210 | developmentRegion = English; 211 | hasScannedForEncodings = 0; 212 | knownRegions = ( 213 | en, 214 | Base, 215 | ); 216 | mainGroup = 9F9D54681D081D11005B259C; 217 | productRefGroup = 9F9D54721D081D12005B259C /* Products */; 218 | projectDirPath = ""; 219 | projectRoot = ""; 220 | targets = ( 221 | 9F9D54701D081D12005B259C /* Example */, 222 | 9F9D54B51D0852D8005B259C /* ExampleUITests */, 223 | ); 224 | }; 225 | /* End PBXProject section */ 226 | 227 | /* Begin PBXResourcesBuildPhase section */ 228 | 9F9D546F1D081D12005B259C /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 9F9D547F1D081D12005B259C /* LaunchScreen.storyboard in Resources */, 233 | 9F9D547C1D081D12005B259C /* Assets.xcassets in Resources */, 234 | 9F9D547A1D081D12005B259C /* Main.storyboard in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | 9F9D54B41D0852D8005B259C /* Resources */ = { 239 | isa = PBXResourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | /* End PBXResourcesBuildPhase section */ 246 | 247 | /* Begin PBXShellScriptBuildPhase section */ 248 | 29321844DE7923BA591F0B55 /* [CP] Embed Pods Frameworks */ = { 249 | isa = PBXShellScriptBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | inputPaths = ( 254 | ); 255 | name = "[CP] Embed Pods Frameworks"; 256 | outputPaths = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; 261 | showEnvVarsInLog = 0; 262 | }; 263 | 33A5F182A28B50194F864B87 /* [CP] Check Pods Manifest.lock */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | ); 270 | name = "[CP] Check Pods Manifest.lock"; 271 | outputPaths = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | BEFF62B2A9F2D3DD0D5DC721 /* [CP] Copy Pods Resources */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | ); 285 | name = "[CP] Copy Pods Resources"; 286 | outputPaths = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | shellPath = /bin/sh; 290 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; 291 | showEnvVarsInLog = 0; 292 | }; 293 | /* End PBXShellScriptBuildPhase section */ 294 | 295 | /* Begin PBXSourcesBuildPhase section */ 296 | 9F9D546D1D081D12005B259C /* Sources */ = { 297 | isa = PBXSourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 9F9D54771D081D12005B259C /* ViewController.swift in Sources */, 301 | 9F9D54751D081D12005B259C /* AppDelegate.swift in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 9F9D54B21D0852D8005B259C /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 9F9D54B91D0852D8005B259C /* ExampleUITests.swift in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 9F9D54BC1D0852D8005B259C /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 9F9D54701D081D12005B259C /* Example */; 319 | targetProxy = 9F9D54BB1D0852D8005B259C /* PBXContainerItemProxy */; 320 | }; 321 | /* End PBXTargetDependency section */ 322 | 323 | /* Begin PBXVariantGroup section */ 324 | 9F9D54781D081D12005B259C /* Main.storyboard */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 9F9D54791D081D12005B259C /* Base */, 328 | ); 329 | name = Main.storyboard; 330 | sourceTree = ""; 331 | }; 332 | 9F9D547D1D081D12005B259C /* LaunchScreen.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 9F9D547E1D081D12005B259C /* Base */, 336 | ); 337 | name = LaunchScreen.storyboard; 338 | sourceTree = ""; 339 | }; 340 | /* End PBXVariantGroup section */ 341 | 342 | /* Begin XCBuildConfiguration section */ 343 | 9F9D54811D081D12005B259C /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ALWAYS_SEARCH_USER_PATHS = NO; 347 | CLANG_ANALYZER_NONNULL = YES; 348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 349 | CLANG_CXX_LIBRARY = "libc++"; 350 | CLANG_ENABLE_MODULES = YES; 351 | CLANG_ENABLE_OBJC_ARC = YES; 352 | CLANG_WARN_BOOL_CONVERSION = YES; 353 | CLANG_WARN_CONSTANT_CONVERSION = YES; 354 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 355 | CLANG_WARN_EMPTY_BODY = YES; 356 | CLANG_WARN_ENUM_CONVERSION = YES; 357 | CLANG_WARN_INT_CONVERSION = YES; 358 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 385 | TARGETED_DEVICE_FAMILY = "1,2"; 386 | }; 387 | name = Debug; 388 | }; 389 | 9F9D54821D081D12005B259C /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INT_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_UNREACHABLE_CODE = YES; 406 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = NO; 409 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 410 | ENABLE_NS_ASSERTIONS = NO; 411 | ENABLE_STRICT_OBJC_MSGSEND = YES; 412 | GCC_C_LANGUAGE_STANDARD = gnu99; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 416 | GCC_WARN_UNDECLARED_SELECTOR = YES; 417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 418 | GCC_WARN_UNUSED_FUNCTION = YES; 419 | GCC_WARN_UNUSED_VARIABLE = YES; 420 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 421 | MTL_ENABLE_DEBUG_INFO = NO; 422 | SDKROOT = iphoneos; 423 | TARGETED_DEVICE_FAMILY = "1,2"; 424 | VALIDATE_PRODUCT = YES; 425 | }; 426 | name = Release; 427 | }; 428 | 9F9D54841D081D12005B259C /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | baseConfigurationReference = A24CE37A0E77BB3AEF80B571 /* Pods-Example.debug.xcconfig */; 431 | buildSettings = { 432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 433 | DEVELOPMENT_TEAM = Z6P74P6T99; 434 | INFOPLIST_FILE = Example/Info.plist; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.Example; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | SWIFT_VERSION = 3.0; 439 | }; 440 | name = Debug; 441 | }; 442 | 9F9D54851D081D12005B259C /* Release */ = { 443 | isa = XCBuildConfiguration; 444 | baseConfigurationReference = 161C88F8C97E0B798550212B /* Pods-Example.release.xcconfig */; 445 | buildSettings = { 446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 447 | DEVELOPMENT_TEAM = Z6P74P6T99; 448 | INFOPLIST_FILE = Example/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 450 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.Example; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 453 | SWIFT_VERSION = 3.0; 454 | }; 455 | name = Release; 456 | }; 457 | 9F9D54BD1D0852D8005B259C /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | INFOPLIST_FILE = ExampleUITests/Info.plist; 461 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 462 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.ExampleUITests; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | SWIFT_VERSION = 3.0; 465 | TEST_TARGET_NAME = Example; 466 | }; 467 | name = Debug; 468 | }; 469 | 9F9D54BE1D0852D8005B259C /* Release */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | INFOPLIST_FILE = ExampleUITests/Info.plist; 473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 474 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.ExampleUITests; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 477 | SWIFT_VERSION = 3.0; 478 | TEST_TARGET_NAME = Example; 479 | }; 480 | name = Release; 481 | }; 482 | /* End XCBuildConfiguration section */ 483 | 484 | /* Begin XCConfigurationList section */ 485 | 9F9D546C1D081D11005B259C /* Build configuration list for PBXProject "Example" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 9F9D54811D081D12005B259C /* Debug */, 489 | 9F9D54821D081D12005B259C /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | 9F9D54831D081D12005B259C /* Build configuration list for PBXNativeTarget "Example" */ = { 495 | isa = XCConfigurationList; 496 | buildConfigurations = ( 497 | 9F9D54841D081D12005B259C /* Debug */, 498 | 9F9D54851D081D12005B259C /* Release */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | 9F9D54BF1D0852D8005B259C /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { 504 | isa = XCConfigurationList; 505 | buildConfigurations = ( 506 | 9F9D54BD1D0852D8005B259C /* Debug */, 507 | 9F9D54BE1D0852D8005B259C /* Release */, 508 | ); 509 | defaultConfigurationIsVisible = 0; 510 | defaultConfigurationName = Release; 511 | }; 512 | /* End XCConfigurationList section */ 513 | }; 514 | rootObject = 9F9D54691D081D11005B259C /* Project object */; 515 | } 516 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example 4 | // 5 | // Created by Thomas Ricouard on 08/06/16. 6 | // Copyright © 2016 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/Example/Assets.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 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Example/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 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 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/Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Example 4 | // 5 | // Created by Thomas Ricouard on 08/06/16. 6 | // Copyright © 2016 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import PopupViewController 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | // Do any additional setup after loading the view, typically from a nib. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | @IBAction func onStandardAlert(_ sender: AnyObject) { 26 | let alert = PopupViewController(title: "Alert title", message: "Alert message, which can be very long and etc....") 27 | alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil)) 28 | present(alert, animated: true, completion: nil) 29 | } 30 | 31 | @IBAction func onCustomAlert(_ sender: AnyObject) { 32 | var customizable = PopupViewController.Customizable() 33 | customizable.titleColor = UIColor.blue 34 | customizable.positiveActionColor = UIColor.red 35 | customizable.messageColor = UIColor.brown 36 | customizable.messageFont = UIFont.boldSystemFont(ofSize: 22) 37 | customizable.negativeActionColor = UIColor.brown 38 | customizable.positiveActionColor = UIColor.blue 39 | customizable.negativeActionBackgroundColor = UIColor.black 40 | customizable.positiveActionBackgroundColor = UIColor.white 41 | customizable.positiveActionHighlightColor = UIColor.green 42 | customizable.negativeActionHighlightColor = UIColor.red 43 | 44 | let alert = PopupViewController(title: "Alert title", 45 | message: "Alert message, which can be very long message and all that but nobody will ever read it.", 46 | customizable: customizable) 47 | alert.blurStyle = .extraLight 48 | alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil)) 49 | alert.addAction(PopupAction(title: "Cancel", type: .negative, handler: nil)) 50 | present(alert, animated: true, completion: nil) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Example/ExampleUITests/ExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleUITests.swift 3 | // ExampleUITests 4 | // 5 | // Created by Thomas Ricouard on 08/06/16. 6 | // Copyright © 2016 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class ExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | let app = XCUIApplication() 33 | app.buttons["Standard Alert"].tap() 34 | 35 | let okButton = app.buttons["Ok"] 36 | okButton.tap() 37 | app.buttons["Custom Alert"].tap() 38 | okButton.tap() 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Example/ExampleUITests/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/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | workspace '../PopupViewController' 4 | 5 | target 'Example' do 6 | # Comment this line if you're not using Swift and don't want to use dynamic frameworks 7 | use_frameworks! 8 | 9 | pod 'Cartography' 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Cartography (1.0.1) 3 | 4 | DEPENDENCIES: 5 | - Cartography 6 | 7 | SPEC CHECKSUMS: 8 | Cartography: c1460e99395b824d9d75360b0382faeb0b33dcd7 9 | 10 | PODFILE CHECKSUM: 512f88be2177d89ae6c638fc7c3156c69d816402 11 | 12 | COCOAPODS: 1.1.0.rc.2 13 | -------------------------------------------------------------------------------- /Images/classy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/PopupViewController/c8f0cf72a4b5741edc94a2b97cc5d5dd1453b461/Images/classy.png -------------------------------------------------------------------------------- /Images/ugly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/PopupViewController/c8f0cf72a4b5741edc94a2b97cc5d5dd1453b461/Images/ugly.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Eddie Kaiger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /PopupViewController.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint PopupViewController.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "PopupViewController" 19 | s.version = "0.1.5" 20 | s.summary = "Drop in replacement of UIAlertController with customization options" 21 | s.description = <<-DESC 22 | Drop in replacement of UIAlertController with customization options" 23 | DESC 24 | s.homepage = "https://github.com/Dimillian/PopupViewController/" 25 | 26 | s.license = "MIT" 27 | s.author = { "Thomas Ricouard" => "ricouard77@gmail.com" } 28 | s.social_media_url = "http://twitter.com/dimillian" 29 | 30 | s.platform = :ios, "9.0" 31 | 32 | s.source = { :git => "https://github.com/Dimillian/PopupViewController.git", :tag => "#{s.version}" } 33 | s.source_files = "PopupViewController/PopupViewController/*.swift" 34 | 35 | s.dependency "Cartography", "~> 1.0.1" 36 | 37 | end 38 | -------------------------------------------------------------------------------- /PopupViewController.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /PopupViewController/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/PopupViewController/c8f0cf72a4b5741edc94a2b97cc5d5dd1453b461/PopupViewController/.DS_Store -------------------------------------------------------------------------------- /PopupViewController/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | workspace '../PopupViewController' 4 | 5 | target 'PopupViewController' do 6 | use_frameworks! 7 | pod 'Cartography' 8 | end 9 | 10 | target 'PopupViewControllerTests' do 11 | use_frameworks! 12 | pod 'Cartography' 13 | end 14 | 15 | post_install do |installer| 16 | installer.pods_project.targets.each do |target| 17 | target.build_configurations.each do |config| 18 | config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" 19 | config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" 20 | config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" 21 | end 22 | end 23 | end -------------------------------------------------------------------------------- /PopupViewController/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Cartography (1.0.1) 3 | 4 | DEPENDENCIES: 5 | - Cartography 6 | 7 | SPEC CHECKSUMS: 8 | Cartography: c1460e99395b824d9d75360b0382faeb0b33dcd7 9 | 10 | PODFILE CHECKSUM: 4c2a9dd90914183f5d689573c28adf11b438ccd1 11 | 12 | COCOAPODS: 1.1.0.rc.2 13 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 60B0E080C7C9621C4EFCF608 /* Pods_PopupViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071E90C5DC37F678DB08D03F /* Pods_PopupViewController.framework */; }; 11 | 9F9D54941D081D47005B259C /* PopupViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F9D54931D081D47005B259C /* PopupViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 9F9D549C1D081D74005B259C /* PopupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9D549B1D081D74005B259C /* PopupViewController.swift */; }; 13 | 9F9D54A61D08236B005B259C /* Cartography.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F9D54A51D08236B005B259C /* Cartography.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 14 | 9FA875221D0853F90088A2C4 /* PopupViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA875211D0853F90088A2C4 /* PopupViewControllerTests.swift */; }; 15 | 9FA875241D0853F90088A2C4 /* PopupViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F9D54901D081D47005B259C /* PopupViewController.framework */; }; 16 | C5369BB1786FF58A33496C47 /* Pods_PopupViewControllerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F3B9ABA84E8B80161FB125 /* Pods_PopupViewControllerTests.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 9FA875251D0853F90088A2C4 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 9F9D54871D081D47005B259C /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 9F9D548F1D081D47005B259C; 25 | remoteInfo = PopupViewController; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 071E90C5DC37F678DB08D03F /* Pods_PopupViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PopupViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 3E514BF592D1FAA6020E1FE4 /* Pods-PopupViewControllerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupViewControllerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PopupViewControllerTests/Pods-PopupViewControllerTests.debug.xcconfig"; sourceTree = ""; }; 32 | 596853969B1CAC6A814E7B40 /* Pods-PopupViewControllerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupViewControllerTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PopupViewControllerTests/Pods-PopupViewControllerTests.release.xcconfig"; sourceTree = ""; }; 33 | 76F3B9ABA84E8B80161FB125 /* Pods_PopupViewControllerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PopupViewControllerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 7E1F59047AE61CFEC811B114 /* Pods-PopupViewController.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupViewController.release.xcconfig"; path = "Pods/Target Support Files/Pods-PopupViewController/Pods-PopupViewController.release.xcconfig"; sourceTree = ""; }; 35 | 8DF29EC4BEFD14EC96B15169 /* Pods-PopupViewController.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupViewController.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PopupViewController/Pods-PopupViewController.debug.xcconfig"; sourceTree = ""; }; 36 | 9F9D54901D081D47005B259C /* PopupViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PopupViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 9F9D54931D081D47005B259C /* PopupViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopupViewController.h; sourceTree = ""; }; 38 | 9F9D54951D081D47005B259C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 9F9D549B1D081D74005B259C /* PopupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupViewController.swift; sourceTree = ""; }; 40 | 9F9D54A51D08236B005B259C /* Cartography.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cartography.framework; path = "Pods/../build/Debug-iphoneos/Cartography/Cartography.framework"; sourceTree = ""; }; 41 | 9FA8751F1D0853F90088A2C4 /* PopupViewControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PopupViewControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 9FA875211D0853F90088A2C4 /* PopupViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupViewControllerTests.swift; sourceTree = ""; }; 43 | 9FA875231D0853F90088A2C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | 9F9D548C1D081D47005B259C /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | 9F9D54A61D08236B005B259C /* Cartography.framework in Frameworks */, 52 | 60B0E080C7C9621C4EFCF608 /* Pods_PopupViewController.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | 9FA8751C1D0853F90088A2C4 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 9FA875241D0853F90088A2C4 /* PopupViewController.framework in Frameworks */, 61 | C5369BB1786FF58A33496C47 /* Pods_PopupViewControllerTests.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 6BCE1CFDFC0FB43F74F21FE4 /* Pods */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 8DF29EC4BEFD14EC96B15169 /* Pods-PopupViewController.debug.xcconfig */, 72 | 7E1F59047AE61CFEC811B114 /* Pods-PopupViewController.release.xcconfig */, 73 | 3E514BF592D1FAA6020E1FE4 /* Pods-PopupViewControllerTests.debug.xcconfig */, 74 | 596853969B1CAC6A814E7B40 /* Pods-PopupViewControllerTests.release.xcconfig */, 75 | ); 76 | name = Pods; 77 | sourceTree = ""; 78 | }; 79 | 9F9D54861D081D47005B259C = { 80 | isa = PBXGroup; 81 | children = ( 82 | 9F9D54921D081D47005B259C /* PopupViewController */, 83 | 9FA875201D0853F90088A2C4 /* PopupViewControllerTests */, 84 | 9F9D54911D081D47005B259C /* Products */, 85 | 6BCE1CFDFC0FB43F74F21FE4 /* Pods */, 86 | DB76A2AFE8B618C8A2F9A79D /* Frameworks */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 9F9D54911D081D47005B259C /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9F9D54901D081D47005B259C /* PopupViewController.framework */, 94 | 9FA8751F1D0853F90088A2C4 /* PopupViewControllerTests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 9F9D54921D081D47005B259C /* PopupViewController */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 9F9D54931D081D47005B259C /* PopupViewController.h */, 103 | 9F9D54951D081D47005B259C /* Info.plist */, 104 | 9F9D549B1D081D74005B259C /* PopupViewController.swift */, 105 | ); 106 | path = PopupViewController; 107 | sourceTree = ""; 108 | }; 109 | 9FA875201D0853F90088A2C4 /* PopupViewControllerTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 9FA875211D0853F90088A2C4 /* PopupViewControllerTests.swift */, 113 | 9FA875231D0853F90088A2C4 /* Info.plist */, 114 | ); 115 | path = PopupViewControllerTests; 116 | sourceTree = ""; 117 | }; 118 | DB76A2AFE8B618C8A2F9A79D /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 9F9D54A51D08236B005B259C /* Cartography.framework */, 122 | 071E90C5DC37F678DB08D03F /* Pods_PopupViewController.framework */, 123 | 76F3B9ABA84E8B80161FB125 /* Pods_PopupViewControllerTests.framework */, 124 | ); 125 | name = Frameworks; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXHeadersBuildPhase section */ 131 | 9F9D548D1D081D47005B259C /* Headers */ = { 132 | isa = PBXHeadersBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | 9F9D54941D081D47005B259C /* PopupViewController.h in Headers */, 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXHeadersBuildPhase section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 9F9D548F1D081D47005B259C /* PopupViewController */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 9F9D54981D081D47005B259C /* Build configuration list for PBXNativeTarget "PopupViewController" */; 145 | buildPhases = ( 146 | 47A8D0158A95D2E130867862 /* [CP] Check Pods Manifest.lock */, 147 | 9F9D548B1D081D47005B259C /* Sources */, 148 | 9F9D548C1D081D47005B259C /* Frameworks */, 149 | 9F9D548D1D081D47005B259C /* Headers */, 150 | 9F9D548E1D081D47005B259C /* Resources */, 151 | AE833F106A17F1B7596C556E /* [CP] Copy Pods Resources */, 152 | ); 153 | buildRules = ( 154 | ); 155 | dependencies = ( 156 | ); 157 | name = PopupViewController; 158 | productName = PopupViewController; 159 | productReference = 9F9D54901D081D47005B259C /* PopupViewController.framework */; 160 | productType = "com.apple.product-type.framework"; 161 | }; 162 | 9FA8751E1D0853F90088A2C4 /* PopupViewControllerTests */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = 9FA875291D0853F90088A2C4 /* Build configuration list for PBXNativeTarget "PopupViewControllerTests" */; 165 | buildPhases = ( 166 | D6573A950CBEF649D7BB06F4 /* [CP] Check Pods Manifest.lock */, 167 | 9FA8751B1D0853F90088A2C4 /* Sources */, 168 | 9FA8751C1D0853F90088A2C4 /* Frameworks */, 169 | 9FA8751D1D0853F90088A2C4 /* Resources */, 170 | E9D6D446077AC2B5947E4E13 /* [CP] Embed Pods Frameworks */, 171 | E27F3AF07F1991479FB35B20 /* [CP] Copy Pods Resources */, 172 | ); 173 | buildRules = ( 174 | ); 175 | dependencies = ( 176 | 9FA875261D0853F90088A2C4 /* PBXTargetDependency */, 177 | ); 178 | name = PopupViewControllerTests; 179 | productName = PopupViewControllerTests; 180 | productReference = 9FA8751F1D0853F90088A2C4 /* PopupViewControllerTests.xctest */; 181 | productType = "com.apple.product-type.bundle.unit-test"; 182 | }; 183 | /* End PBXNativeTarget section */ 184 | 185 | /* Begin PBXProject section */ 186 | 9F9D54871D081D47005B259C /* Project object */ = { 187 | isa = PBXProject; 188 | attributes = { 189 | LastSwiftUpdateCheck = 0730; 190 | LastUpgradeCheck = 0800; 191 | ORGANIZATIONNAME = "Thomas Ricouard"; 192 | TargetAttributes = { 193 | 9F9D548F1D081D47005B259C = { 194 | CreatedOnToolsVersion = 7.3.1; 195 | LastSwiftMigration = 0800; 196 | ProvisioningStyle = Automatic; 197 | }; 198 | 9FA8751E1D0853F90088A2C4 = { 199 | CreatedOnToolsVersion = 7.3.1; 200 | }; 201 | }; 202 | }; 203 | buildConfigurationList = 9F9D548A1D081D47005B259C /* Build configuration list for PBXProject "PopupViewController" */; 204 | compatibilityVersion = "Xcode 3.2"; 205 | developmentRegion = English; 206 | hasScannedForEncodings = 0; 207 | knownRegions = ( 208 | en, 209 | ); 210 | mainGroup = 9F9D54861D081D47005B259C; 211 | productRefGroup = 9F9D54911D081D47005B259C /* Products */; 212 | projectDirPath = ""; 213 | projectRoot = ""; 214 | targets = ( 215 | 9F9D548F1D081D47005B259C /* PopupViewController */, 216 | 9FA8751E1D0853F90088A2C4 /* PopupViewControllerTests */, 217 | ); 218 | }; 219 | /* End PBXProject section */ 220 | 221 | /* Begin PBXResourcesBuildPhase section */ 222 | 9F9D548E1D081D47005B259C /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | 9FA8751D1D0853F90088A2C4 /* Resources */ = { 230 | isa = PBXResourcesBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXResourcesBuildPhase section */ 237 | 238 | /* Begin PBXShellScriptBuildPhase section */ 239 | 47A8D0158A95D2E130867862 /* [CP] Check Pods Manifest.lock */ = { 240 | isa = PBXShellScriptBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | inputPaths = ( 245 | ); 246 | name = "[CP] Check Pods Manifest.lock"; 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 252 | showEnvVarsInLog = 0; 253 | }; 254 | AE833F106A17F1B7596C556E /* [CP] Copy Pods Resources */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputPaths = ( 260 | ); 261 | name = "[CP] Copy Pods Resources"; 262 | outputPaths = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | shellPath = /bin/sh; 266 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PopupViewController/Pods-PopupViewController-resources.sh\"\n"; 267 | showEnvVarsInLog = 0; 268 | }; 269 | D6573A950CBEF649D7BB06F4 /* [CP] Check Pods Manifest.lock */ = { 270 | isa = PBXShellScriptBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | inputPaths = ( 275 | ); 276 | name = "[CP] Check Pods Manifest.lock"; 277 | outputPaths = ( 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | shellPath = /bin/sh; 281 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 282 | showEnvVarsInLog = 0; 283 | }; 284 | E27F3AF07F1991479FB35B20 /* [CP] Copy Pods Resources */ = { 285 | isa = PBXShellScriptBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | inputPaths = ( 290 | ); 291 | name = "[CP] Copy Pods Resources"; 292 | outputPaths = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | shellPath = /bin/sh; 296 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PopupViewControllerTests/Pods-PopupViewControllerTests-resources.sh\"\n"; 297 | showEnvVarsInLog = 0; 298 | }; 299 | E9D6D446077AC2B5947E4E13 /* [CP] Embed Pods Frameworks */ = { 300 | isa = PBXShellScriptBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | ); 304 | inputPaths = ( 305 | ); 306 | name = "[CP] Embed Pods Frameworks"; 307 | outputPaths = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PopupViewControllerTests/Pods-PopupViewControllerTests-frameworks.sh\"\n"; 312 | showEnvVarsInLog = 0; 313 | }; 314 | /* End PBXShellScriptBuildPhase section */ 315 | 316 | /* Begin PBXSourcesBuildPhase section */ 317 | 9F9D548B1D081D47005B259C /* Sources */ = { 318 | isa = PBXSourcesBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | 9F9D549C1D081D74005B259C /* PopupViewController.swift in Sources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | 9FA8751B1D0853F90088A2C4 /* Sources */ = { 326 | isa = PBXSourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 9FA875221D0853F90088A2C4 /* PopupViewControllerTests.swift in Sources */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | /* End PBXSourcesBuildPhase section */ 334 | 335 | /* Begin PBXTargetDependency section */ 336 | 9FA875261D0853F90088A2C4 /* PBXTargetDependency */ = { 337 | isa = PBXTargetDependency; 338 | target = 9F9D548F1D081D47005B259C /* PopupViewController */; 339 | targetProxy = 9FA875251D0853F90088A2C4 /* PBXContainerItemProxy */; 340 | }; 341 | /* End PBXTargetDependency section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 9F9D54961D081D47005B259C /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | CLANG_ANALYZER_NONNULL = YES; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INFINITE_RECURSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 362 | CLANG_WARN_UNREACHABLE_CODE = YES; 363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 365 | COPY_PHASE_STRIP = NO; 366 | CURRENT_PROJECT_VERSION = 1; 367 | DEBUG_INFORMATION_FORMAT = dwarf; 368 | ENABLE_STRICT_OBJC_MSGSEND = YES; 369 | ENABLE_TESTABILITY = YES; 370 | GCC_C_LANGUAGE_STANDARD = gnu99; 371 | GCC_DYNAMIC_NO_PIC = NO; 372 | GCC_NO_COMMON_BLOCKS = YES; 373 | GCC_OPTIMIZATION_LEVEL = 0; 374 | GCC_PREPROCESSOR_DEFINITIONS = ( 375 | "DEBUG=1", 376 | "$(inherited)", 377 | ); 378 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 379 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 380 | GCC_WARN_UNDECLARED_SELECTOR = YES; 381 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 382 | GCC_WARN_UNUSED_FUNCTION = YES; 383 | GCC_WARN_UNUSED_VARIABLE = YES; 384 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 385 | MTL_ENABLE_DEBUG_INFO = YES; 386 | ONLY_ACTIVE_ARCH = YES; 387 | SDKROOT = iphoneos; 388 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 389 | TARGETED_DEVICE_FAMILY = "1,2"; 390 | VERSIONING_SYSTEM = "apple-generic"; 391 | VERSION_INFO_PREFIX = ""; 392 | }; 393 | name = Debug; 394 | }; 395 | 9F9D54971D081D47005B259C /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ALWAYS_SEARCH_USER_PATHS = NO; 399 | CLANG_ANALYZER_NONNULL = YES; 400 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 401 | CLANG_CXX_LIBRARY = "libc++"; 402 | CLANG_ENABLE_MODULES = YES; 403 | CLANG_ENABLE_OBJC_ARC = YES; 404 | CLANG_WARN_BOOL_CONVERSION = YES; 405 | CLANG_WARN_CONSTANT_CONVERSION = YES; 406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 407 | CLANG_WARN_EMPTY_BODY = YES; 408 | CLANG_WARN_ENUM_CONVERSION = YES; 409 | CLANG_WARN_INFINITE_RECURSION = YES; 410 | CLANG_WARN_INT_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 413 | CLANG_WARN_UNREACHABLE_CODE = YES; 414 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 415 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 416 | COPY_PHASE_STRIP = NO; 417 | CURRENT_PROJECT_VERSION = 1; 418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 419 | ENABLE_NS_ASSERTIONS = NO; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | GCC_C_LANGUAGE_STANDARD = gnu99; 422 | GCC_NO_COMMON_BLOCKS = YES; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 430 | MTL_ENABLE_DEBUG_INFO = NO; 431 | SDKROOT = iphoneos; 432 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 433 | TARGETED_DEVICE_FAMILY = "1,2"; 434 | VALIDATE_PRODUCT = YES; 435 | VERSIONING_SYSTEM = "apple-generic"; 436 | VERSION_INFO_PREFIX = ""; 437 | }; 438 | name = Release; 439 | }; 440 | 9F9D54991D081D47005B259C /* Debug */ = { 441 | isa = XCBuildConfiguration; 442 | baseConfigurationReference = 8DF29EC4BEFD14EC96B15169 /* Pods-PopupViewController.debug.xcconfig */; 443 | buildSettings = { 444 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 445 | CLANG_ENABLE_MODULES = YES; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 447 | DEFINES_MODULE = YES; 448 | DYLIB_COMPATIBILITY_VERSION = 1; 449 | DYLIB_CURRENT_VERSION = 1; 450 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/build/Debug-iphoneos/Cartography", 454 | ); 455 | INFOPLIST_FILE = PopupViewController/Info.plist; 456 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.PopupViewController; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | SKIP_INSTALL = YES; 461 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 462 | SWIFT_VERSION = 3.0; 463 | }; 464 | name = Debug; 465 | }; 466 | 9F9D549A1D081D47005B259C /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7E1F59047AE61CFEC811B114 /* Pods-PopupViewController.release.xcconfig */; 469 | buildSettings = { 470 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 471 | CLANG_ENABLE_MODULES = YES; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | DEFINES_MODULE = YES; 474 | DYLIB_COMPATIBILITY_VERSION = 1; 475 | DYLIB_CURRENT_VERSION = 1; 476 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 477 | FRAMEWORK_SEARCH_PATHS = ( 478 | "$(inherited)", 479 | "$(PROJECT_DIR)/build/Debug-iphoneos/Cartography", 480 | ); 481 | INFOPLIST_FILE = PopupViewController/Info.plist; 482 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 484 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.PopupViewController; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SKIP_INSTALL = YES; 487 | SWIFT_VERSION = 3.0; 488 | }; 489 | name = Release; 490 | }; 491 | 9FA875271D0853F90088A2C4 /* Debug */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = 3E514BF592D1FAA6020E1FE4 /* Pods-PopupViewControllerTests.debug.xcconfig */; 494 | buildSettings = { 495 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 496 | INFOPLIST_FILE = PopupViewControllerTests/Info.plist; 497 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 498 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.PopupViewControllerTests; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | SWIFT_VERSION = 3.0; 501 | }; 502 | name = Debug; 503 | }; 504 | 9FA875281D0853F90088A2C4 /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | baseConfigurationReference = 596853969B1CAC6A814E7B40 /* Pods-PopupViewControllerTests.release.xcconfig */; 507 | buildSettings = { 508 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 509 | INFOPLIST_FILE = PopupViewControllerTests/Info.plist; 510 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 511 | PRODUCT_BUNDLE_IDENTIFIER = com.dimillian.PopupViewControllerTests; 512 | PRODUCT_NAME = "$(TARGET_NAME)"; 513 | SWIFT_VERSION = 3.0; 514 | }; 515 | name = Release; 516 | }; 517 | /* End XCBuildConfiguration section */ 518 | 519 | /* Begin XCConfigurationList section */ 520 | 9F9D548A1D081D47005B259C /* Build configuration list for PBXProject "PopupViewController" */ = { 521 | isa = XCConfigurationList; 522 | buildConfigurations = ( 523 | 9F9D54961D081D47005B259C /* Debug */, 524 | 9F9D54971D081D47005B259C /* Release */, 525 | ); 526 | defaultConfigurationIsVisible = 0; 527 | defaultConfigurationName = Release; 528 | }; 529 | 9F9D54981D081D47005B259C /* Build configuration list for PBXNativeTarget "PopupViewController" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | 9F9D54991D081D47005B259C /* Debug */, 533 | 9F9D549A1D081D47005B259C /* Release */, 534 | ); 535 | defaultConfigurationIsVisible = 0; 536 | defaultConfigurationName = Release; 537 | }; 538 | 9FA875291D0853F90088A2C4 /* Build configuration list for PBXNativeTarget "PopupViewControllerTests" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | 9FA875271D0853F90088A2C4 /* Debug */, 542 | 9FA875281D0853F90088A2C4 /* Release */, 543 | ); 544 | defaultConfigurationIsVisible = 0; 545 | defaultConfigurationName = Release; 546 | }; 547 | /* End XCConfigurationList section */ 548 | }; 549 | rootObject = 9F9D54871D081D47005B259C /* Project object */; 550 | } 551 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController.xcodeproj/xcshareddata/xcschemes/PopupViewController.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 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController.xcodeproj/xcshareddata/xcschemes/PopupViewControllerTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController/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 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController/PopupViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PopupViewController.h 3 | // PopupViewController 4 | // 5 | // Created by Thomas Ricouard on 08/06/16. 6 | // Copyright © 2016 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for PopupViewController. 12 | FOUNDATION_EXPORT double PopupViewControllerVersionNumber; 13 | 14 | //! Project version string for PopupViewController. 15 | FOUNDATION_EXPORT const unsigned char PopupViewControllerVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewController/PopupViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopupViewController.swift 3 | // bookshots 4 | // 5 | // Created by Thomas Ricouard on 07/06/16. 6 | // Copyright © 2016 Glose. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Cartography 11 | 12 | 13 | // MARK: PopupAction 14 | 15 | /** 16 | Represent an action of a PopupViewController. It have a title, an action handler and a type. 17 | */ 18 | open class PopupAction { 19 | 20 | public enum ActionType { 21 | case positive, negative 22 | } 23 | 24 | // MARK: Public properties. 25 | 26 | /// The title of the action, which will be displayed in a clickable button. 27 | var title: String? 28 | 29 | /// The type of the action, can be Positive (standard) or negative (Usually bold). 30 | var actionType: ActionType? 31 | 32 | /// The completion handler for when the user trigger the action. The alert will also be dismissed. 33 | var handler: ((PopupAction) -> Void)? 34 | 35 | fileprivate init() { 36 | 37 | } 38 | 39 | /// Covenience init. Take a title, a type and a completion handler. 40 | required public convenience init(title: String, type: ActionType, handler: ((PopupAction) -> Void)?) { 41 | self.init() 42 | self.title = title 43 | self.actionType = type 44 | self.handler = handler 45 | } 46 | } 47 | 48 | // MARK: PopupViewController 49 | 50 | /** 51 | PopupViewController is a drop in replacement of UIAlertController but which much more customization options. 52 | 53 | Come with a default dark theme. 54 | 55 | You only need to call the covenience init, then add one or more action, then present it using presentViewController. 56 | */ 57 | open class PopupViewController: UIViewController, UIViewControllerTransitioningDelegate { 58 | 59 | // MARK: Public properties. 60 | 61 | /// The title which will be displayed in the alert. Can be modified any time. 62 | override open var title: String! { 63 | didSet { 64 | alertView.titleLabel.text = title 65 | alertView.setNeedsUpdateConstraints() 66 | } 67 | } 68 | /// The message which will be displayed in the alert. Can be modified any time. 69 | open var message: String! { 70 | didSet { 71 | alertView.messageLabel.text = message 72 | alertView.setNeedsUpdateConstraints() 73 | } 74 | } 75 | 76 | /// Blur style for the alert view, default is Dark. 77 | open var blurStyle = UIBlurEffectStyle.dark { 78 | didSet { 79 | blurView.effect = UIBlurEffect(style: blurStyle) 80 | } 81 | } 82 | 83 | /// Default customizable used if you don't pass any. Can be set to a new one. 84 | static open var sharedCustomizable = Customizable() 85 | 86 | /// Init this struct and set any properties to customize your alert view accordingly. 87 | /// Must be passed in the init parameter. 88 | public struct Customizable { 89 | public var titleFont = UIFont.systemFont(ofSize: 17.0) 90 | public var titleColor = UIColor.red 91 | public var messageFont = UIFont.systemFont(ofSize: 15.0) 92 | public var messageColor = UIColor.white 93 | public var postiveActionFont = UIFont.systemFont(ofSize: 15) 94 | public var positiveActionColor = UIColor.white 95 | public var positiveActionBackgroundColor = UIColor.clear 96 | public var positiveActionHighlightColor = UIColor.lightGray 97 | public var negativeActionFont = UIFont.boldSystemFont(ofSize: 15) 98 | public var negativeActionColor = UIColor.white 99 | public var negativeActionBackgroundColor = UIColor.clear 100 | public var negativeActionHighlightColor = UIColor.lightGray 101 | public var actionsSeparatorColor = UIColor.darkGray 102 | public var alertBorderColor = UIColor.darkGray 103 | 104 | public init() { 105 | 106 | } 107 | } 108 | 109 | // MARK: Private properties. 110 | fileprivate var actions: [PopupAction] = [] 111 | fileprivate var alertView: PopupAlertView! 112 | fileprivate var toVc: UIViewController? 113 | fileprivate let blurView: UIVisualEffectView = { 114 | $0.layer.masksToBounds = true 115 | $0.layer.cornerRadius = 6 116 | return $0 117 | }(UIVisualEffectView(effect: UIBlurEffect(style: .dark))) 118 | 119 | /// Conveniance init. 120 | convenience public init(title: String, message: String, customizable: Customizable? = PopupViewController.sharedCustomizable) { 121 | self.init(nibName: nil, bundle: nil) 122 | 123 | alertView = PopupAlertView(title: title, 124 | message: message, 125 | customizable: customizable!, 126 | completionHandler: {alertView in 127 | self.dismiss(animated: true, completion: nil) 128 | }) 129 | self.message = message 130 | self.title = title 131 | 132 | modalPresentationStyle = .custom 133 | definesPresentationContext = true 134 | transitioningDelegate = self 135 | } 136 | 137 | /// Subclass can override to provide its own presenting transition. 138 | public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 139 | toVc = presenting 140 | return PopupViewControllerTransition(fromVC: presenting, toVC: presented) 141 | } 142 | 143 | 144 | /// Subclass can override to provide its own dismissal transition. 145 | public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 146 | if let toVc = toVc { 147 | let transition = PopupViewControllerTransition(fromVC: self, toVC: toVc) 148 | transition.presenting = false 149 | return transition 150 | } 151 | return nil 152 | } 153 | 154 | /// Add an action to the PopupViewController. Add all your actions before presenting. 155 | open func addAction(_ action: PopupAction) { 156 | actions.append(action) 157 | } 158 | 159 | open override func viewDidLoad() { 160 | super.viewDidLoad() 161 | 162 | view.backgroundColor = UIColor.black.withAlphaComponent(0.5) 163 | 164 | view.addSubview(blurView) 165 | view.addSubview(alertView) 166 | 167 | constrain(self.view, alertView) {view, alertView in 168 | alertView.width == 270 169 | alertView.center == view.center 170 | } 171 | 172 | alertView.addActions(actions) 173 | 174 | constrain(blurView, alertView) {blur, view in 175 | blur.edges == view.edges 176 | } 177 | } 178 | } 179 | 180 | /// Private transition for presenting and dismissal. 181 | private class PopupViewControllerTransition: NSObject, UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning { 182 | 183 | var presenting = true 184 | weak var fromVC : UIViewController! 185 | weak var toVC: UIViewController! 186 | 187 | override init() { 188 | 189 | } 190 | 191 | init(fromVC: UIViewController, toVC: UIViewController) { 192 | self.fromVC = fromVC 193 | self.toVC = toVC 194 | } 195 | 196 | @objc func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 197 | return 0.5 198 | } 199 | 200 | @objc func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 201 | let containerView = transitionContext.containerView 202 | 203 | if (presenting) { 204 | let alertController = toVC as! PopupViewController 205 | 206 | containerView.addSubview(alertController.view!) 207 | 208 | alertController.view.alpha = 0 209 | alertController.alertView.layer.transform = CATransform3DMakeScale(0.2, 0.2, 0.2) 210 | alertController.blurView.layer.transform = CATransform3DMakeScale(0.2, 0.2, 0.2) 211 | UIView.animate(withDuration: transitionDuration(using: transitionContext), 212 | delay: 0, 213 | usingSpringWithDamping: 0.8, 214 | initialSpringVelocity: 15, 215 | options: UIViewAnimationOptions(), 216 | animations: { 217 | alertController.view.alpha = 1 218 | alertController.alertView.layer.transform = CATransform3DIdentity 219 | alertController.blurView.layer.transform = CATransform3DIdentity 220 | }, completion: { (completed) in 221 | if completed { 222 | self.toVC.view.alpha = 1 223 | transitionContext.completeTransition(true) 224 | } 225 | }) 226 | } else { 227 | let alertController = fromVC as! PopupViewController 228 | UIView.animate(withDuration: transitionDuration(using: transitionContext), 229 | delay: 0, 230 | usingSpringWithDamping: 0.8, 231 | initialSpringVelocity: 15, 232 | options: UIViewAnimationOptions(), 233 | animations: { 234 | alertController.view.alpha = 0 235 | alertController.alertView.layer.transform = CATransform3DMakeScale(0.01, 0.01, 0.01) 236 | alertController.blurView.layer.transform = CATransform3DMakeScale(0.01, 0.01, 0.01) 237 | }, completion: { (completed) in 238 | if completed { 239 | transitionContext.completeTransition(true) 240 | } 241 | }) 242 | } 243 | } 244 | 245 | } 246 | 247 | private class PopupAlertView: UIView { 248 | 249 | let titleLabel: PopupAlertLabel 250 | let messageLabel: PopupAlertLabel 251 | var buttons: [PopupAlertButton] = [] 252 | let completionHandler: ((PopupAlertView) -> Void)? 253 | let customizable: PopupViewController.Customizable 254 | 255 | init(title: String, message: String, customizable: PopupViewController.Customizable, completionHandler: ((PopupAlertView) -> Void)?) { 256 | self.titleLabel = PopupAlertLabel(text: title) 257 | self.messageLabel = PopupAlertLabel(text: message) 258 | self.customizable = customizable 259 | self.completionHandler = completionHandler 260 | 261 | super.init(frame: CGRect.zero) 262 | 263 | addSubview(titleLabel) 264 | addSubview(messageLabel) 265 | 266 | backgroundColor = UIColor.clear 267 | 268 | titleLabel.font = customizable.titleFont 269 | titleLabel.textColor = customizable.titleColor 270 | 271 | messageLabel.font = customizable.messageFont 272 | messageLabel.textColor = customizable.messageColor 273 | 274 | layer.masksToBounds = true 275 | layer.cornerRadius = 6 276 | layer.borderWidth = 0.5 277 | layer.borderColor = customizable.alertBorderColor.cgColor 278 | } 279 | 280 | required init?(coder aDecoder: NSCoder) { 281 | fatalError("init(coder:) has not been implemented") 282 | } 283 | 284 | fileprivate func addActions(_ actions: [PopupAction]) { 285 | 286 | for action in actions { 287 | 288 | let button = PopupAlertButton(action: action, customizable: customizable, touchHandler: {button in 289 | if let completionHandler = self.completionHandler { 290 | completionHandler(self) 291 | } 292 | }) 293 | 294 | addSubview(button) 295 | 296 | if let lastButton = buttons.last { 297 | constrain(self, button, lastButton){view, button, lastButton in 298 | button.height == 50 299 | button.top == lastButton.bottom 300 | button.left == view.left 301 | button.right == view.right 302 | } 303 | 304 | } else { 305 | constrain(self, button, messageLabel){view, button, messageLabel in 306 | button.height == 50 307 | button.top == messageLabel.bottom + 15 308 | button.left == view.left 309 | button.right == view.right 310 | } 311 | } 312 | buttons.append(button) 313 | } 314 | 315 | if let lastButton = buttons.last { 316 | constrain(self, lastButton) {view, lastButton in 317 | view.bottom == lastButton.bottom 318 | } 319 | } 320 | } 321 | 322 | fileprivate override func updateConstraints() { 323 | super.updateConstraints() 324 | 325 | constrain(self, titleLabel) {view, label in 326 | label.top == view.top + 15 327 | label.left == view.left + 15 328 | label.right == view.right - 15 329 | } 330 | 331 | titleLabel.sizeToFit() 332 | 333 | constrain(titleLabel, messageLabel) {title, message in 334 | message.top == title.bottom + 10 335 | message.left == title.left 336 | message.right == title.right 337 | } 338 | 339 | messageLabel.sizeToFit() 340 | 341 | } 342 | } 343 | 344 | private class PopupAlertLabel: UILabel { 345 | 346 | init(text: String) { 347 | super.init(frame: CGRect.zero) 348 | 349 | self.text = text 350 | textAlignment = .center 351 | numberOfLines = 0 352 | } 353 | 354 | required init?(coder aDecoder: NSCoder) { 355 | fatalError("init(coder:) has not been implemented") 356 | } 357 | 358 | } 359 | 360 | private class PopupAlertButton: UIButton { 361 | 362 | var hightlight = false { 363 | didSet { 364 | UIView.animate(withDuration: 0.15) { 365 | switch self.action!.actionType! { 366 | case .positive: 367 | self.backgroundColor = self.hightlight ? 368 | self.customizable.positiveActionHighlightColor : self.customizable.positiveActionBackgroundColor 369 | break 370 | case .negative: 371 | self.backgroundColor = self.hightlight ? 372 | self.customizable.negativeActionHighlightColor : self.customizable.negativeActionBackgroundColor 373 | break 374 | } 375 | } 376 | } 377 | } 378 | 379 | fileprivate let topBorder = UIView(frame: CGRect.zero) 380 | 381 | var action: PopupAction? 382 | var handler: ((PopupAlertButton) -> Void)? 383 | var customizable: PopupViewController.Customizable! 384 | 385 | init(action: PopupAction, customizable: PopupViewController.Customizable, touchHandler: ((PopupAlertButton) -> Void)?) { 386 | super.init(frame: CGRect.zero) 387 | 388 | self.customizable = customizable 389 | self.action = action 390 | self.handler = touchHandler 391 | 392 | setTitle(action.title!, for: UIControlState()) 393 | 394 | topBorder.backgroundColor = customizable.actionsSeparatorColor 395 | 396 | switch action.actionType! { 397 | case .positive: 398 | titleLabel?.font = customizable.postiveActionFont 399 | backgroundColor = customizable.positiveActionBackgroundColor 400 | setTitleColor(customizable.positiveActionColor, for: UIControlState()) 401 | break 402 | case .negative: 403 | titleLabel?.font = customizable.negativeActionFont 404 | backgroundColor = customizable.negativeActionBackgroundColor 405 | setTitleColor(customizable.negativeActionColor, for: UIControlState()) 406 | break 407 | } 408 | 409 | addTarget(self, action: #selector(PopupAlertButton.onActionTap), for: .touchUpInside) 410 | addSubview(topBorder) 411 | } 412 | 413 | 414 | required init?(coder aDecoder: NSCoder) { 415 | fatalError("init(coder:) has not been implemented") 416 | } 417 | 418 | @objc func onActionTap() { 419 | if let actionHandler = action!.handler { 420 | actionHandler(action!) 421 | } 422 | if let handler = handler { 423 | handler(self) 424 | } 425 | } 426 | 427 | fileprivate override func updateConstraints() { 428 | constrain(self, topBorder){view, border in 429 | border.left == view.left 430 | border.right == view.right 431 | border.height == 0.5 432 | border.top == view.top 433 | } 434 | 435 | super.updateConstraints() 436 | } 437 | 438 | fileprivate override func touchesBegan(_ touches: Set, with event: UIEvent?) { 439 | super.touchesBegan(touches, with: event) 440 | 441 | hightlight = true 442 | } 443 | 444 | fileprivate override func touchesEnded(_ touches: Set, with event: UIEvent?) { 445 | super.touchesEnded(touches, with: event) 446 | 447 | hightlight = false 448 | } 449 | } 450 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewControllerTests/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 | -------------------------------------------------------------------------------- /PopupViewController/PopupViewControllerTests/PopupViewControllerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PopupViewControllerTests.swift 3 | // PopupViewControllerTests 4 | // 5 | // Created by Thomas Ricouard on 08/06/16. 6 | // Copyright © 2016 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import PopupViewController 11 | 12 | class PopupViewControllerTests: 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 testBase() { 25 | let alert = PopupViewController(title: "Test", message: "Test") 26 | XCTAssertNotNil(alert.title) 27 | XCTAssertNotNil(alert.message) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PopupViewController 2 | 3 | `UIAlertController` drop in replacement with much more customization 4 | 5 | You can literally replace `UIAlertController` by `PopupViewController` and `UIAlertAction` by `PopupAction` and you're done. Does not support Action Sheet for now, just alert mode. 6 | 7 | Simple example. 8 | 9 | ``` Swift 10 | let alert = PopupViewController(title: "Alert title", message: "Alert message, which can be very long and etc....") 11 | alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil)) 12 | present(alert, animated: true, completion: nil) 13 | ``` 14 | 15 | Result: 16 | 17 | ![Dark alert](https://raw.githubusercontent.com/Dimillian/PopupViewController/master/Images/classy.png) 18 | 19 | By default it come with a dark theme, but where it become powerful is that you can customize it. 20 | 21 | Example: 22 | 23 | ``` Swift 24 | var customizable = PopupViewController.Customizable() 25 | customizable.titleColor = UIColor.blue 26 | customizable.positiveActionColor = UIColor.red 27 | customizable.messageColor = UIColor.brown 28 | customizable.messageFont = UIFont.boldSystemFont(ofSize: 22) 29 | customizable.negativeActionColor = UIColor.brown 30 | customizable.positiveActionColor = UIColor.blue 31 | customizable.negativeActionBackgroundColor = UIColor.black 32 | customizable.positiveActionBackgroundColor = UIColor.white 33 | customizable.positiveActionHighlightColor = UIColor.green 34 | customizable.negativeActionHighlightColor = UIColor.red 35 | 36 | let alert = PopupViewController(title: "Alert title", 37 | message: "Alert message, which can be very long message and all that but nobody will ever read it.", 38 | customizable: customizable) 39 | alert.blurStyle = .extraLight 40 | alert.addAction(PopupAction(title: "Ok", type: .positive, handler: nil)) 41 | alert.addAction(PopupAction(title: "Cancel", type: .negative, handler: nil)) 42 | present(alert, animated: true, completion: nil) 43 | ``` 44 | 45 | Result: 46 | 47 | ![Ugly alert](https://raw.githubusercontent.com/Dimillian/PopupViewController/master/Images/ugly.png) 48 | 49 | Yes this is very ugly. But you know... 50 | 51 | You can also set a static `Customizable`, it'll be re used if you pass no customizable in the `PopupViewController` constructor. 52 | 53 | ``` Swift 54 | var customizable = PopupViewController.Customizable() 55 | customizable.titleColor = UIColor.blue 56 | customizable.positiveActionColor = UIColor.red 57 | customizable.messageColor = UIColor.brown 58 | customizable.messageFont = UIFont.boldSystemFont(ofSize: 22) 59 | customizable.negativeActionColor = UIColor.brown 60 | customizable.positiveActionColor = UIColor.blue 61 | customizable.negativeActionBackgroundColor = UIColor.black 62 | customizable.positiveActionBackgroundColor = UIColor.white 63 | customizable.positiveActionHighlightColor = UIColor.green 64 | customizable.negativeActionHighlightColor = UIColor.red 65 | PopupViewController.sharedCustomizable = alertCustomizable 66 | ``` 67 | ## Todo 68 | * [ ] Action Sheet support 69 | * [ ] UITextFields Support 70 | * [ ] Custom view support 71 | * [ ] Shared Customizable configuration 72 | * [ ] Remove cartography dependency 73 | * [ ] Easier custom transition overwrite 74 | * [ ] Better default transition 75 | 76 | ## Installation 77 | 78 | ### Normal 79 | 80 | Add `pod 'PopupViewController'` in your podfile and then run `pod install` 81 | 82 | ### Dev mode 83 | 84 | Clone this repository and and run `pod install` in both the PopupViewController and Example directory. 85 | 86 | ### Note 87 | 88 | It use the amazing [Cartography](https://github.com/robb/Cartography) as a dependency for now because I'm a lazy ass and I don't want to look at the Apple doc for the ugly Autolayout code hint. 89 | --------------------------------------------------------------------------------