├── .gitignore ├── DDStatusBarFlip.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── druidream.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── druidream.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── DDStatusBarFlip.xcscheme │ └── xcschememanagement.plist ├── DDStatusBarFlip ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── 1.imageset │ │ ├── 0170e556eb4e186ac7257d20c1fc71.png │ │ └── Contents.json │ ├── 2.imageset │ │ ├── 01b82656eb4e0f32f875a94469b6ff.png │ │ └── Contents.json │ ├── 3.imageset │ │ ├── 011bcf56eb4e1b32f875a9440642d1.png │ │ └── Contents.json │ ├── 4.imageset │ │ ├── 015b8056eb4e0b32f875a9444a4c20.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DDStatusBarNotification.h ├── DDStatusBarNotification.m ├── DDStatusBarNotificationViewController.h ├── DDStatusBarNotificationViewController.m ├── DDStatusBarView.h ├── DDStatusBarView.m ├── DDTransform3DPerspective.h ├── DDTransform3DPerspective.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | Pods/ 27 | *.xcworkspace 28 | -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6A2EBAA01CEEBB8F006FB871 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBA9F1CEEBB8F006FB871 /* main.m */; }; 11 | 6A2EBAA31CEEBB8F006FB871 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBAA21CEEBB8F006FB871 /* AppDelegate.m */; }; 12 | 6A2EBAA61CEEBB8F006FB871 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBAA51CEEBB8F006FB871 /* ViewController.m */; }; 13 | 6A2EBAA91CEEBB8F006FB871 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A2EBAA71CEEBB8F006FB871 /* Main.storyboard */; }; 14 | 6A2EBAAB1CEEBB90006FB871 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2EBAAA1CEEBB90006FB871 /* Assets.xcassets */; }; 15 | 6A2EBAAE1CEEBB90006FB871 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6A2EBAAC1CEEBB90006FB871 /* LaunchScreen.storyboard */; }; 16 | 6A2EBAB71CF06158006FB871 /* DDStatusBarNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBAB61CF06158006FB871 /* DDStatusBarNotification.m */; }; 17 | 6A2EBABA1CF0BF19006FB871 /* DDStatusBarNotificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBAB91CF0BF19006FB871 /* DDStatusBarNotificationViewController.m */; }; 18 | 6A2EBABD1CF14BE2006FB871 /* DDStatusBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBABC1CF14BE2006FB871 /* DDStatusBarView.m */; }; 19 | 6A2EBAC91CF3102D006FB871 /* DDTransform3DPerspective.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A2EBAC81CF3102D006FB871 /* DDTransform3DPerspective.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 6A2EBA9B1CEEBB8E006FB871 /* DDStatusBarFlip.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DDStatusBarFlip.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 6A2EBA9F1CEEBB8F006FB871 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | 6A2EBAA11CEEBB8F006FB871 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 6A2EBAA21CEEBB8F006FB871 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 6A2EBAA41CEEBB8F006FB871 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | 6A2EBAA51CEEBB8F006FB871 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | 6A2EBAA81CEEBB8F006FB871 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 6A2EBAAA1CEEBB90006FB871 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | 6A2EBAAD1CEEBB90006FB871 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 6A2EBAAF1CEEBB90006FB871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 6A2EBAB51CF06158006FB871 /* DDStatusBarNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDStatusBarNotification.h; sourceTree = ""; }; 34 | 6A2EBAB61CF06158006FB871 /* DDStatusBarNotification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDStatusBarNotification.m; sourceTree = ""; }; 35 | 6A2EBAB81CF0BF19006FB871 /* DDStatusBarNotificationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDStatusBarNotificationViewController.h; sourceTree = ""; }; 36 | 6A2EBAB91CF0BF19006FB871 /* DDStatusBarNotificationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDStatusBarNotificationViewController.m; sourceTree = ""; }; 37 | 6A2EBABB1CF14BE2006FB871 /* DDStatusBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDStatusBarView.h; sourceTree = ""; }; 38 | 6A2EBABC1CF14BE2006FB871 /* DDStatusBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDStatusBarView.m; sourceTree = ""; }; 39 | 6A2EBAC71CF3102D006FB871 /* DDTransform3DPerspective.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDTransform3DPerspective.h; sourceTree = ""; }; 40 | 6A2EBAC81CF3102D006FB871 /* DDTransform3DPerspective.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDTransform3DPerspective.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 6A2EBA981CEEBB8E006FB871 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 6A2EBA921CEEBB8E006FB871 = { 55 | isa = PBXGroup; 56 | children = ( 57 | 6A2EBA9D1CEEBB8F006FB871 /* DDStatusBarFlip */, 58 | 6A2EBA9C1CEEBB8E006FB871 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 6A2EBA9C1CEEBB8E006FB871 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 6A2EBA9B1CEEBB8E006FB871 /* DDStatusBarFlip.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 6A2EBA9D1CEEBB8F006FB871 /* DDStatusBarFlip */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 6A2EBAB51CF06158006FB871 /* DDStatusBarNotification.h */, 74 | 6A2EBAB61CF06158006FB871 /* DDStatusBarNotification.m */, 75 | 6A2EBAC71CF3102D006FB871 /* DDTransform3DPerspective.h */, 76 | 6A2EBAC81CF3102D006FB871 /* DDTransform3DPerspective.m */, 77 | 6A2EBABB1CF14BE2006FB871 /* DDStatusBarView.h */, 78 | 6A2EBABC1CF14BE2006FB871 /* DDStatusBarView.m */, 79 | 6A2EBAB81CF0BF19006FB871 /* DDStatusBarNotificationViewController.h */, 80 | 6A2EBAB91CF0BF19006FB871 /* DDStatusBarNotificationViewController.m */, 81 | 6A2EBA9E1CEEBB8F006FB871 /* Supporting Files */, 82 | ); 83 | path = DDStatusBarFlip; 84 | sourceTree = ""; 85 | }; 86 | 6A2EBA9E1CEEBB8F006FB871 /* Supporting Files */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 6A2EBAA41CEEBB8F006FB871 /* ViewController.h */, 90 | 6A2EBAA51CEEBB8F006FB871 /* ViewController.m */, 91 | 6A2EBAA71CEEBB8F006FB871 /* Main.storyboard */, 92 | 6A2EBAAA1CEEBB90006FB871 /* Assets.xcassets */, 93 | 6A2EBAAC1CEEBB90006FB871 /* LaunchScreen.storyboard */, 94 | 6A2EBAAF1CEEBB90006FB871 /* Info.plist */, 95 | 6A2EBAA11CEEBB8F006FB871 /* AppDelegate.h */, 96 | 6A2EBAA21CEEBB8F006FB871 /* AppDelegate.m */, 97 | 6A2EBA9F1CEEBB8F006FB871 /* main.m */, 98 | ); 99 | name = "Supporting Files"; 100 | sourceTree = ""; 101 | }; 102 | /* End PBXGroup section */ 103 | 104 | /* Begin PBXNativeTarget section */ 105 | 6A2EBA9A1CEEBB8E006FB871 /* DDStatusBarFlip */ = { 106 | isa = PBXNativeTarget; 107 | buildConfigurationList = 6A2EBAB21CEEBB90006FB871 /* Build configuration list for PBXNativeTarget "DDStatusBarFlip" */; 108 | buildPhases = ( 109 | 6A2EBA971CEEBB8E006FB871 /* Sources */, 110 | 6A2EBA981CEEBB8E006FB871 /* Frameworks */, 111 | 6A2EBA991CEEBB8E006FB871 /* Resources */, 112 | ); 113 | buildRules = ( 114 | ); 115 | dependencies = ( 116 | ); 117 | name = DDStatusBarFlip; 118 | productName = DDStatusBarFlip; 119 | productReference = 6A2EBA9B1CEEBB8E006FB871 /* DDStatusBarFlip.app */; 120 | productType = "com.apple.product-type.application"; 121 | }; 122 | /* End PBXNativeTarget section */ 123 | 124 | /* Begin PBXProject section */ 125 | 6A2EBA931CEEBB8E006FB871 /* Project object */ = { 126 | isa = PBXProject; 127 | attributes = { 128 | LastUpgradeCheck = 0730; 129 | ORGANIZATIONNAME = druidream; 130 | TargetAttributes = { 131 | 6A2EBA9A1CEEBB8E006FB871 = { 132 | CreatedOnToolsVersion = 7.3.1; 133 | }; 134 | }; 135 | }; 136 | buildConfigurationList = 6A2EBA961CEEBB8E006FB871 /* Build configuration list for PBXProject "DDStatusBarFlip" */; 137 | compatibilityVersion = "Xcode 3.2"; 138 | developmentRegion = English; 139 | hasScannedForEncodings = 0; 140 | knownRegions = ( 141 | en, 142 | Base, 143 | ); 144 | mainGroup = 6A2EBA921CEEBB8E006FB871; 145 | productRefGroup = 6A2EBA9C1CEEBB8E006FB871 /* Products */; 146 | projectDirPath = ""; 147 | projectRoot = ""; 148 | targets = ( 149 | 6A2EBA9A1CEEBB8E006FB871 /* DDStatusBarFlip */, 150 | ); 151 | }; 152 | /* End PBXProject section */ 153 | 154 | /* Begin PBXResourcesBuildPhase section */ 155 | 6A2EBA991CEEBB8E006FB871 /* Resources */ = { 156 | isa = PBXResourcesBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | 6A2EBAAE1CEEBB90006FB871 /* LaunchScreen.storyboard in Resources */, 160 | 6A2EBAAB1CEEBB90006FB871 /* Assets.xcassets in Resources */, 161 | 6A2EBAA91CEEBB8F006FB871 /* Main.storyboard in Resources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXResourcesBuildPhase section */ 166 | 167 | /* Begin PBXSourcesBuildPhase section */ 168 | 6A2EBA971CEEBB8E006FB871 /* Sources */ = { 169 | isa = PBXSourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | 6A2EBAB71CF06158006FB871 /* DDStatusBarNotification.m in Sources */, 173 | 6A2EBAA61CEEBB8F006FB871 /* ViewController.m in Sources */, 174 | 6A2EBAA31CEEBB8F006FB871 /* AppDelegate.m in Sources */, 175 | 6A2EBABA1CF0BF19006FB871 /* DDStatusBarNotificationViewController.m in Sources */, 176 | 6A2EBABD1CF14BE2006FB871 /* DDStatusBarView.m in Sources */, 177 | 6A2EBAA01CEEBB8F006FB871 /* main.m in Sources */, 178 | 6A2EBAC91CF3102D006FB871 /* DDTransform3DPerspective.m in Sources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXSourcesBuildPhase section */ 183 | 184 | /* Begin PBXVariantGroup section */ 185 | 6A2EBAA71CEEBB8F006FB871 /* Main.storyboard */ = { 186 | isa = PBXVariantGroup; 187 | children = ( 188 | 6A2EBAA81CEEBB8F006FB871 /* Base */, 189 | ); 190 | name = Main.storyboard; 191 | sourceTree = ""; 192 | }; 193 | 6A2EBAAC1CEEBB90006FB871 /* LaunchScreen.storyboard */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 6A2EBAAD1CEEBB90006FB871 /* Base */, 197 | ); 198 | name = LaunchScreen.storyboard; 199 | sourceTree = ""; 200 | }; 201 | /* End PBXVariantGroup section */ 202 | 203 | /* Begin XCBuildConfiguration section */ 204 | 6A2EBAB01CEEBB90006FB871 /* Debug */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | CLANG_ANALYZER_NONNULL = YES; 209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 210 | CLANG_CXX_LIBRARY = "libc++"; 211 | CLANG_ENABLE_MODULES = YES; 212 | CLANG_ENABLE_OBJC_ARC = YES; 213 | CLANG_WARN_BOOL_CONVERSION = YES; 214 | CLANG_WARN_CONSTANT_CONVERSION = YES; 215 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 216 | CLANG_WARN_EMPTY_BODY = YES; 217 | CLANG_WARN_ENUM_CONVERSION = YES; 218 | CLANG_WARN_INT_CONVERSION = YES; 219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 220 | CLANG_WARN_UNREACHABLE_CODE = YES; 221 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 222 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 223 | COPY_PHASE_STRIP = NO; 224 | DEBUG_INFORMATION_FORMAT = dwarf; 225 | ENABLE_STRICT_OBJC_MSGSEND = YES; 226 | ENABLE_TESTABILITY = YES; 227 | GCC_C_LANGUAGE_STANDARD = gnu99; 228 | GCC_DYNAMIC_NO_PIC = NO; 229 | GCC_NO_COMMON_BLOCKS = YES; 230 | GCC_OPTIMIZATION_LEVEL = 0; 231 | GCC_PREPROCESSOR_DEFINITIONS = ( 232 | "DEBUG=1", 233 | "$(inherited)", 234 | ); 235 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 236 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 237 | GCC_WARN_UNDECLARED_SELECTOR = YES; 238 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 239 | GCC_WARN_UNUSED_FUNCTION = YES; 240 | GCC_WARN_UNUSED_VARIABLE = YES; 241 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 242 | MTL_ENABLE_DEBUG_INFO = YES; 243 | ONLY_ACTIVE_ARCH = YES; 244 | SDKROOT = iphoneos; 245 | }; 246 | name = Debug; 247 | }; 248 | 6A2EBAB11CEEBB90006FB871 /* Release */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 254 | CLANG_CXX_LIBRARY = "libc++"; 255 | CLANG_ENABLE_MODULES = YES; 256 | CLANG_ENABLE_OBJC_ARC = YES; 257 | CLANG_WARN_BOOL_CONVERSION = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INT_CONVERSION = YES; 263 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = NO; 268 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 269 | ENABLE_NS_ASSERTIONS = NO; 270 | ENABLE_STRICT_OBJC_MSGSEND = YES; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 280 | MTL_ENABLE_DEBUG_INFO = NO; 281 | SDKROOT = iphoneos; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | 6A2EBAB31CEEBB90006FB871 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | INFOPLIST_FILE = DDStatusBarFlip/Info.plist; 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 292 | PRODUCT_BUNDLE_IDENTIFIER = demo.druidream.DDStatusBarFlip; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | }; 295 | name = Debug; 296 | }; 297 | 6A2EBAB41CEEBB90006FB871 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | INFOPLIST_FILE = DDStatusBarFlip/Info.plist; 302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 303 | PRODUCT_BUNDLE_IDENTIFIER = demo.druidream.DDStatusBarFlip; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | }; 306 | name = Release; 307 | }; 308 | /* End XCBuildConfiguration section */ 309 | 310 | /* Begin XCConfigurationList section */ 311 | 6A2EBA961CEEBB8E006FB871 /* Build configuration list for PBXProject "DDStatusBarFlip" */ = { 312 | isa = XCConfigurationList; 313 | buildConfigurations = ( 314 | 6A2EBAB01CEEBB90006FB871 /* Debug */, 315 | 6A2EBAB11CEEBB90006FB871 /* Release */, 316 | ); 317 | defaultConfigurationIsVisible = 0; 318 | defaultConfigurationName = Release; 319 | }; 320 | 6A2EBAB21CEEBB90006FB871 /* Build configuration list for PBXNativeTarget "DDStatusBarFlip" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 6A2EBAB31CEEBB90006FB871 /* Debug */, 324 | 6A2EBAB41CEEBB90006FB871 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | }; 328 | /* End XCConfigurationList section */ 329 | }; 330 | rootObject = 6A2EBA931CEEBB8E006FB871 /* Project object */; 331 | } 332 | -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/project.xcworkspace/xcuserdata/druidream.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/druidream/DDStatusBarFlip/00c16f1ca1a656bde84da1768ae03177d1a19614/DDStatusBarFlip.xcodeproj/project.xcworkspace/xcuserdata/druidream.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/xcuserdata/druidream.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/xcuserdata/druidream.xcuserdatad/xcschemes/DDStatusBarFlip.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /DDStatusBarFlip.xcodeproj/xcuserdata/druidream.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DDStatusBarFlip.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6A2EBA9A1CEEBB8E006FB871 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DDStatusBarFlip/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/20/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DDStatusBarFlip/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/20/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/1.imageset/0170e556eb4e186ac7257d20c1fc71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/druidream/DDStatusBarFlip/00c16f1ca1a656bde84da1768ae03177d1a19614/DDStatusBarFlip/Assets.xcassets/1.imageset/0170e556eb4e186ac7257d20c1fc71.png -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "0170e556eb4e186ac7257d20c1fc71.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/2.imageset/01b82656eb4e0f32f875a94469b6ff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/druidream/DDStatusBarFlip/00c16f1ca1a656bde84da1768ae03177d1a19614/DDStatusBarFlip/Assets.xcassets/2.imageset/01b82656eb4e0f32f875a94469b6ff.png -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "01b82656eb4e0f32f875a94469b6ff.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/3.imageset/011bcf56eb4e1b32f875a9440642d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/druidream/DDStatusBarFlip/00c16f1ca1a656bde84da1768ae03177d1a19614/DDStatusBarFlip/Assets.xcassets/3.imageset/011bcf56eb4e1b32f875a9440642d1.png -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "011bcf56eb4e1b32f875a9440642d1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/4.imageset/015b8056eb4e0b32f875a9444a4c20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/druidream/DDStatusBarFlip/00c16f1ca1a656bde84da1768ae03177d1a19614/DDStatusBarFlip/Assets.xcassets/4.imageset/015b8056eb4e0b32f875a9444a4c20.png -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "015b8056eb4e0b32f875a9444a4c20.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DDStatusBarFlip/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 | -------------------------------------------------------------------------------- /DDStatusBarFlip/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 | 36 | 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 | 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 | 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 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarNotification.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarNotification.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/21/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDStatusBarNotification : NSObject 12 | 13 | + (void)showWithText:(NSString *)text; 14 | + (void)hide; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarNotification.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarNotification.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/21/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DDStatusBarNotification.h" 11 | #import "DDStatusBarNotificationViewController.h" 12 | #import "DDStatusBarView.h" 13 | #import "DDTransform3DPerspective.h" 14 | 15 | @interface DDStatusBarNotification () 16 | 17 | @property (strong, nonatomic) UIWindow *overlayWindow; 18 | @property (strong, nonatomic) DDStatusBarView *topBar; 19 | @property (strong, nonatomic) UIImageView *imageView; 20 | @property (strong, nonatomic) NSTimer *timer; 21 | 22 | @end 23 | 24 | @implementation DDStatusBarNotification 25 | @synthesize overlayWindow = _overlayWindow; 26 | @synthesize topBar = _topBar; 27 | @synthesize imageView = _imageView; 28 | 29 | static CGFloat NOTIFICATION_BAR_HEIGHT = 20.0f; 30 | 31 | + (instancetype)sharedInstance { 32 | static dispatch_once_t once; 33 | static DDStatusBarNotification *sharedInstance; 34 | dispatch_once(&once, ^ { 35 | sharedInstance = [[self alloc] init]; 36 | }); 37 | return sharedInstance; 38 | } 39 | 40 | + (void)showWithText:(NSString *)text { 41 | 42 | [[self sharedInstance] showWithText:text]; 43 | } 44 | 45 | + (void)hide { 46 | 47 | [[self sharedInstance] hide]; 48 | } 49 | 50 | #pragma mark - 51 | 52 | - (void)showWithText:(NSString *)text 53 | { 54 | // first, check if status bar is visible at all 55 | if ([UIApplication sharedApplication].statusBarHidden) return ; 56 | 57 | // prepare for new style 58 | // if (style != self.activeStyle) { 59 | // self.activeStyle = style; 60 | // if (self.activeStyle.animationType == JDStatusBarAnimationTypeFade) { 61 | // self.topBar.alpha = 0.0; 62 | // self.topBar.transform = CGAffineTransformIdentity; 63 | // } else { 64 | // self.topBar.alpha = 1.0; 65 | // self.topBar.transform = CGAffineTransformMakeTranslation(0, -self.topBar.frame.size.height); 66 | // } 67 | // } 68 | 69 | // cancel previous dismissing & remove animations 70 | // [[NSRunLoop currentRunLoop] cancelPerformSelector:@selector(dismiss) target:self argument:nil]; 71 | [self.topBar.layer removeAllAnimations]; 72 | 73 | // create & show window 74 | [self.overlayWindow setHidden:NO]; 75 | 76 | // update style 77 | // self.topBar.backgroundColor = style.barColor; 78 | // self.topBar.textVerticalPositionAdjustment = style.textVerticalPositionAdjustment; 79 | UILabel *textLabel = self.topBar.textLabel; 80 | // textLabel.textColor = style.textColor; 81 | // textLabel.font = style.font; 82 | // textLabel.accessibilityLabel = status; 83 | textLabel.text = text; 84 | 85 | // if (style.textShadow) { 86 | // textLabel.shadowColor = style.textShadow.shadowColor; 87 | // textLabel.shadowOffset = style.textShadow.shadowOffset; 88 | // } else { 89 | // textLabel.shadowColor = nil; 90 | // textLabel.shadowOffset = CGSizeZero; 91 | // } 92 | 93 | // reset progress & activity 94 | // self.progress = 0.0; 95 | // [self showActivityIndicator:NO indicatorStyle:0]; 96 | 97 | // animate in 98 | // BOOL animationsEnabled = (style.animationType != JDStatusBarAnimationTypeNone); 99 | // if (animationsEnabled && style.animationType == JDStatusBarAnimationTypeBounce) { 100 | // [self animateInWithBounceAnimation]; 101 | // } else { 102 | // [UIView animateWithDuration:(animationsEnabled ? 0.4 : 0.0) animations:^{ 103 | // self.topBar.alpha = 1.0; 104 | // self.topBar.transform = CGAffineTransformIdentity; 105 | // }]; 106 | // } 107 | 108 | // return self.topBar; 109 | 110 | // 开始执行动画 111 | if ([self.timer isValid]) { 112 | return; 113 | } 114 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(timerFired:) userInfo:@YES repeats:YES]; 115 | } 116 | 117 | - (void)hide { 118 | 119 | if ([self.timer isValid]) { 120 | return; 121 | } 122 | self.timer = [NSTimer scheduledTimerWithTimeInterval:0.017 target:self selector:@selector(timerFired:) userInfo:@NO repeats:YES]; 123 | } 124 | 125 | #pragma mark Lazy views 126 | 127 | - (UIWindow *)overlayWindow; 128 | { 129 | if(_overlayWindow == nil) { 130 | CGRect frame = CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), NOTIFICATION_BAR_HEIGHT); 131 | // CGRect frame = [UIScreen mainScreen].bounds; 132 | _overlayWindow = [[UIWindow alloc] initWithFrame:frame]; 133 | _overlayWindow.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 134 | _overlayWindow.backgroundColor = [UIColor clearColor]; 135 | _overlayWindow.userInteractionEnabled = NO; 136 | _overlayWindow.windowLevel = UIWindowLevelStatusBar; 137 | _overlayWindow.rootViewController = [[DDStatusBarNotificationViewController alloc] init]; 138 | _overlayWindow.rootViewController.view.backgroundColor = [UIColor clearColor]; 139 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 // only when deployment target is < ios7 140 | _overlayWindow.rootViewController.wantsFullScreenLayout = YES; 141 | #endif 142 | [self updateWindowTransform]; 143 | [self updateTopBarFrameWithStatusBarFrame:[[UIApplication sharedApplication] statusBarFrame]]; 144 | } 145 | return _overlayWindow; 146 | } 147 | 148 | - (DDStatusBarView *)topBar { 149 | 150 | if(_topBar == nil) { 151 | _topBar = [[DDStatusBarView alloc] init]; 152 | [self.overlayWindow.rootViewController.view addSubview:_topBar]; 153 | 154 | // init topBar angle 155 | [self setCubeFlipAngle:-M_PI_2]; 156 | } 157 | return _topBar; 158 | } 159 | 160 | - (UIImageView *)imageView { 161 | 162 | if (_imageView == nil) { 163 | UIImage *image = [[UIImage alloc] initWithData:[self screenshot] scale:[UIScreen mainScreen].scale]; 164 | _imageView = [[UIImageView alloc] initWithImage:image]; 165 | 166 | [self.overlayWindow.rootViewController.view addSubview:_imageView]; 167 | } 168 | return _imageView; 169 | } 170 | 171 | #pragma mark Rotation 172 | 173 | - (void)updateWindowTransform; 174 | { 175 | UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 176 | _overlayWindow.transform = window.transform; 177 | _overlayWindow.frame = window.frame; 178 | } 179 | 180 | - (void)updateTopBarFrameWithStatusBarFrame:(CGRect)rect; 181 | { 182 | CGFloat width = MAX(rect.size.width, rect.size.height); 183 | CGFloat height = MIN(rect.size.width, rect.size.height); 184 | 185 | // on ios7 fix position, if statusBar has double height 186 | CGFloat yPos = 0; 187 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && height > 20.0) { 188 | yPos = -height/2.0; 189 | } 190 | 191 | _topBar.frame = CGRectMake(0, yPos, width, height); 192 | } 193 | 194 | #pragma mark - 195 | 196 | - (void)timerFired:(NSTimer *)sender { 197 | 198 | BOOL isPresentation = [sender.userInfo boolValue]; 199 | 200 | static float angle = -M_PI_2; 201 | if (isPresentation) { 202 | angle += 0.1f; 203 | if (angle > 0) { 204 | angle = 0; 205 | [self.timer invalidate]; 206 | } 207 | [self setCubeFlipAngle:angle]; 208 | } else { 209 | angle -= 0.1f; 210 | if (angle < -M_PI_2) { 211 | angle = -M_PI_2; 212 | [self.timer invalidate]; 213 | self.timer = nil; 214 | // [self.imageView removeFromSuperview]; 215 | self.imageView = nil; 216 | self.topBar = nil; 217 | self.overlayWindow = nil; 218 | } 219 | [self setCubeFlipAngle:angle]; 220 | } 221 | } 222 | 223 | - (void)setCubeFlipAngle:(float)angle 224 | { 225 | CATransform3D move = CATransform3DMakeTranslation(0, 0, 10); 226 | CATransform3D back = CATransform3DMakeTranslation(0, 0, -10); 227 | 228 | CATransform3D rotate0 = CATransform3DMakeRotation(-angle, 1, 0, 0); 229 | // CATransform3D rotate1 = CATransform3DMakeRotation(M_PI_2-angle, 1, 0, 0); 230 | // CATransform3D rotate2 = CATransform3DMakeRotation(M_PI_2*2-angle, 1, 0, 0); 231 | CATransform3D rotate3 = CATransform3DMakeRotation(M_PI_2*3-angle, 1, 0, 0); 232 | 233 | CATransform3D mat0 = CATransform3DConcat(CATransform3DConcat(move, rotate0), back); 234 | // CATransform3D mat1 = CATransform3DConcat(CATransform3DConcat(move, rotate1), back); 235 | // CATransform3D mat2 = CATransform3DConcat(CATransform3DConcat(move, rotate2), back); 236 | CATransform3D mat3 = CATransform3DConcat(CATransform3DConcat(move, rotate3), back); 237 | 238 | self.topBar.layer.transform = CATransform3DPerspect(mat0, CGPointZero, 500.0f); 239 | self.imageView.layer.transform = CATransform3DPerspect(mat3, CGPointZero, 500.0f); 240 | } 241 | 242 | - (NSData *)screenshot { 243 | 244 | UIWindow *window = [[UIApplication sharedApplication] valueForKey:@"statusBarWindow"]; 245 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) 246 | UIGraphicsBeginImageContextWithOptions(CGSizeMake(CGRectGetWidth(window.bounds), NOTIFICATION_BAR_HEIGHT), NO, [UIScreen mainScreen].scale); 247 | else 248 | UIGraphicsBeginImageContext(CGSizeMake(CGRectGetWidth(window.bounds), NOTIFICATION_BAR_HEIGHT)); 249 | 250 | // first, draw keyWindow as background 251 | [[UIApplication sharedApplication].keyWindow.layer renderInContext:UIGraphicsGetCurrentContext()]; 252 | 253 | // second, draw status bar on top 254 | [window.layer renderInContext:UIGraphicsGetCurrentContext()]; 255 | 256 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 257 | UIGraphicsEndImageContext(); 258 | // NSData * imgData = UIImageJPEGRepresentation(image, 1.0f); 259 | NSData * imgData = UIImagePNGRepresentation(image); 260 | 261 | if(imgData) { 262 | // for debug 263 | // NSString *path = [NSString stringWithFormat:@"%@screenshot.png", NSTemporaryDirectory()]; 264 | // [imgData writeToFile:path atomically:YES]; 265 | return imgData; 266 | } else 267 | NSLog(@"error while taking screenshot"); 268 | return nil; 269 | } 270 | 271 | @end 272 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarNotificationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarNotificationViewController.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/22/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDStatusBarNotificationViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarNotificationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarNotificationViewController.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/22/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import "DDStatusBarNotificationViewController.h" 10 | 11 | @interface DDStatusBarNotificationViewController () 12 | 13 | @end 14 | 15 | @implementation DDStatusBarNotificationViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarView.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/22/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDStatusBarView : UIView 12 | 13 | @property (strong, nonatomic) UILabel *textLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDStatusBarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDStatusBarView.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/22/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import "DDStatusBarView.h" 10 | 11 | @implementation DDStatusBarView 12 | 13 | - (UILabel *)textLabel; 14 | { 15 | if (_textLabel == nil) { 16 | _textLabel = [[UILabel alloc] init]; 17 | _textLabel.backgroundColor = [UIColor darkGrayColor]; 18 | _textLabel.textColor = [UIColor lightTextColor]; 19 | _textLabel.font = [UIFont systemFontOfSize:12.0]; 20 | _textLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; 21 | _textLabel.textAlignment = NSTextAlignmentCenter; 22 | _textLabel.adjustsFontSizeToFitWidth = YES; 23 | _textLabel.clipsToBounds = YES; 24 | [self addSubview:_textLabel]; 25 | } 26 | return _textLabel; 27 | } 28 | 29 | #pragma mark layout 30 | 31 | - (void)layoutSubviews; 32 | { 33 | [super layoutSubviews]; 34 | 35 | // label 36 | self.textLabel.frame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDTransform3DPerspective.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDTransform3DPerspective.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/23/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDTransform3DPerspective : NSObject 12 | 13 | CATransform3D CATransform3DMakePerspective(CGPoint center, float disZ); 14 | CATransform3D CATransform3DPerspect(CATransform3D t, CGPoint center, float disZ); 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DDStatusBarFlip/DDTransform3DPerspective.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDTransform3DPerspective.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/23/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DDTransform3DPerspective.h" 11 | 12 | @implementation DDTransform3DPerspective 13 | 14 | CATransform3D CATransform3DMakePerspective(CGPoint center, float disZ) 15 | { 16 | CATransform3D transToCenter = CATransform3DMakeTranslation(-center.x, -center.y, 0); 17 | CATransform3D transBack = CATransform3DMakeTranslation(center.x, center.y, 0); 18 | CATransform3D scale = CATransform3DIdentity; 19 | scale.m34 = -1.0f/disZ; 20 | return CATransform3DConcat(CATransform3DConcat(transToCenter, scale), transBack); 21 | } 22 | 23 | CATransform3D CATransform3DPerspect(CATransform3D t, CGPoint center, float disZ) 24 | { 25 | return CATransform3DConcat(t, CATransform3DMakePerspective(center, disZ)); 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DDStatusBarFlip/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 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DDStatusBarFlip/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/20/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DDStatusBarFlip/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/20/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DDStatusBarNotification.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *image1; 15 | @property (weak, nonatomic) IBOutlet UIImageView *image2; 16 | @property (weak, nonatomic) IBOutlet UIImageView *image3; 17 | @property (weak, nonatomic) IBOutlet UIImageView *image4; 18 | @property (weak, nonatomic) IBOutlet UILabel *notificationBar; 19 | @property (strong, nonatomic) NSTimer *timer; 20 | @property (weak, nonatomic) IBOutlet UIImageView *testImageView; 21 | @property (weak, nonatomic) IBOutlet UIImageView *rawImageView; 22 | 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view, typically from a nib. 30 | } 31 | 32 | - (IBAction)presentButtonDidClick:(UIButton *)sender { 33 | 34 | [DDStatusBarNotification showWithText:@"You've got a new message."]; 35 | } 36 | 37 | - (IBAction)dismissButtonDidClick:(UIButton *)sender { 38 | 39 | [DDStatusBarNotification hide]; 40 | } 41 | 42 | - (BOOL)prefersStatusBarHidden { 43 | return NO; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DDStatusBarFlip/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DDStatusBarFlip 4 | // 5 | // Created by Gu Jun on 5/20/16. 6 | // Copyright © 2016 druidream. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![DDStatusBarFlip](https://cloud.githubusercontent.com/assets/7624568/15533642/21e30c60-2298-11e6-9389-1337c8d2bfd7.gif) 2 | --------------------------------------------------------------------------------