├── .gitignore ├── LICENSE ├── LetterPressExplosion ├── LetterPressExplosion.xcodeproj │ └── project.pbxproj ├── LetterPressExplosion │ ├── Assets │ │ └── letterpress@2x.png │ ├── Categories │ │ ├── UIView+Explode.h │ │ └── UIView+Explode.m │ ├── DTVAppDelegate.h │ ├── DTVAppDelegate.m │ ├── DTVViewController.h │ ├── DTVViewController.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── LetterPressExplosion-Info.plist │ ├── LetterPressExplosion-Prefix.pch │ ├── en.lproj │ │ ├── DTVViewController_iPad.xib │ │ ├── DTVViewController_iPhone.xib │ │ └── InfoPlist.strings │ └── main.m └── LetterPressExplosionTests │ ├── LetterPressExplosionTests-Info.plist │ ├── LetterPressExplosionTests.h │ ├── LetterPressExplosionTests.m │ └── en.lproj │ └── InfoPlist.strings ├── LetterpressExplosion.podspec └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Daniel Tavares 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5884DA881AC1AB1D009E872C /* UIView+Explode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037AF11704AC6D001FF084 /* UIView+Explode.m */; }; 11 | 5884DA891AC1AB69009E872C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AF61704ACFE001FF084 /* QuartzCore.framework */; }; 12 | 5884DA8A1AC1ABA0009E872C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB51704A960001FF084 /* CoreGraphics.framework */; }; 13 | 6C037AB21704A960001FF084 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB11704A960001FF084 /* UIKit.framework */; }; 14 | 6C037AB41704A960001FF084 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB31704A960001FF084 /* Foundation.framework */; }; 15 | 6C037AB61704A960001FF084 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB51704A960001FF084 /* CoreGraphics.framework */; }; 16 | 6C037ABC1704A960001FF084 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6C037ABA1704A960001FF084 /* InfoPlist.strings */; }; 17 | 6C037ABE1704A960001FF084 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037ABD1704A960001FF084 /* main.m */; }; 18 | 6C037AC21704A960001FF084 /* DTVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037AC11704A960001FF084 /* DTVAppDelegate.m */; }; 19 | 6C037AC41704A960001FF084 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C037AC31704A960001FF084 /* Default.png */; }; 20 | 6C037AC61704A960001FF084 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C037AC51704A960001FF084 /* Default@2x.png */; }; 21 | 6C037AC81704A960001FF084 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C037AC71704A960001FF084 /* Default-568h@2x.png */; }; 22 | 6C037ACB1704A960001FF084 /* DTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037ACA1704A960001FF084 /* DTVViewController.m */; }; 23 | 6C037ACE1704A960001FF084 /* DTVViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6C037ACC1704A960001FF084 /* DTVViewController_iPhone.xib */; }; 24 | 6C037AD11704A960001FF084 /* DTVViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6C037ACF1704A960001FF084 /* DTVViewController_iPad.xib */; }; 25 | 6C037ADA1704A960001FF084 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB11704A960001FF084 /* UIKit.framework */; }; 26 | 6C037ADB1704A960001FF084 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AB31704A960001FF084 /* Foundation.framework */; }; 27 | 6C037AE31704A960001FF084 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6C037AE11704A960001FF084 /* InfoPlist.strings */; }; 28 | 6C037AE61704A960001FF084 /* LetterPressExplosionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037AE51704A960001FF084 /* LetterPressExplosionTests.m */; }; 29 | 6C037AF21704AC6D001FF084 /* UIView+Explode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C037AF11704AC6D001FF084 /* UIView+Explode.m */; }; 30 | 6C037AF71704ACFE001FF084 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C037AF61704ACFE001FF084 /* QuartzCore.framework */; }; 31 | 6C037AFA1704AE0E001FF084 /* letterpress@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C037AF91704AE0E001FF084 /* letterpress@2x.png */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | 6C037ADC1704A960001FF084 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 6C037AA61704A960001FF084 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 6C037AAD1704A960001FF084; 40 | remoteInfo = LetterPressExplosion; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 6C037AAE1704A960001FF084 /* LetterPressExplosion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LetterPressExplosion.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 6C037AB11704A960001FF084 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | 6C037AB31704A960001FF084 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 6C037AB51704A960001FF084 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 6C037AB91704A960001FF084 /* LetterPressExplosion-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LetterPressExplosion-Info.plist"; sourceTree = ""; }; 50 | 6C037ABB1704A960001FF084 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 51 | 6C037ABD1704A960001FF084 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 6C037ABF1704A960001FF084 /* LetterPressExplosion-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LetterPressExplosion-Prefix.pch"; sourceTree = ""; }; 53 | 6C037AC01704A960001FF084 /* DTVAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTVAppDelegate.h; sourceTree = ""; }; 54 | 6C037AC11704A960001FF084 /* DTVAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTVAppDelegate.m; sourceTree = ""; }; 55 | 6C037AC31704A960001FF084 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 56 | 6C037AC51704A960001FF084 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 57 | 6C037AC71704A960001FF084 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 58 | 6C037AC91704A960001FF084 /* DTVViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTVViewController.h; sourceTree = ""; }; 59 | 6C037ACA1704A960001FF084 /* DTVViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTVViewController.m; sourceTree = ""; }; 60 | 6C037ACD1704A960001FF084 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DTVViewController_iPhone.xib; sourceTree = ""; }; 61 | 6C037AD01704A960001FF084 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DTVViewController_iPad.xib; sourceTree = ""; }; 62 | 6C037AD71704A960001FF084 /* LetterPressExplosionTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LetterPressExplosionTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | 6C037AE01704A960001FF084 /* LetterPressExplosionTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LetterPressExplosionTests-Info.plist"; sourceTree = ""; }; 64 | 6C037AE21704A960001FF084 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 65 | 6C037AE41704A960001FF084 /* LetterPressExplosionTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LetterPressExplosionTests.h; sourceTree = ""; }; 66 | 6C037AE51704A960001FF084 /* LetterPressExplosionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LetterPressExplosionTests.m; sourceTree = ""; }; 67 | 6C037AF01704AC6D001FF084 /* UIView+Explode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Explode.h"; sourceTree = ""; }; 68 | 6C037AF11704AC6D001FF084 /* UIView+Explode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Explode.m"; sourceTree = ""; }; 69 | 6C037AF61704ACFE001FF084 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 70 | 6C037AF91704AE0E001FF084 /* letterpress@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "letterpress@2x.png"; sourceTree = ""; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | 6C037AAB1704A960001FF084 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | 6C037AF71704ACFE001FF084 /* QuartzCore.framework in Frameworks */, 79 | 6C037AB21704A960001FF084 /* UIKit.framework in Frameworks */, 80 | 6C037AB41704A960001FF084 /* Foundation.framework in Frameworks */, 81 | 6C037AB61704A960001FF084 /* CoreGraphics.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 6C037AD31704A960001FF084 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | 5884DA8A1AC1ABA0009E872C /* CoreGraphics.framework in Frameworks */, 90 | 5884DA891AC1AB69009E872C /* QuartzCore.framework in Frameworks */, 91 | 6C037ADA1704A960001FF084 /* UIKit.framework in Frameworks */, 92 | 6C037ADB1704A960001FF084 /* Foundation.framework in Frameworks */, 93 | ); 94 | runOnlyForDeploymentPostprocessing = 0; 95 | }; 96 | /* End PBXFrameworksBuildPhase section */ 97 | 98 | /* Begin PBXGroup section */ 99 | 6C037AA51704A960001FF084 = { 100 | isa = PBXGroup; 101 | children = ( 102 | 6C037AB71704A960001FF084 /* LetterPressExplosion */, 103 | 6C037ADE1704A960001FF084 /* LetterPressExplosionTests */, 104 | 6C037AB01704A960001FF084 /* Frameworks */, 105 | 6C037AAF1704A960001FF084 /* Products */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | 6C037AAF1704A960001FF084 /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 6C037AAE1704A960001FF084 /* LetterPressExplosion.app */, 113 | 6C037AD71704A960001FF084 /* LetterPressExplosionTests.octest */, 114 | ); 115 | name = Products; 116 | sourceTree = ""; 117 | }; 118 | 6C037AB01704A960001FF084 /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 6C037AF61704ACFE001FF084 /* QuartzCore.framework */, 122 | 6C037AB11704A960001FF084 /* UIKit.framework */, 123 | 6C037AB31704A960001FF084 /* Foundation.framework */, 124 | 6C037AB51704A960001FF084 /* CoreGraphics.framework */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | 6C037AB71704A960001FF084 /* LetterPressExplosion */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 6C037AF81704AE0E001FF084 /* Assets */, 133 | 6C037AEF1704AC6D001FF084 /* Categories */, 134 | 6C037AC01704A960001FF084 /* DTVAppDelegate.h */, 135 | 6C037AC11704A960001FF084 /* DTVAppDelegate.m */, 136 | 6C037AC91704A960001FF084 /* DTVViewController.h */, 137 | 6C037ACA1704A960001FF084 /* DTVViewController.m */, 138 | 6C037ACC1704A960001FF084 /* DTVViewController_iPhone.xib */, 139 | 6C037ACF1704A960001FF084 /* DTVViewController_iPad.xib */, 140 | 6C037AB81704A960001FF084 /* Supporting Files */, 141 | ); 142 | path = LetterPressExplosion; 143 | sourceTree = ""; 144 | }; 145 | 6C037AB81704A960001FF084 /* Supporting Files */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 6C037AB91704A960001FF084 /* LetterPressExplosion-Info.plist */, 149 | 6C037ABA1704A960001FF084 /* InfoPlist.strings */, 150 | 6C037ABD1704A960001FF084 /* main.m */, 151 | 6C037ABF1704A960001FF084 /* LetterPressExplosion-Prefix.pch */, 152 | 6C037AC31704A960001FF084 /* Default.png */, 153 | 6C037AC51704A960001FF084 /* Default@2x.png */, 154 | 6C037AC71704A960001FF084 /* Default-568h@2x.png */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 6C037ADE1704A960001FF084 /* LetterPressExplosionTests */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 6C037AE41704A960001FF084 /* LetterPressExplosionTests.h */, 163 | 6C037AE51704A960001FF084 /* LetterPressExplosionTests.m */, 164 | 6C037ADF1704A960001FF084 /* Supporting Files */, 165 | ); 166 | path = LetterPressExplosionTests; 167 | sourceTree = ""; 168 | }; 169 | 6C037ADF1704A960001FF084 /* Supporting Files */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 6C037AE01704A960001FF084 /* LetterPressExplosionTests-Info.plist */, 173 | 6C037AE11704A960001FF084 /* InfoPlist.strings */, 174 | ); 175 | name = "Supporting Files"; 176 | sourceTree = ""; 177 | }; 178 | 6C037AEF1704AC6D001FF084 /* Categories */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 6C037AF01704AC6D001FF084 /* UIView+Explode.h */, 182 | 6C037AF11704AC6D001FF084 /* UIView+Explode.m */, 183 | ); 184 | path = Categories; 185 | sourceTree = ""; 186 | }; 187 | 6C037AF81704AE0E001FF084 /* Assets */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 6C037AF91704AE0E001FF084 /* letterpress@2x.png */, 191 | ); 192 | path = Assets; 193 | sourceTree = ""; 194 | }; 195 | /* End PBXGroup section */ 196 | 197 | /* Begin PBXNativeTarget section */ 198 | 6C037AAD1704A960001FF084 /* LetterPressExplosion */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = 6C037AE91704A960001FF084 /* Build configuration list for PBXNativeTarget "LetterPressExplosion" */; 201 | buildPhases = ( 202 | 6C037AAA1704A960001FF084 /* Sources */, 203 | 6C037AAB1704A960001FF084 /* Frameworks */, 204 | 6C037AAC1704A960001FF084 /* Resources */, 205 | ); 206 | buildRules = ( 207 | ); 208 | dependencies = ( 209 | ); 210 | name = LetterPressExplosion; 211 | productName = LetterPressExplosion; 212 | productReference = 6C037AAE1704A960001FF084 /* LetterPressExplosion.app */; 213 | productType = "com.apple.product-type.application"; 214 | }; 215 | 6C037AD61704A960001FF084 /* LetterPressExplosionTests */ = { 216 | isa = PBXNativeTarget; 217 | buildConfigurationList = 6C037AEC1704A960001FF084 /* Build configuration list for PBXNativeTarget "LetterPressExplosionTests" */; 218 | buildPhases = ( 219 | 6C037AD21704A960001FF084 /* Sources */, 220 | 6C037AD31704A960001FF084 /* Frameworks */, 221 | 6C037AD41704A960001FF084 /* Resources */, 222 | 6C037AD51704A960001FF084 /* ShellScript */, 223 | ); 224 | buildRules = ( 225 | ); 226 | dependencies = ( 227 | 6C037ADD1704A960001FF084 /* PBXTargetDependency */, 228 | ); 229 | name = LetterPressExplosionTests; 230 | productName = LetterPressExplosionTests; 231 | productReference = 6C037AD71704A960001FF084 /* LetterPressExplosionTests.octest */; 232 | productType = "com.apple.product-type.bundle.unit-test"; 233 | }; 234 | /* End PBXNativeTarget section */ 235 | 236 | /* Begin PBXProject section */ 237 | 6C037AA61704A960001FF084 /* Project object */ = { 238 | isa = PBXProject; 239 | attributes = { 240 | CLASSPREFIX = DTV; 241 | LastTestingUpgradeCheck = 0620; 242 | LastUpgradeCheck = 0460; 243 | ORGANIZATIONNAME = "Daniel Tavares"; 244 | }; 245 | buildConfigurationList = 6C037AA91704A960001FF084 /* Build configuration list for PBXProject "LetterPressExplosion" */; 246 | compatibilityVersion = "Xcode 3.2"; 247 | developmentRegion = English; 248 | hasScannedForEncodings = 0; 249 | knownRegions = ( 250 | en, 251 | ); 252 | mainGroup = 6C037AA51704A960001FF084; 253 | productRefGroup = 6C037AAF1704A960001FF084 /* Products */; 254 | projectDirPath = ""; 255 | projectRoot = ""; 256 | targets = ( 257 | 6C037AAD1704A960001FF084 /* LetterPressExplosion */, 258 | 6C037AD61704A960001FF084 /* LetterPressExplosionTests */, 259 | ); 260 | }; 261 | /* End PBXProject section */ 262 | 263 | /* Begin PBXResourcesBuildPhase section */ 264 | 6C037AAC1704A960001FF084 /* Resources */ = { 265 | isa = PBXResourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 6C037ABC1704A960001FF084 /* InfoPlist.strings in Resources */, 269 | 6C037AC41704A960001FF084 /* Default.png in Resources */, 270 | 6C037AC61704A960001FF084 /* Default@2x.png in Resources */, 271 | 6C037AC81704A960001FF084 /* Default-568h@2x.png in Resources */, 272 | 6C037ACE1704A960001FF084 /* DTVViewController_iPhone.xib in Resources */, 273 | 6C037AD11704A960001FF084 /* DTVViewController_iPad.xib in Resources */, 274 | 6C037AFA1704AE0E001FF084 /* letterpress@2x.png in Resources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | 6C037AD41704A960001FF084 /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 6C037AE31704A960001FF084 /* InfoPlist.strings in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXResourcesBuildPhase section */ 287 | 288 | /* Begin PBXShellScriptBuildPhase section */ 289 | 6C037AD51704A960001FF084 /* ShellScript */ = { 290 | isa = PBXShellScriptBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | inputPaths = ( 295 | ); 296 | outputPaths = ( 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | shellPath = /bin/sh; 300 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 301 | }; 302 | /* End PBXShellScriptBuildPhase section */ 303 | 304 | /* Begin PBXSourcesBuildPhase section */ 305 | 6C037AAA1704A960001FF084 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 6C037ABE1704A960001FF084 /* main.m in Sources */, 310 | 6C037AC21704A960001FF084 /* DTVAppDelegate.m in Sources */, 311 | 6C037ACB1704A960001FF084 /* DTVViewController.m in Sources */, 312 | 6C037AF21704AC6D001FF084 /* UIView+Explode.m in Sources */, 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | }; 316 | 6C037AD21704A960001FF084 /* Sources */ = { 317 | isa = PBXSourcesBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | 5884DA881AC1AB1D009E872C /* UIView+Explode.m in Sources */, 321 | 6C037AE61704A960001FF084 /* LetterPressExplosionTests.m in Sources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | /* End PBXSourcesBuildPhase section */ 326 | 327 | /* Begin PBXTargetDependency section */ 328 | 6C037ADD1704A960001FF084 /* PBXTargetDependency */ = { 329 | isa = PBXTargetDependency; 330 | target = 6C037AAD1704A960001FF084 /* LetterPressExplosion */; 331 | targetProxy = 6C037ADC1704A960001FF084 /* PBXContainerItemProxy */; 332 | }; 333 | /* End PBXTargetDependency section */ 334 | 335 | /* Begin PBXVariantGroup section */ 336 | 6C037ABA1704A960001FF084 /* InfoPlist.strings */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | 6C037ABB1704A960001FF084 /* en */, 340 | ); 341 | name = InfoPlist.strings; 342 | sourceTree = ""; 343 | }; 344 | 6C037ACC1704A960001FF084 /* DTVViewController_iPhone.xib */ = { 345 | isa = PBXVariantGroup; 346 | children = ( 347 | 6C037ACD1704A960001FF084 /* en */, 348 | ); 349 | name = DTVViewController_iPhone.xib; 350 | sourceTree = ""; 351 | }; 352 | 6C037ACF1704A960001FF084 /* DTVViewController_iPad.xib */ = { 353 | isa = PBXVariantGroup; 354 | children = ( 355 | 6C037AD01704A960001FF084 /* en */, 356 | ); 357 | name = DTVViewController_iPad.xib; 358 | sourceTree = ""; 359 | }; 360 | 6C037AE11704A960001FF084 /* InfoPlist.strings */ = { 361 | isa = PBXVariantGroup; 362 | children = ( 363 | 6C037AE21704A960001FF084 /* en */, 364 | ); 365 | name = InfoPlist.strings; 366 | sourceTree = ""; 367 | }; 368 | /* End PBXVariantGroup section */ 369 | 370 | /* Begin XCBuildConfiguration section */ 371 | 6C037AE71704A960001FF084 /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ALWAYS_SEARCH_USER_PATHS = NO; 375 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 376 | CLANG_CXX_LIBRARY = "libc++"; 377 | CLANG_ENABLE_OBJC_ARC = YES; 378 | CLANG_WARN_CONSTANT_CONVERSION = YES; 379 | CLANG_WARN_EMPTY_BODY = YES; 380 | CLANG_WARN_ENUM_CONVERSION = YES; 381 | CLANG_WARN_INT_CONVERSION = YES; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 384 | COPY_PHASE_STRIP = NO; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_DYNAMIC_NO_PIC = NO; 387 | GCC_OPTIMIZATION_LEVEL = 0; 388 | GCC_PREPROCESSOR_DEFINITIONS = ( 389 | "DEBUG=1", 390 | "$(inherited)", 391 | ); 392 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 394 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 397 | ONLY_ACTIVE_ARCH = YES; 398 | SDKROOT = iphoneos; 399 | TARGETED_DEVICE_FAMILY = "1,2"; 400 | }; 401 | name = Debug; 402 | }; 403 | 6C037AE81704A960001FF084 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_OBJC_ARC = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_EMPTY_BODY = YES; 412 | CLANG_WARN_ENUM_CONVERSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 415 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 416 | COPY_PHASE_STRIP = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 419 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 422 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 423 | SDKROOT = iphoneos; 424 | TARGETED_DEVICE_FAMILY = "1,2"; 425 | VALIDATE_PRODUCT = YES; 426 | }; 427 | name = Release; 428 | }; 429 | 6C037AEA1704A960001FF084 /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 433 | GCC_PREFIX_HEADER = "LetterPressExplosion/LetterPressExplosion-Prefix.pch"; 434 | INFOPLIST_FILE = "LetterPressExplosion/LetterPressExplosion-Info.plist"; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | WRAPPER_EXTENSION = app; 437 | }; 438 | name = Debug; 439 | }; 440 | 6C037AEB1704A960001FF084 /* Release */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 444 | GCC_PREFIX_HEADER = "LetterPressExplosion/LetterPressExplosion-Prefix.pch"; 445 | INFOPLIST_FILE = "LetterPressExplosion/LetterPressExplosion-Info.plist"; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | WRAPPER_EXTENSION = app; 448 | }; 449 | name = Release; 450 | }; 451 | 6C037AED1704A960001FF084 /* Debug */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LetterPressExplosion.app/LetterPressExplosion"; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 457 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 458 | "$(inherited)", 459 | ); 460 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 461 | GCC_PREFIX_HEADER = "LetterPressExplosion/LetterPressExplosion-Prefix.pch"; 462 | INFOPLIST_FILE = "LetterPressExplosionTests/LetterPressExplosionTests-Info.plist"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUNDLE_LOADER)"; 465 | }; 466 | name = Debug; 467 | }; 468 | 6C037AEE1704A960001FF084 /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LetterPressExplosion.app/LetterPressExplosion"; 472 | FRAMEWORK_SEARCH_PATHS = ( 473 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 474 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 475 | "$(inherited)", 476 | ); 477 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 478 | GCC_PREFIX_HEADER = "LetterPressExplosion/LetterPressExplosion-Prefix.pch"; 479 | INFOPLIST_FILE = "LetterPressExplosionTests/LetterPressExplosionTests-Info.plist"; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TEST_HOST = "$(BUNDLE_LOADER)"; 482 | }; 483 | name = Release; 484 | }; 485 | /* End XCBuildConfiguration section */ 486 | 487 | /* Begin XCConfigurationList section */ 488 | 6C037AA91704A960001FF084 /* Build configuration list for PBXProject "LetterPressExplosion" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | 6C037AE71704A960001FF084 /* Debug */, 492 | 6C037AE81704A960001FF084 /* Release */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | 6C037AE91704A960001FF084 /* Build configuration list for PBXNativeTarget "LetterPressExplosion" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 6C037AEA1704A960001FF084 /* Debug */, 501 | 6C037AEB1704A960001FF084 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | 6C037AEC1704A960001FF084 /* Build configuration list for PBXNativeTarget "LetterPressExplosionTests" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 6C037AED1704A960001FF084 /* Debug */, 510 | 6C037AEE1704A960001FF084 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 6C037AA61704A960001FF084 /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Assets/letterpress@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vibrazy/letterpressexplosion/2bd6af796d0a487eb2e992e90a12452443eebd80/LetterPressExplosion/LetterPressExplosion/Assets/letterpress@2x.png -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Categories/UIView+Explode.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+CoreAnimation.h 3 | // CoreAnimationPlayGround 4 | // 5 | // Created by Daniel Tavares on 27/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | 14 | typedef void(^ExplodeCompletion)(void); 15 | 16 | @interface UIView (Explode) 17 | 18 | @property (nonatomic, copy) ExplodeCompletion completionCallback; 19 | 20 | - (void)lp_explode; 21 | - (void)lp_explodeWithCallback:(ExplodeCompletion)callback; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Categories/UIView+Explode.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+CoreAnimation.m 3 | // CoreAnimationPlayGround 4 | // 5 | // Created by Daniel Tavares on 27/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | 10 | #import "UIView+Explode.h" 11 | 12 | @interface LPParticleLayer : CALayer 13 | 14 | @property (nonatomic, strong) UIBezierPath *particlePath; 15 | 16 | @end 17 | 18 | 19 | @implementation UIView (Explode) 20 | 21 | @dynamic completionCallback; 22 | 23 | - (void)setCompletionCallback:(ExplodeCompletion)completionCallback 24 | { 25 | [self willChangeValueForKey:@"completionCallback"]; 26 | objc_setAssociatedObject(self, @selector(completionCallback), completionCallback, OBJC_ASSOCIATION_COPY_NONATOMIC); 27 | [self didChangeValueForKey:@"completionCallback"]; 28 | } 29 | 30 | - (ExplodeCompletion)completionCallback 31 | { 32 | // obj assoc 33 | id object = objc_getAssociatedObject(self,@selector(completionCallback)); 34 | return object; 35 | } 36 | 37 | 38 | float randomFloat() 39 | { 40 | return (float)rand()/(float)RAND_MAX; 41 | } 42 | 43 | - (UIImage *)imageFromLayer:(CALayer *)layer 44 | { 45 | UIGraphicsBeginImageContext([layer frame].size); 46 | 47 | [layer renderInContext:UIGraphicsGetCurrentContext()]; 48 | UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); 49 | 50 | UIGraphicsEndImageContext(); 51 | 52 | return outputImage; 53 | } 54 | 55 | - (void)lp_explodeWithCallback:(ExplodeCompletion)callback 56 | { 57 | 58 | self.userInteractionEnabled = NO; 59 | 60 | if (callback) 61 | { 62 | self.completionCallback = callback; 63 | } 64 | 65 | float size = self.frame.size.width/5; 66 | CGSize imageSize = CGSizeMake(size, size); 67 | 68 | CGFloat cols = self.frame.size.width / imageSize.width ; 69 | CGFloat rows = self.frame.size.height /imageSize.height; 70 | 71 | int fullColumns = floorf(cols); 72 | int fullRows = floorf(rows); 73 | 74 | CGFloat remainderWidth = self.frame.size.width - 75 | (fullColumns * imageSize.width); 76 | CGFloat remainderHeight = self.frame.size.height - 77 | (fullRows * imageSize.height ); 78 | 79 | 80 | if (cols > fullColumns) fullColumns++; 81 | if (rows > fullRows) fullRows++; 82 | 83 | CGRect originalFrame = self.layer.frame; 84 | CGRect originalBounds = self.layer.bounds; 85 | 86 | 87 | CGImageRef fullImage = [self imageFromLayer:self.layer].CGImage; 88 | 89 | //if its an image, set it to nil 90 | if ([self isKindOfClass:[UIImageView class]]) 91 | { 92 | [(UIImageView*)self setImage:nil]; 93 | } 94 | 95 | [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; 96 | [[self.layer sublayers] makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; 97 | 98 | for (int y = 0; y < fullRows; ++y) 99 | { 100 | for (int x = 0; x < fullColumns; ++x) 101 | { 102 | CGSize tileSize = imageSize; 103 | 104 | if (x + 1 == fullColumns && remainderWidth > 0) 105 | { 106 | // Last column 107 | tileSize.width = remainderWidth; 108 | } 109 | if (y + 1 == fullRows && remainderHeight > 0) 110 | { 111 | // Last row 112 | tileSize.height = remainderHeight; 113 | } 114 | 115 | CGRect layerRect = (CGRect){{x*imageSize.width, y*imageSize.height}, 116 | tileSize}; 117 | 118 | CGImageRef tileImage = CGImageCreateWithImageInRect(fullImage,layerRect); 119 | 120 | LPParticleLayer *layer = [LPParticleLayer layer]; 121 | layer.frame = layerRect; 122 | layer.contents = (__bridge id)(tileImage); 123 | layer.borderWidth = 0.0f; 124 | layer.borderColor = [UIColor blackColor].CGColor; 125 | layer.particlePath = [self pathForLayer:layer parentRect:originalFrame]; 126 | [self.layer addSublayer:layer]; 127 | 128 | CGImageRelease(tileImage); 129 | } 130 | } 131 | 132 | [self.layer setFrame:originalFrame]; 133 | [self.layer setBounds:originalBounds]; 134 | 135 | 136 | self.layer.backgroundColor = [UIColor clearColor].CGColor; 137 | 138 | NSArray *sublayersArray = [self.layer sublayers]; 139 | [sublayersArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 140 | 141 | LPParticleLayer *layer = (LPParticleLayer *)obj; 142 | 143 | //Path 144 | CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 145 | moveAnim.path = layer.particlePath.CGPath; 146 | moveAnim.removedOnCompletion = YES; 147 | moveAnim.fillMode=kCAFillModeForwards; 148 | NSArray *timingFunctions = [NSArray arrayWithObjects:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut],nil]; 149 | [moveAnim setTimingFunctions:timingFunctions]; 150 | 151 | float r = randomFloat(); 152 | 153 | NSTimeInterval speed = 2.35*r; 154 | 155 | CAKeyframeAnimation *transformAnim = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 156 | 157 | CATransform3D startingScale = layer.transform; 158 | CATransform3D endingScale = CATransform3DConcat(CATransform3DMakeScale(randomFloat(), randomFloat(), randomFloat()), CATransform3DMakeRotation(M_PI*(1+randomFloat()), randomFloat(), randomFloat(), randomFloat())); 159 | 160 | NSArray *boundsValues = [NSArray arrayWithObjects:[NSValue valueWithCATransform3D:startingScale], 161 | 162 | [NSValue valueWithCATransform3D:endingScale], nil]; 163 | [transformAnim setValues:boundsValues]; 164 | 165 | NSArray *times = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0], 166 | [NSNumber numberWithFloat:speed*.25], nil]; 167 | [transformAnim setKeyTimes:times]; 168 | 169 | 170 | timingFunctions = [NSArray arrayWithObjects:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut], 171 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn], 172 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 173 | nil]; 174 | [transformAnim setTimingFunctions:timingFunctions]; 175 | transformAnim.fillMode = kCAFillModeForwards; 176 | transformAnim.removedOnCompletion = NO; 177 | 178 | //alpha 179 | CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"opacity"]; 180 | opacityAnim.fromValue = [NSNumber numberWithFloat:1.0f]; 181 | opacityAnim.toValue = [NSNumber numberWithFloat:0.f]; 182 | opacityAnim.removedOnCompletion = NO; 183 | opacityAnim.fillMode =kCAFillModeForwards; 184 | 185 | 186 | CAAnimationGroup *animGroup = [CAAnimationGroup animation]; 187 | animGroup.animations = [NSArray arrayWithObjects:moveAnim,transformAnim,opacityAnim, nil]; 188 | animGroup.duration = speed; 189 | animGroup.fillMode =kCAFillModeForwards; 190 | animGroup.delegate = self; 191 | [animGroup setValue:layer forKey:@"animationLayer"]; 192 | [layer addAnimation:animGroup forKey:nil]; 193 | 194 | //take it off screen 195 | [layer setPosition:CGPointMake(0, -600)]; 196 | 197 | }]; 198 | } 199 | 200 | - (void)lp_explode 201 | { 202 | [self lp_explodeWithCallback:nil]; 203 | } 204 | 205 | 206 | - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag 207 | { 208 | LPParticleLayer *layer = [theAnimation valueForKey:@"animationLayer"]; 209 | 210 | if (layer) 211 | { 212 | //make sure we dont have any more 213 | if ([[self.layer sublayers] count]==1) 214 | { 215 | if (self.completionCallback) 216 | { 217 | self.completionCallback(); 218 | } 219 | [self removeFromSuperview]; 220 | 221 | } 222 | else 223 | { 224 | [layer removeFromSuperlayer]; 225 | } 226 | } 227 | } 228 | 229 | -(UIBezierPath *)pathForLayer:(CALayer *)layer parentRect:(CGRect)rect 230 | { 231 | UIBezierPath *particlePath = [UIBezierPath bezierPath]; 232 | [particlePath moveToPoint:layer.position]; 233 | 234 | float r = ((float)rand()/(float)RAND_MAX) + 0.3f; 235 | float r2 = ((float)rand()/(float)RAND_MAX)+ 0.4f; 236 | float r3 = r*r2; 237 | 238 | int upOrDown = (r <= 0.5) ? 1 : -1; 239 | 240 | CGPoint curvePoint = CGPointZero; 241 | CGPoint endPoint = CGPointZero; 242 | 243 | float maxLeftRightShift = 1.f * randomFloat(); 244 | 245 | CGFloat layerYPosAndHeight = (self.superview.frame.size.height-((layer.position.y+layer.frame.size.height)))*randomFloat(); 246 | CGFloat layerXPosAndHeight = (self.superview.frame.size.width-((layer.position.x+layer.frame.size.width)))*r3; 247 | 248 | float endY = self.superview.frame.size.height-self.frame.origin.y; 249 | 250 | if (layer.position.x <= rect.size.width*0.5) 251 | { 252 | //going left 253 | endPoint = CGPointMake(-layerXPosAndHeight, endY); 254 | curvePoint= CGPointMake((((layer.position.x*0.5)*r3)*upOrDown)*maxLeftRightShift,-layerYPosAndHeight); 255 | } 256 | else 257 | { 258 | endPoint = CGPointMake(layerXPosAndHeight, endY); 259 | curvePoint= CGPointMake((((layer.position.x*0.5)*r3)*upOrDown+rect.size.width)*maxLeftRightShift, -layerYPosAndHeight); 260 | } 261 | 262 | [particlePath addQuadCurveToPoint:endPoint 263 | controlPoint:curvePoint]; 264 | 265 | return particlePath; 266 | 267 | } 268 | 269 | @end 270 | 271 | @implementation LPParticleLayer 272 | 273 | @end 274 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/DTVAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTVAppDelegate.h 3 | // LetterPressExplosion 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DTVViewController; 12 | 13 | @interface DTVAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) DTVViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/DTVAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // DTVAppDelegate.m 3 | // LetterPressExplosion 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import "DTVAppDelegate.h" 10 | 11 | #import "DTVViewController.h" 12 | 13 | @implementation DTVAppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 20 | self.viewController = [[DTVViewController alloc] initWithNibName:@"DTVViewController_iPhone" bundle:nil]; 21 | } else { 22 | self.viewController = [[DTVViewController alloc] initWithNibName:@"DTVViewController_iPad" bundle:nil]; 23 | } 24 | self.window.rootViewController = self.viewController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | // 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. 32 | // 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. 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | // 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. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application 42 | { 43 | // 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. 44 | } 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application 47 | { 48 | // 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. 49 | } 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application 52 | { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/DTVViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTVViewController.h 3 | // LetterPressExplosion 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DTVViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/DTVViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DTVViewController.m 3 | // LetterPressExplosion 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import "DTVViewController.h" 10 | #import "UIView+Explode.h" 11 | #import "objc/runtime.h" 12 | 13 | typedef void(^GESTURE_Tapped)(void); 14 | static NSString *GESTURE_BLOCK = @"GESTURE_BLOCK"; 15 | 16 | @interface UIView (PrivateExtensions) 17 | 18 | -(void)setTappedGestureWithBlock:(GESTURE_Tapped)block; 19 | 20 | @end 21 | 22 | @implementation DTVViewController 23 | 24 | - (void)viewDidLoad 25 | { 26 | [super viewDidLoad]; 27 | // Do any additional setup after loading the view, typically from a nib. 28 | [self.view setBackgroundColor:[UIColor blackColor]]; 29 | 30 | [self createLetterPressImages]; 31 | 32 | __unsafe_unretained typeof(self) weakSelf = self; 33 | // Do any additional setup after loading the view, typically from a nib. 34 | [self.view setTappedGestureWithBlock:^{ 35 | [weakSelf createLetterPressImages]; 36 | }]; 37 | 38 | UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight]; 39 | CGRect frame = button.frame; 40 | frame.origin.x = self.view.bounds.size.width * 0.5; 41 | frame.origin.y = 200; 42 | button.frame = frame; 43 | [self.view addSubview:button]; 44 | 45 | [button addTarget:self action:@selector(explodeMe:) forControlEvents:UIControlEventTouchUpInside]; 46 | } 47 | 48 | - (void)explodeMe:(id)sender 49 | { 50 | [sender lp_explodeWithCallback:^{ 51 | NSLog(@"call back"); 52 | }]; 53 | } 54 | 55 | -(void)createLetterPressImages 56 | { 57 | UIImage *letterPressImage = [UIImage imageNamed:@"letterpress.png"]; 58 | UIImageView *imgV = [[UIImageView alloc] initWithImage:letterPressImage]; 59 | [imgV setContentMode:UIViewContentModeScaleAspectFit]; 60 | [imgV setCenter:self.view.center]; 61 | 62 | __unsafe_unretained typeof(imgV) weakSelf = imgV; 63 | [self.view addSubview:imgV]; 64 | 65 | [imgV setTappedGestureWithBlock:^{ 66 | [weakSelf lp_explodeWithCallback:^{ 67 | NSLog(@"callback"); 68 | }]; 69 | [weakSelf setTappedGestureWithBlock:nil]; 70 | }]; 71 | } 72 | 73 | 74 | @end 75 | 76 | @implementation UIView (PrivateExtensions) 77 | 78 | -(void)setTappedGestureWithBlock:(GESTURE_Tapped)block 79 | { 80 | self.userInteractionEnabled = YES; 81 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; 82 | tap.numberOfTapsRequired=1; 83 | [self addGestureRecognizer:tap]; 84 | 85 | objc_setAssociatedObject(self,&GESTURE_BLOCK,block, OBJC_ASSOCIATION_COPY); 86 | } 87 | 88 | -(void)tapped:(UIGestureRecognizer *)gesture 89 | { 90 | if (gesture.state==UIGestureRecognizerStateEnded) 91 | { 92 | GESTURE_Tapped block = (GESTURE_Tapped)objc_getAssociatedObject(self, &GESTURE_BLOCK); 93 | 94 | if (block) 95 | { 96 | block(); 97 | block = nil; 98 | } 99 | } 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vibrazy/letterpressexplosion/2bd6af796d0a487eb2e992e90a12452443eebd80/LetterPressExplosion/LetterPressExplosion/Default-568h@2x.png -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vibrazy/letterpressexplosion/2bd6af796d0a487eb2e992e90a12452443eebd80/LetterPressExplosion/LetterPressExplosion/Default.png -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vibrazy/letterpressexplosion/2bd6af796d0a487eb2e992e90a12452443eebd80/LetterPressExplosion/LetterPressExplosion/Default@2x.png -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/LetterPressExplosion-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.rafflepixel.letterexplosion.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/LetterPressExplosion-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LetterPressExplosion' target in the 'LetterPressExplosion' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/en.lproj/DTVViewController_iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A206j 6 | 2519 7 | 1172.1 8 | 613.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1856 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBIPadFramework 28 | 29 | 30 | IBFirstResponder 31 | IBIPadFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {768, 1004}} 37 | 38 | 39 | 40 | 3 41 | MQA 42 | 43 | 2 44 | 45 | 46 | 47 | 2 48 | 49 | IBIPadFramework 50 | 51 | 52 | 53 | 54 | 55 | 56 | view 57 | 58 | 59 | 60 | 3 61 | 62 | 63 | 64 | 65 | 66 | 0 67 | 68 | 69 | 70 | 71 | 72 | -1 73 | 74 | 75 | File's Owner 76 | 77 | 78 | -2 79 | 80 | 81 | 82 | 83 | 2 84 | 85 | 86 | 87 | 88 | 89 | 90 | DTVViewController 91 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 92 | UIResponder 93 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 94 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 95 | 96 | 97 | 98 | 99 | 100 | 3 101 | 102 | 103 | 104 | 105 | DTVViewController 106 | UIViewController 107 | 108 | IBProjectSource 109 | ./Classes/DTVViewController.h 110 | 111 | 112 | 113 | 114 | 0 115 | IBIPadFramework 116 | YES 117 | 3 118 | YES 119 | 1856 120 | 121 | 122 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/en.lproj/DTVViewController_iPhone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A269 6 | 2835 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1919 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 548}} 37 | 38 | 39 | 40 | 41 | 3 42 | MC43NQA 43 | 44 | 2 45 | 46 | 47 | NO 48 | 49 | 50 | IBUIScreenMetrics 51 | 52 | YES 53 | 54 | 55 | 56 | 57 | 58 | {320, 568} 59 | {568, 320} 60 | 61 | 62 | IBCocoaTouchFramework 63 | Retina 4 Full Screen 64 | 2 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 71 | 72 | 73 | view 74 | 75 | 76 | 77 | 7 78 | 79 | 80 | 81 | 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | -1 90 | 91 | 92 | File's Owner 93 | 94 | 95 | -2 96 | 97 | 98 | 99 | 100 | 6 101 | 102 | 103 | 104 | 105 | 106 | 107 | DTVViewController 108 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 109 | UIResponder 110 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 111 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 112 | 113 | 114 | 115 | 116 | 117 | 7 118 | 119 | 120 | 121 | 122 | DTVViewController 123 | UIViewController 124 | 125 | IBProjectSource 126 | ./Classes/DTVViewController.h 127 | 128 | 129 | 130 | 131 | 0 132 | IBCocoaTouchFramework 133 | YES 134 | 3 135 | YES 136 | 1919 137 | 138 | 139 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosion/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LetterPressExplosion 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "DTVAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([DTVAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosionTests/LetterPressExplosionTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.rafflepixel.letterexplosion.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosionTests/LetterPressExplosionTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // LetterPressExplosionTests.h 3 | // LetterPressExplosionTests 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LetterPressExplosionTests : XCTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosionTests/LetterPressExplosionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LetterPressExplosionTests.m 3 | // LetterPressExplosionTests 4 | // 5 | // Created by Daniel Tavares on 28/03/2013. 6 | // Copyright (c) 2013 Daniel Tavares. All rights reserved. 7 | // 8 | 9 | #import "LetterPressExplosionTests.h" 10 | #import "UIView+Explode.h" 11 | @implementation LetterPressExplosionTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testButton 28 | { 29 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; 30 | [view lp_explodeWithCallback:^{ 31 | NSLog(@"callback"); 32 | }]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /LetterPressExplosion/LetterPressExplosionTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LetterpressExplosion.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "LetterpressExplosion" 3 | s.version = "1.0" 4 | s.summary = "Category on `UIView` called Explode that will take the uiview and explode it into pieces." 5 | s.homepage = "https://github.com/vibrazy/letterpressexplosion" 6 | s.license = { :type => 'MIT', :file => 'LICENSE' } 7 | s.author = 'Daniel Tavares' 8 | s.source = { :git => "https://github.com/vibrazy/letterpressexplosion.git", :tag => '1.0' } 9 | s.platform = :ios, '6.0' 10 | s.source_files = 'LetterPressExplosion/LetterPressExplosion/Categories/**/*.{h,m}' 11 | s.public_header_files = 'LetterPressExplosion/LetterPressExplosion/Categories/**/*.{h,m}' 12 | # s.frameworks = 'UIKit', 'QuartzCore' 13 | s.requires_arc = true 14 | end 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Letterpress-like explosion. 2 | 3 | Category on `UIView` called Explode that will take the uiview and explode it into pieces. 4 | 5 | [myView lp_explode]; 6 | 7 | Not exactly the same as letterpress but will point people to the right direction. 8 | --------------------------------------------------------------------------------