├── .gitignore ├── Demo ├── TransparentView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── TransparentView │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Menu-Burger.imageset │ │ │ ├── Contents.json │ │ │ └── Menu-Burger.png │ │ ├── check.imageset │ │ │ ├── Contents.json │ │ │ └── check@2x.png │ │ ├── close-Icon.imageset │ │ │ ├── Contents.json │ │ │ └── close-Icon.png │ │ ├── fauxMenu.imageset │ │ │ ├── Contents.json │ │ │ └── fauxMenu.png │ │ ├── image2.imageset │ │ │ ├── Contents.json │ │ │ └── image2.png │ │ ├── image3.imageset │ │ │ ├── Contents.json │ │ │ └── image3.png │ │ ├── image4.imageset │ │ │ ├── Contents.json │ │ │ └── image4.png │ │ └── placeholder.imageset │ │ │ ├── Contents.json │ │ │ └── placeholder.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Menu.swift │ ├── MenuTableViewCell.swift │ ├── MenuViewController.swift │ └── ViewContainer.swift ├── TransparentViewTests │ ├── Info.plist │ └── TransparentViewTests.swift └── TransparentViewUITests │ ├── Info.plist │ └── TransparentViewUITests.swift ├── LICENSE ├── Overlay └── OverlayView.swift ├── README.md ├── demo-landing.png └── demo-menu.png /.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 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 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/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /Demo/TransparentView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C35EC59A1D14C53700D8702F /* Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35EC5991D14C53700D8702F /* Menu.swift */; }; 11 | C35EC59B1D14C53700D8702F /* Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35EC5991D14C53700D8702F /* Menu.swift */; }; 12 | C3628C5F1D13537D004262B1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C5E1D13537D004262B1 /* AppDelegate.swift */; }; 13 | C3628C611D13537D004262B1 /* ViewContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C601D13537D004262B1 /* ViewContainer.swift */; }; 14 | C3628C641D13537D004262B1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3628C621D13537D004262B1 /* Main.storyboard */; }; 15 | C3628C661D13537D004262B1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3628C651D13537D004262B1 /* Assets.xcassets */; }; 16 | C3628C691D13537D004262B1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3628C671D13537D004262B1 /* LaunchScreen.storyboard */; }; 17 | C3628C741D13537D004262B1 /* TransparentViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C731D13537D004262B1 /* TransparentViewTests.swift */; }; 18 | C3628C7F1D13537D004262B1 /* TransparentViewUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C7E1D13537D004262B1 /* TransparentViewUITests.swift */; }; 19 | C3628C931D1353EA004262B1 /* OverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C921D1353EA004262B1 /* OverlayView.swift */; }; 20 | C3628C941D1353EA004262B1 /* OverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C921D1353EA004262B1 /* OverlayView.swift */; }; 21 | C3628C9C1D136BA2004262B1 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C9A1D136BA2004262B1 /* MenuViewController.swift */; }; 22 | C3628C9D1D136BA2004262B1 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628C9A1D136BA2004262B1 /* MenuViewController.swift */; }; 23 | C3628CA11D13906C004262B1 /* MenuTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628CA01D13906C004262B1 /* MenuTableViewCell.swift */; }; 24 | C3628CA21D13906C004262B1 /* MenuTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3628CA01D13906C004262B1 /* MenuTableViewCell.swift */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | C3628C701D13537D004262B1 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = C3628C531D13537D004262B1 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = C3628C5A1D13537D004262B1; 33 | remoteInfo = TransparentView; 34 | }; 35 | C3628C7B1D13537D004262B1 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = C3628C531D13537D004262B1 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = C3628C5A1D13537D004262B1; 40 | remoteInfo = TransparentView; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | C35EC5991D14C53700D8702F /* Menu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Menu.swift; sourceTree = ""; }; 46 | C3628C5B1D13537D004262B1 /* TransparentView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TransparentView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | C3628C5E1D13537D004262B1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | C3628C601D13537D004262B1 /* ViewContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewContainer.swift; sourceTree = ""; }; 49 | C3628C631D13537D004262B1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | C3628C651D13537D004262B1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | C3628C681D13537D004262B1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | C3628C6A1D13537D004262B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | C3628C6F1D13537D004262B1 /* TransparentViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TransparentViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | C3628C731D13537D004262B1 /* TransparentViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransparentViewTests.swift; sourceTree = ""; }; 55 | C3628C751D13537D004262B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | C3628C7A1D13537D004262B1 /* TransparentViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TransparentViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | C3628C7E1D13537D004262B1 /* TransparentViewUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransparentViewUITests.swift; sourceTree = ""; }; 58 | C3628C801D13537D004262B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | C3628C921D1353EA004262B1 /* OverlayView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OverlayView.swift; path = ../../Overlay/OverlayView.swift; sourceTree = ""; }; 60 | C3628C9A1D136BA2004262B1 /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; }; 61 | C3628CA01D13906C004262B1 /* MenuTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuTableViewCell.swift; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | C3628C581D13537D004262B1 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | C3628C6C1D13537D004262B1 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | C3628C771D13537D004262B1 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | C3628C521D13537D004262B1 = { 90 | isa = PBXGroup; 91 | children = ( 92 | C3628C5D1D13537D004262B1 /* TransparentView */, 93 | C3628C721D13537D004262B1 /* TransparentViewTests */, 94 | C3628C7D1D13537D004262B1 /* TransparentViewUITests */, 95 | C3628C5C1D13537D004262B1 /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | C3628C5C1D13537D004262B1 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | C3628C5B1D13537D004262B1 /* TransparentView.app */, 103 | C3628C6F1D13537D004262B1 /* TransparentViewTests.xctest */, 104 | C3628C7A1D13537D004262B1 /* TransparentViewUITests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | C3628C5D1D13537D004262B1 /* TransparentView */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | C3628C5E1D13537D004262B1 /* AppDelegate.swift */, 113 | C3628C951D1353F2004262B1 /* Overlay */, 114 | C3628C601D13537D004262B1 /* ViewContainer.swift */, 115 | C3628C961D136B3C004262B1 /* Menu */, 116 | C3628C621D13537D004262B1 /* Main.storyboard */, 117 | C3628C651D13537D004262B1 /* Assets.xcassets */, 118 | C3628C671D13537D004262B1 /* LaunchScreen.storyboard */, 119 | C3628C6A1D13537D004262B1 /* Info.plist */, 120 | ); 121 | path = TransparentView; 122 | sourceTree = ""; 123 | }; 124 | C3628C721D13537D004262B1 /* TransparentViewTests */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | C3628C731D13537D004262B1 /* TransparentViewTests.swift */, 128 | C3628C751D13537D004262B1 /* Info.plist */, 129 | ); 130 | path = TransparentViewTests; 131 | sourceTree = ""; 132 | }; 133 | C3628C7D1D13537D004262B1 /* TransparentViewUITests */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | C3628C7E1D13537D004262B1 /* TransparentViewUITests.swift */, 137 | C3628C801D13537D004262B1 /* Info.plist */, 138 | ); 139 | path = TransparentViewUITests; 140 | sourceTree = ""; 141 | }; 142 | C3628C951D1353F2004262B1 /* Overlay */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | C3628C921D1353EA004262B1 /* OverlayView.swift */, 146 | ); 147 | name = Overlay; 148 | sourceTree = ""; 149 | }; 150 | C3628C961D136B3C004262B1 /* Menu */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | C3628C9A1D136BA2004262B1 /* MenuViewController.swift */, 154 | C3628CA01D13906C004262B1 /* MenuTableViewCell.swift */, 155 | C35EC5991D14C53700D8702F /* Menu.swift */, 156 | ); 157 | name = Menu; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | C3628C5A1D13537D004262B1 /* TransparentView */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = C3628C831D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentView" */; 166 | buildPhases = ( 167 | C3628C571D13537D004262B1 /* Sources */, 168 | C3628C581D13537D004262B1 /* Frameworks */, 169 | C3628C591D13537D004262B1 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = TransparentView; 176 | productName = TransparentView; 177 | productReference = C3628C5B1D13537D004262B1 /* TransparentView.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | C3628C6E1D13537D004262B1 /* TransparentViewTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = C3628C861D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentViewTests" */; 183 | buildPhases = ( 184 | C3628C6B1D13537D004262B1 /* Sources */, 185 | C3628C6C1D13537D004262B1 /* Frameworks */, 186 | C3628C6D1D13537D004262B1 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | C3628C711D13537D004262B1 /* PBXTargetDependency */, 192 | ); 193 | name = TransparentViewTests; 194 | productName = TransparentViewTests; 195 | productReference = C3628C6F1D13537D004262B1 /* TransparentViewTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | C3628C791D13537D004262B1 /* TransparentViewUITests */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = C3628C891D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentViewUITests" */; 201 | buildPhases = ( 202 | C3628C761D13537D004262B1 /* Sources */, 203 | C3628C771D13537D004262B1 /* Frameworks */, 204 | C3628C781D13537D004262B1 /* Resources */, 205 | ); 206 | buildRules = ( 207 | ); 208 | dependencies = ( 209 | C3628C7C1D13537D004262B1 /* PBXTargetDependency */, 210 | ); 211 | name = TransparentViewUITests; 212 | productName = TransparentViewUITests; 213 | productReference = C3628C7A1D13537D004262B1 /* TransparentViewUITests.xctest */; 214 | productType = "com.apple.product-type.bundle.ui-testing"; 215 | }; 216 | /* End PBXNativeTarget section */ 217 | 218 | /* Begin PBXProject section */ 219 | C3628C531D13537D004262B1 /* Project object */ = { 220 | isa = PBXProject; 221 | attributes = { 222 | LastSwiftUpdateCheck = 0730; 223 | LastUpgradeCheck = 0730; 224 | ORGANIZATIONNAME = "Edwin Bosire"; 225 | TargetAttributes = { 226 | C3628C5A1D13537D004262B1 = { 227 | CreatedOnToolsVersion = 7.3.1; 228 | }; 229 | C3628C6E1D13537D004262B1 = { 230 | CreatedOnToolsVersion = 7.3.1; 231 | TestTargetID = C3628C5A1D13537D004262B1; 232 | }; 233 | C3628C791D13537D004262B1 = { 234 | CreatedOnToolsVersion = 7.3.1; 235 | TestTargetID = C3628C5A1D13537D004262B1; 236 | }; 237 | }; 238 | }; 239 | buildConfigurationList = C3628C561D13537D004262B1 /* Build configuration list for PBXProject "TransparentView" */; 240 | compatibilityVersion = "Xcode 3.2"; 241 | developmentRegion = English; 242 | hasScannedForEncodings = 0; 243 | knownRegions = ( 244 | en, 245 | Base, 246 | ); 247 | mainGroup = C3628C521D13537D004262B1; 248 | productRefGroup = C3628C5C1D13537D004262B1 /* Products */; 249 | projectDirPath = ""; 250 | projectRoot = ""; 251 | targets = ( 252 | C3628C5A1D13537D004262B1 /* TransparentView */, 253 | C3628C6E1D13537D004262B1 /* TransparentViewTests */, 254 | C3628C791D13537D004262B1 /* TransparentViewUITests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | C3628C591D13537D004262B1 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | C3628C691D13537D004262B1 /* LaunchScreen.storyboard in Resources */, 265 | C3628C661D13537D004262B1 /* Assets.xcassets in Resources */, 266 | C3628C641D13537D004262B1 /* Main.storyboard in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | C3628C6D1D13537D004262B1 /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | C3628C781D13537D004262B1 /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXResourcesBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | C3628C571D13537D004262B1 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | C35EC59A1D14C53700D8702F /* Menu.swift in Sources */, 292 | C3628C931D1353EA004262B1 /* OverlayView.swift in Sources */, 293 | C3628C9C1D136BA2004262B1 /* MenuViewController.swift in Sources */, 294 | C3628C611D13537D004262B1 /* ViewContainer.swift in Sources */, 295 | C3628C5F1D13537D004262B1 /* AppDelegate.swift in Sources */, 296 | C3628CA11D13906C004262B1 /* MenuTableViewCell.swift in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | C3628C6B1D13537D004262B1 /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | C3628C941D1353EA004262B1 /* OverlayView.swift in Sources */, 305 | C3628C741D13537D004262B1 /* TransparentViewTests.swift in Sources */, 306 | C3628CA21D13906C004262B1 /* MenuTableViewCell.swift in Sources */, 307 | C3628C9D1D136BA2004262B1 /* MenuViewController.swift in Sources */, 308 | C35EC59B1D14C53700D8702F /* Menu.swift in Sources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | C3628C761D13537D004262B1 /* Sources */ = { 313 | isa = PBXSourcesBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | C3628C7F1D13537D004262B1 /* TransparentViewUITests.swift in Sources */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | /* End PBXSourcesBuildPhase section */ 321 | 322 | /* Begin PBXTargetDependency section */ 323 | C3628C711D13537D004262B1 /* PBXTargetDependency */ = { 324 | isa = PBXTargetDependency; 325 | target = C3628C5A1D13537D004262B1 /* TransparentView */; 326 | targetProxy = C3628C701D13537D004262B1 /* PBXContainerItemProxy */; 327 | }; 328 | C3628C7C1D13537D004262B1 /* PBXTargetDependency */ = { 329 | isa = PBXTargetDependency; 330 | target = C3628C5A1D13537D004262B1 /* TransparentView */; 331 | targetProxy = C3628C7B1D13537D004262B1 /* PBXContainerItemProxy */; 332 | }; 333 | /* End PBXTargetDependency section */ 334 | 335 | /* Begin PBXVariantGroup section */ 336 | C3628C621D13537D004262B1 /* Main.storyboard */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | C3628C631D13537D004262B1 /* Base */, 340 | ); 341 | name = Main.storyboard; 342 | sourceTree = ""; 343 | }; 344 | C3628C671D13537D004262B1 /* LaunchScreen.storyboard */ = { 345 | isa = PBXVariantGroup; 346 | children = ( 347 | C3628C681D13537D004262B1 /* Base */, 348 | ); 349 | name = LaunchScreen.storyboard; 350 | sourceTree = ""; 351 | }; 352 | /* End PBXVariantGroup section */ 353 | 354 | /* Begin XCBuildConfiguration section */ 355 | C3628C811D13537D004262B1 /* Debug */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ALWAYS_SEARCH_USER_PATHS = NO; 359 | CLANG_ANALYZER_NONNULL = YES; 360 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | CLANG_ENABLE_MODULES = YES; 363 | CLANG_ENABLE_OBJC_ARC = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_CONSTANT_CONVERSION = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INT_CONVERSION = YES; 370 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 371 | CLANG_WARN_UNREACHABLE_CODE = YES; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = NO; 375 | DEBUG_INFORMATION_FORMAT = dwarf; 376 | ENABLE_STRICT_OBJC_MSGSEND = YES; 377 | ENABLE_TESTABILITY = YES; 378 | GCC_C_LANGUAGE_STANDARD = gnu99; 379 | GCC_DYNAMIC_NO_PIC = NO; 380 | GCC_NO_COMMON_BLOCKS = YES; 381 | GCC_OPTIMIZATION_LEVEL = 0; 382 | GCC_PREPROCESSOR_DEFINITIONS = ( 383 | "DEBUG=1", 384 | "$(inherited)", 385 | ); 386 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 387 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 388 | GCC_WARN_UNDECLARED_SELECTOR = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 390 | GCC_WARN_UNUSED_FUNCTION = YES; 391 | GCC_WARN_UNUSED_VARIABLE = YES; 392 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 393 | MTL_ENABLE_DEBUG_INFO = YES; 394 | ONLY_ACTIVE_ARCH = YES; 395 | SDKROOT = iphoneos; 396 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | }; 399 | name = Debug; 400 | }; 401 | C3628C821D13537D004262B1 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CLANG_ANALYZER_NONNULL = YES; 406 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 407 | CLANG_CXX_LIBRARY = "libc++"; 408 | CLANG_ENABLE_MODULES = YES; 409 | CLANG_ENABLE_OBJC_ARC = YES; 410 | CLANG_WARN_BOOL_CONVERSION = YES; 411 | CLANG_WARN_CONSTANT_CONVERSION = YES; 412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INT_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_UNREACHABLE_CODE = YES; 418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 420 | COPY_PHASE_STRIP = NO; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | VALIDATE_PRODUCT = YES; 437 | }; 438 | name = Release; 439 | }; 440 | C3628C841D13537D004262B1 /* Debug */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | INFOPLIST_FILE = TransparentView/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentView; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | }; 449 | name = Debug; 450 | }; 451 | C3628C851D13537D004262B1 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | INFOPLIST_FILE = TransparentView/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentView; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | }; 460 | name = Release; 461 | }; 462 | C3628C871D13537D004262B1 /* Debug */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | INFOPLIST_FILE = TransparentViewTests/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentViewTests; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TransparentView.app/TransparentView"; 471 | }; 472 | name = Debug; 473 | }; 474 | C3628C881D13537D004262B1 /* Release */ = { 475 | isa = XCBuildConfiguration; 476 | buildSettings = { 477 | BUNDLE_LOADER = "$(TEST_HOST)"; 478 | INFOPLIST_FILE = TransparentViewTests/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 480 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentViewTests; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TransparentView.app/TransparentView"; 483 | }; 484 | name = Release; 485 | }; 486 | C3628C8A1D13537D004262B1 /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | INFOPLIST_FILE = TransparentViewUITests/Info.plist; 490 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 491 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentViewUITests; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | TEST_TARGET_NAME = TransparentView; 494 | }; 495 | name = Debug; 496 | }; 497 | C3628C8B1D13537D004262B1 /* Release */ = { 498 | isa = XCBuildConfiguration; 499 | buildSettings = { 500 | INFOPLIST_FILE = TransparentViewUITests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = uk.co.edwinb.TransparentViewUITests; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | TEST_TARGET_NAME = TransparentView; 505 | }; 506 | name = Release; 507 | }; 508 | /* End XCBuildConfiguration section */ 509 | 510 | /* Begin XCConfigurationList section */ 511 | C3628C561D13537D004262B1 /* Build configuration list for PBXProject "TransparentView" */ = { 512 | isa = XCConfigurationList; 513 | buildConfigurations = ( 514 | C3628C811D13537D004262B1 /* Debug */, 515 | C3628C821D13537D004262B1 /* Release */, 516 | ); 517 | defaultConfigurationIsVisible = 0; 518 | defaultConfigurationName = Release; 519 | }; 520 | C3628C831D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentView" */ = { 521 | isa = XCConfigurationList; 522 | buildConfigurations = ( 523 | C3628C841D13537D004262B1 /* Debug */, 524 | C3628C851D13537D004262B1 /* Release */, 525 | ); 526 | defaultConfigurationIsVisible = 0; 527 | defaultConfigurationName = Release; 528 | }; 529 | C3628C861D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentViewTests" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | C3628C871D13537D004262B1 /* Debug */, 533 | C3628C881D13537D004262B1 /* Release */, 534 | ); 535 | defaultConfigurationIsVisible = 0; 536 | defaultConfigurationName = Release; 537 | }; 538 | C3628C891D13537D004262B1 /* Build configuration list for PBXNativeTarget "TransparentViewUITests" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | C3628C8A1D13537D004262B1 /* Debug */, 542 | C3628C8B1D13537D004262B1 /* Release */, 543 | ); 544 | defaultConfigurationIsVisible = 0; 545 | defaultConfigurationName = Release; 546 | }; 547 | /* End XCConfigurationList section */ 548 | }; 549 | rootObject = C3628C531D13537D004262B1 /* Project object */; 550 | } 551 | -------------------------------------------------------------------------------- /Demo/TransparentView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/TransparentView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 16/06/2016. 6 | // Copyright © 2016 Edwin Bosire. 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: [NSObject: AnyObject]?) -> 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 | -------------------------------------------------------------------------------- /Demo/TransparentView/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 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/Menu-Burger.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Menu-Burger.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/Menu-Burger.imageset/Menu-Burger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/Menu-Burger.imageset/Menu-Burger.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/check.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "check@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/check.imageset/check@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/check.imageset/check@2x.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/close-Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "close-Icon.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/close-Icon.imageset/close-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/close-Icon.imageset/close-Icon.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/fauxMenu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "fauxMenu.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/fauxMenu.imageset/fauxMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/fauxMenu.imageset/fauxMenu.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "image2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image2.imageset/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/image2.imageset/image2.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "image3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image3.imageset/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/image3.imageset/image3.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "image4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/image4.imageset/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/image4.imageset/image4.png -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "placeholder.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/TransparentView/Assets.xcassets/placeholder.imageset/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/Demo/TransparentView/Assets.xcassets/placeholder.imageset/placeholder.png -------------------------------------------------------------------------------- /Demo/TransparentView/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 | -------------------------------------------------------------------------------- /Demo/TransparentView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | -------------------------------------------------------------------------------- /Demo/TransparentView/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 | UIStatusBarStyle 34 | UIStatusBarStyleLightContent 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Demo/TransparentView/Menu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Menu.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 18/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | struct Menu { 13 | var title: String = " " 14 | 15 | init(title:String = " ") { 16 | self.title = title 17 | } 18 | } -------------------------------------------------------------------------------- /Demo/TransparentView/MenuTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MenuTableViewCell.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 17/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MenuTableViewCell: UITableViewCell { 12 | var menu: Menu { 13 | get { 14 | return self.menu 15 | } 16 | set { 17 | textLabel?.text = newValue.title 18 | } 19 | } 20 | @IBOutlet weak var separatorView: UIView! 21 | 22 | override func awakeFromNib() { 23 | super.awakeFromNib() 24 | 25 | textLabel?.textColor = UIColor.darkGrayColor() 26 | textLabel?.font = UIFont(name: "HelveticaNeue-Thin", size: 40) 27 | textLabel?.textAlignment = .Center 28 | backgroundColor = UIColor.clearColor() 29 | selectionStyle = .None 30 | 31 | } 32 | 33 | override func setSelected(selected: Bool, animated: Bool) { 34 | super.setSelected(selected, animated: animated) 35 | 36 | if selected { 37 | let titleWidth = textLabel?.intrinsicContentSize().width 38 | let separatorWidth:CGFloat = 240.0 39 | var ratio = (titleWidth! / separatorWidth) 40 | ratio += 0.2 * ratio // Add 20% 41 | 42 | UIView.animateWithDuration(0.3, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.8, options: .CurveEaseInOut, animations: { [unowned self] in 43 | self.separatorView.alpha = 1 44 | self.separatorView.transform = CGAffineTransformMakeScale(ratio, 1.0) 45 | 46 | }, completion: { finished in }) 47 | }else { 48 | UIView.animateWithDuration(0.3, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.8, options: .CurveEaseInOut, animations: { [unowned self] in 49 | self.separatorView.alpha = 0 50 | self.separatorView.transform = CGAffineTransformMakeScale(0.2, 1.0) 51 | } , completion: { finished in }) 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Demo/TransparentView/MenuViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MenuViewController.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 17/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol MenuViewDelegate { 12 | func didSelect(menu: Menu, row: NSIndexPath, inTableView: UITableView) 13 | } 14 | 15 | class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { 16 | 17 | @IBOutlet weak var tableView: UITableView! 18 | var delegate: MenuViewDelegate? 19 | var menu: [Menu] { 20 | get { 21 | return [Menu(), Menu(title:"Issues"), Menu(title:"Daily Briefing"), Menu(title:"Bookmarks"), Menu(title:"Sign In"), Menu(title:"Info")] 22 | } 23 | } 24 | 25 | let cellIdentifier = "cellIdentifier" 26 | lazy var checkMark = UIImageView(image: UIImage(named: "check")) 27 | var selected: Int = 1 28 | 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | 32 | setupTableView() 33 | } 34 | 35 | func setupTableView () { 36 | tableView.reloadData() 37 | if tableView.indexPathsForVisibleRows?.count > 0 { 38 | tableView.selectRowAtIndexPath(tableView!.indexPathsForVisibleRows![selected], animated: true, scrollPosition: .None) 39 | } 40 | } 41 | 42 | func numberOfSectionsInTableView(tableView: UITableView) -> Int { 43 | return 1 44 | } 45 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 46 | return menu.count 47 | } 48 | 49 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 50 | 51 | let cell: MenuTableViewCell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as! MenuTableViewCell 52 | cell.menu = menu[indexPath.row] 53 | if indexPath.row == 0 { 54 | // we could create a whole new 'spacer' cell. but I am lazy, so I wont. 55 | cell.userInteractionEnabled = false 56 | } 57 | return cell 58 | } 59 | 60 | func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 61 | return 45 62 | } 63 | 64 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 65 | selected = indexPath.row 66 | 67 | if let delegate = delegate { 68 | let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(0.4 * Double(NSEC_PER_SEC))) 69 | dispatch_after(delayTime, dispatch_get_main_queue()) { [unowned self] in 70 | delegate.didSelect(self.menu[indexPath.row], row:indexPath, inTableView: tableView) 71 | } 72 | 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Demo/TransparentView/ViewContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 16/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewContainer: UIViewController, MenuViewDelegate { 12 | 13 | lazy var menuViewController: MenuViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("menu") as! MenuViewController 14 | @IBOutlet var viewContainer: UIView! 15 | var overlay: OverlayView? 16 | 17 | var signInViewController: UIViewController { 18 | 19 | get { 20 | let viewController = UIViewController(nibName: nil, bundle: nil) 21 | viewController.view.backgroundColor = UIColor.init(red: 155/255, green: 89/255, blue: 182/255, alpha: 1.0) 22 | return viewController 23 | } 24 | } 25 | 26 | var infoViewController: UIViewController { 27 | 28 | get { 29 | let viewController = UIViewController(nibName: nil, bundle: nil) 30 | viewController.view.backgroundColor = UIColor.init(red: 155/255, green: 89/255, blue: 182/255, alpha: 1.0) 31 | return viewController 32 | } 33 | } 34 | 35 | override func viewDidLoad() { 36 | super.viewDidLoad() 37 | UIApplication.sharedApplication().statusBarStyle = .LightContent 38 | 39 | } 40 | 41 | @IBAction func presentOverlay(sender: AnyObject) { 42 | 43 | menuViewController.delegate = self 44 | 45 | if overlay == nil { 46 | overlay = OverlayView() 47 | } 48 | 49 | overlay?.addSubview(menuViewController.view) 50 | overlay?.open() 51 | } 52 | 53 | /** 54 | Goes without saying, using literal types in switch statements is a bad idea, bad practices ensue in the example below, 55 | it's all to prove that our menu can be used in a versatile manner. 56 | - Maybe lazy load the ViewControllers as well? 57 | - Remove views from container 58 | */ 59 | 60 | func didSelect(menu: Menu, row: NSIndexPath, inTableView: UITableView) { 61 | 62 | self.title = menu.title; 63 | switch menu.title { 64 | 65 | case "Issues" : 66 | let viewController = storyboard?.instantiateViewControllerWithIdentifier("viewController1") 67 | if let vc = viewController { 68 | displayContentController(vc) 69 | } 70 | break 71 | 72 | case "Daily Briefing": 73 | 74 | let viewController = storyboard?.instantiateViewControllerWithIdentifier("viewController2") 75 | if let vc = viewController { 76 | displayContentController(vc) 77 | // removeContentController(currentChildView!) 78 | } 79 | break 80 | 81 | case "Bookmarks": 82 | 83 | let viewController = storyboard?.instantiateViewControllerWithIdentifier("viewController3") 84 | if let vc = viewController { 85 | displayContentController(vc) 86 | } 87 | break 88 | 89 | case "Sign In": 90 | displayContentController(signInViewController) 91 | break 92 | 93 | case "Info": 94 | displayContentController(infoViewController) 95 | break 96 | default: break 97 | 98 | } 99 | overlay?.dismissView() 100 | } 101 | 102 | func displayContentController(content: UIViewController) { 103 | 104 | self.addChildViewController(content) 105 | content.view.frame = frameForContentController() 106 | self.view.addSubview(content.view) 107 | //TODO: Autolayout constraints go here 108 | content.didMoveToParentViewController(self) 109 | } 110 | 111 | func removeContentController(content: UIViewController) { 112 | 113 | content.willMoveToParentViewController(nil) 114 | //TODO: Remove any constraints that we configured withthe child's root view 115 | content.view.removeFromSuperview() 116 | content.removeFromParentViewController() 117 | } 118 | 119 | func frameForContentController() -> CGRect { 120 | return self.view.bounds 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /Demo/TransparentViewTests/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 | -------------------------------------------------------------------------------- /Demo/TransparentViewTests/TransparentViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransparentViewTests.swift 3 | // TransparentViewTests 4 | // 5 | // Created by edwinbosire on 16/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TransparentView 11 | 12 | class TransparentViewTests: 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 | // Use XCTAssert and related functions to verify your tests produce the correct results. 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 | -------------------------------------------------------------------------------- /Demo/TransparentViewUITests/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 | -------------------------------------------------------------------------------- /Demo/TransparentViewUITests/TransparentViewUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransparentViewUITests.swift 3 | // TransparentViewUITests 4 | // 5 | // Created by edwinbosire on 16/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class TransparentViewUITests: 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 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Edwin B 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 | -------------------------------------------------------------------------------- /Overlay/OverlayView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OverlayViewController.swift 3 | // TransparentView 4 | // 5 | // Created by edwinbosire on 16/06/2016. 6 | // Copyright © 2016 Edwin Bosire. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum Style: Int { 12 | case Light, Dark 13 | } 14 | 15 | protocol OverlayViewDelegate { 16 | func didDismissView(view: OverlayView) 17 | } 18 | 19 | class OverlayView: UIView { 20 | 21 | var delegate: OverlayViewDelegate? 22 | var style: Style = .Light 23 | let statusBarStyle: UIStatusBarStyle = UIApplication.sharedApplication().statusBarStyle 24 | var closeButton: UIButton! 25 | let backgroundcolor = UIColor.clearColor() 26 | 27 | var presentationAnimation: CAAnimationGroup { 28 | get{ 29 | let fadeAnimation = CABasicAnimation(keyPath: "opacity") 30 | fadeAnimation.fromValue = 0.0 31 | fadeAnimation.toValue = 1.0 32 | fadeAnimation.duration = 0.3 33 | fadeAnimation.fillMode = kCAFillModeForwards 34 | 35 | let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") 36 | scaleAnimation.toValue = 1.0 37 | scaleAnimation.fromValue = 0.8 38 | scaleAnimation.duration = 0.3 39 | scaleAnimation.fillMode = kCAFillModeForwards 40 | 41 | let groupAnimation = CAAnimationGroup() 42 | groupAnimation.duration = 0.3 43 | groupAnimation.animations = [fadeAnimation, scaleAnimation] 44 | groupAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 45 | 46 | return groupAnimation 47 | } 48 | } 49 | 50 | required init() { 51 | super.init(frame: CGRectZero) 52 | let frame = UIScreen.mainScreen().bounds 53 | self.frame = frame 54 | self.opaque = false 55 | self.backgroundColor = backgroundcolor 56 | } 57 | 58 | required init?(coder aDecoder: NSCoder) { 59 | super.init(coder: aDecoder) 60 | } 61 | 62 | func open() { 63 | layer.removeAllAnimations() 64 | var window = UIApplication.sharedApplication().keyWindow 65 | 66 | if window == nil { 67 | window = UIApplication.sharedApplication().windows.first 68 | } 69 | 70 | if closeButton == nil { 71 | closeButton = UIButton(type: .System) 72 | closeButton.frame = CGRectMake(CGRectGetMaxX(self.frame) - 60, 30, 33, 33) 73 | let image = UIImage(named: "close-Icon")?.imageWithRenderingMode(.AlwaysTemplate) 74 | closeButton.setImage(image, forState: .Normal) 75 | closeButton.addTarget(self, action: #selector(dismissView), forControlEvents: .TouchDown) 76 | } 77 | 78 | self.addSubview(closeButton) 79 | 80 | /** 81 | HINT: 82 | To get the status bar to change color, dont forget to 83 | set UIViewControllerBasedStatusBarAppearance = No in info.plist 84 | */ 85 | switch style { 86 | case .Dark: 87 | closeButton.tintColor = UIColor.whiteColor() 88 | UIApplication.sharedApplication().statusBarStyle = .LightContent 89 | break 90 | default: 91 | closeButton.tintColor = UIColor.darkGrayColor() 92 | UIApplication.sharedApplication().statusBarStyle = .Default 93 | } 94 | 95 | layer.addAnimation(presentationAnimation, forKey: "present") 96 | window?.subviews.first?.addSubview(self) 97 | 98 | } 99 | 100 | func dismissView() { 101 | 102 | UIView.animateWithDuration(0.3, animations: { 103 | self.transform = CGAffineTransformMakeScale(0.8, 0.8) 104 | self.alpha = 0.0 105 | }) { [unowned self] (comlete) in 106 | self.removeFromSuperview() 107 | self.alpha = 1 108 | self.transform = CGAffineTransformIdentity 109 | UIApplication.sharedApplication().statusBarStyle = self.statusBarStyle 110 | } 111 | 112 | delegate?.didDismissView(self) 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiflyOverlay 2 | 3 | I've been working on a side project that requires a full screen menu to be presented. This is my progress so far. 4 | 5 | Enjoy :) 6 | 7 | ![Landing image of the app][demo2] 8 | ![Demo image of the implementation][demo] 9 | 10 | *I'll update this with a gif soon to show off some sweet animations.* 11 | 12 | ## Implimentation 13 | 14 | You will need to create your own menu view, take a look at the `MenuViewController` in the demo. It's a table based menu view. 15 | 16 | Create an instance of `OverlayView` and add your menu as a subview. 17 | 18 | ```swift 19 | 20 | overlay = OverlayView() 21 | overlay?.addSubview(menuViewController.view) 22 | ``` 23 | When ready, present the view by calling `open()` on the overlay instance 24 | 25 | ```swift 26 | overlay?.open() 27 | ``` 28 | 29 | The overlay view has an inbuilt close button and it could be dismissed using this alone, in the event your implementation needs another way to dismiss the overlay, call `dismissView()` on the overlay instance 30 | 31 | ```swift 32 | overlay?.dismissView() 33 | ``` 34 | 35 | ### Animation 36 | 37 | The animations implemented are quite simple, we animate both the `opacity` and `transform.scale` properties using `CAAnimation` 38 | 39 | ```swift 40 | let fadeAnimation = CABasicAnimation(keyPath: "opacity") 41 | fadeAnimation.fromValue = 0.0 42 | fadeAnimation.toValue = 1.0 43 | fadeAnimation.duration = 0.3 44 | fadeAnimation.fillMode = kCAFillModeForwards 45 | 46 | let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") 47 | scaleAnimation.toValue = 1.0 48 | scaleAnimation.fromValue = 0.8 49 | scaleAnimation.duration = 0.3 50 | scaleAnimation.fillMode = kCAFillModeForwards 51 | 52 | let groupAnimation = CAAnimationGroup() 53 | groupAnimation.duration = 0.3 54 | groupAnimation.animations = [fadeAnimation, scaleAnimation] 55 | groupAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 56 | 57 | ``` 58 | 59 | The other animations on are menu based, and can be implemented in your custom menuViewController. Take a look at the demo project for more. 60 | 61 | ## Contribution 62 | 63 | Solo project at the moment, but if you want to contribute and make it better, please make a pull request. 64 | 65 | ## Thanks 66 | 67 | Thanks for taking an interest in my work, you can find me on twitter [@edwinbosire](www.twitter.com/edwinbosire) 68 | 69 | ## Licence 70 | 71 | The MIT License (MIT) 72 | 73 | Copyright (c) 2016 Edwin B 74 | 75 | Permission is hereby granted, free of charge, to any person obtaining a copy 76 | of this software and associated documentation files (the "Software"), to deal 77 | in the Software without restriction, including without limitation the rights 78 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 79 | copies of the Software, and to permit persons to whom the Software is 80 | furnished to do so, subject to the following conditions: 81 | 82 | The above copyright notice and this permission notice shall be included in all 83 | copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 86 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 87 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 88 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 89 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 90 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 91 | SOFTWARE. 92 | 93 | 94 | 95 | [demo]: https://github.com/edwinbosire/SwiflyOverlay/blob/master/demo-menu.png "Demo image" 96 | [demo2]: https://github.com/edwinbosire/SwiflyOverlay/blob/master/demo-landing.png "Landin image" 97 | 98 | -------------------------------------------------------------------------------- /demo-landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/demo-landing.png -------------------------------------------------------------------------------- /demo-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwinbosire/SwiflyOverlay/15e9a2946e36cf52a7ef05a0c7cb21f2dc9c00a1/demo-menu.png --------------------------------------------------------------------------------