├── 342.gif ├── Asset ├── BG.png ├── BG@2x.png ├── L1.png ├── L1@2x.png ├── L2.png ├── L2@2x.png ├── L345.png ├── L345@2x.png ├── Parcitle2.ped ├── Triangle 1.png ├── Xerlee.sketch ├── icns │ ├── Icon-29.png │ ├── Icon-29@2x.png │ ├── Icon-29@3x.png │ ├── Icon-40.png │ ├── Icon-40@2x.png │ ├── Icon-40@3x.png │ ├── Icon-60@2x.png │ ├── Icon-60@3x.png │ ├── Icon-76.png │ ├── Icon-76@2x.png │ └── iTunesArtwork@2x.png └── particle.ped ├── README.md ├── XerLee Test.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── XerLee Test.xccheckout │ └── xcuserdata │ │ └── MartinRGB.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── MartinRGB.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── XerLee Test.xcscheme │ └── xcschememanagement.plist ├── XerLee Test ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-29@2x.png │ │ ├── Icon-29@3x.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-40@3x.png │ │ ├── Icon-60@2x.png │ │ └── Icon-60@3x.png │ ├── BG.imageset │ │ ├── BG.png │ │ ├── BG@2x.png │ │ └── Contents.json │ ├── L1.imageset │ │ ├── Contents.json │ │ ├── L1.png │ │ └── L1@2x.png │ ├── L2.imageset │ │ ├── Contents.json │ │ ├── L2.png │ │ └── L2@2x.png │ └── L345.imageset │ │ ├── Contents.json │ │ ├── L345.png │ │ └── L345@2x.png ├── Info.plist ├── NSData+Base64.h ├── NSData+Base64.m ├── UIEffectDesignerView.h ├── UIEffectDesignerView.m ├── ViewController.h ├── ViewController.m └── main.m └── XerLee TestTests ├── Info.plist └── XerLee_TestTests.m /342.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/342.gif -------------------------------------------------------------------------------- /Asset/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/BG.png -------------------------------------------------------------------------------- /Asset/BG@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/BG@2x.png -------------------------------------------------------------------------------- /Asset/L1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L1.png -------------------------------------------------------------------------------- /Asset/L1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L1@2x.png -------------------------------------------------------------------------------- /Asset/L2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L2.png -------------------------------------------------------------------------------- /Asset/L2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L2@2x.png -------------------------------------------------------------------------------- /Asset/L345.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L345.png -------------------------------------------------------------------------------- /Asset/L345@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/L345@2x.png -------------------------------------------------------------------------------- /Asset/Parcitle2.ped: -------------------------------------------------------------------------------- 1 | {"latitude":0,"alphaSpeed":0,"scaleSpeed":0,"blueRange":0.33,"width":286,"texture":"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAA\r\nAGVJREFUGBltjYENwCAIBIF0r9qNGKGbdTPTvvEN\/WhC0Oc4zeRkZkNJbIcG7n7P\r\nrNVZ1AdMH3ii1PoDi83qHbIF0sYf1LpANWChZgNU2846wLpJiJ0zhy0iHg52vfd+\r\nBTd2ADMwLwRSGIvnuSGxAAAAAElFTkSuQmCC","spinRange":0,"lifetime":0.6,"greenSpeed":0,"aux3":null,"emitterType":0,"version":0.1,"zAcceleration":0,"velocity":100,"velocityRange":150,"previewRect":"{{630, 427}, {320, 480}}","yAcceleration":-213,"redRange":0.33,"longitude":0,"height":80,"emitterMode":0,"xAcceleration":0,"color":"#FFFEFE","alpha":1,"blueSpeed":0,"spin":0,"alphaRange":0,"scaleRange":0.5,"lifetimeRange":2,"aux1":null,"redSpeed":0,"greenRange":0.33,"birthRate":380,"x":0,"scale":0.5,"y":140,"aux2":null} -------------------------------------------------------------------------------- /Asset/Triangle 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/Triangle 1.png -------------------------------------------------------------------------------- /Asset/Xerlee.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/Xerlee.sketch -------------------------------------------------------------------------------- /Asset/icns/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-29.png -------------------------------------------------------------------------------- /Asset/icns/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-29@2x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-29@3x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-40.png -------------------------------------------------------------------------------- /Asset/icns/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-40@2x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-40@3x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-60@2x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-60@3x.png -------------------------------------------------------------------------------- /Asset/icns/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-76.png -------------------------------------------------------------------------------- /Asset/icns/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/Icon-76@2x.png -------------------------------------------------------------------------------- /Asset/icns/iTunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/Asset/icns/iTunesArtwork@2x.png -------------------------------------------------------------------------------- /Asset/particle.ped: -------------------------------------------------------------------------------- 1 | {"latitude":0,"alphaSpeed":0,"scaleSpeed":0,"blueRange":0.33,"width":40,"texture":"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAA\r\nAGVJREFUGBltjYENwCAIBIF0r9qNGKGbdTPTvvEN\/WhC0Oc4zeRkZkNJbIcG7n7P\r\nrNVZ1AdMH3ii1PoDi83qHbIF0sYf1LpANWChZgNU2846wLpJiJ0zhy0iHg52vfd+\r\nBTd2ADMwLwRSGIvnuSGxAAAAAElFTkSuQmCC","spinRange":0,"lifetime":5,"greenSpeed":0,"aux3":null,"emitterType":0,"version":0.1,"zAcceleration":0,"velocity":200,"velocityRange":150,"previewRect":"{{630, 427}, {320, 480}}","yAcceleration":2000,"redRange":0.33,"longitude":0,"height":80,"emitterMode":0,"xAcceleration":0,"color":"#FFFFFF","alpha":0.5,"blueSpeed":0,"spin":0,"alphaRange":0,"scaleRange":0.5,"lifetimeRange":2,"aux1":null,"redSpeed":0,"greenRange":0.33,"birthRate":10,"x":260,"scale":0.5,"y":144,"aux2":null} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Maetrial Design Delete Concept Implement 2 | 3 | ###Android Version [here](https://github.com/ZhaoKaiQiang/ParticleLayout/) 4 | 5 | Bug List: 6 | 7 | 1.Mask & Particle跟手动画中,Mask不跟手 8 | 9 | 2.手势停止后,应该停止生成粒子 10 | 11 | 3.某些情况下,判定Mask右滑距离错误 12 | 13 | 4.应该自动生成Box,Delete & Refresh 14 | 15 | 帮助同事实现动画效果,本人同为设计师,辛苦啃iOS中,很菜,可能动画效果的调节比较擅长,然而基础不牢,很多地方一次性效果。望各位不吝赐教。 16 | 17 | 这个效果在iPhone模拟器中模拟效果并不好,然而按设计者,也就是我同事的本意来说,人机交互是手指和屏幕共同作用,当手指触摸在屏幕上,自然遮挡住了看似不佳的效果 18 | 19 | 另:这是iOS实现,非安卓 20 | 21 | A simple implement of my workmate Xerlee's [animation concept](https://dribbble.com/shots/2245626-Material-Design-Delete)' on iOS. 22 | 23 | Though we both are Motion Designer,but I'm always amazing by his design concept. 24 | 25 | So I decide to simple implement this animation.() 26 | 27 | By the way,[UIEffectDesigner](https://github.com/icanzilb/UIEffectDesignerView) is used in this project & very useful,thank to the author! 28 | 29 | ![Xerlee's design](https://d13yacurqjgara.cloudfront.net/users/747857/screenshots/2245626/____.gif?raw=true) 30 | 31 | Xerlee's Design 32 | 33 | ![Implement Effect](https://github.com/MartinRGB/MTMaterialDelete/blob/master/342.gif?raw=true) 34 | 35 | My Code Effect 36 | 37 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2EA3A46A1BA89B43005C99B1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A4691BA89B43005C99B1 /* main.m */; }; 11 | 2EA3A46D1BA89B43005C99B1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A46C1BA89B43005C99B1 /* AppDelegate.m */; }; 12 | 2EA3A4701BA89B43005C99B1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A46F1BA89B43005C99B1 /* ViewController.m */; }; 13 | 2EA3A4731BA89B43005C99B1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2EA3A4711BA89B43005C99B1 /* Main.storyboard */; }; 14 | 2EA3A4751BA89B43005C99B1 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2EA3A4741BA89B43005C99B1 /* Images.xcassets */; }; 15 | 2EA3A4781BA89B43005C99B1 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2EA3A4761BA89B43005C99B1 /* LaunchScreen.xib */; }; 16 | 2EA3A4841BA89B43005C99B1 /* XerLee_TestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A4831BA89B43005C99B1 /* XerLee_TestTests.m */; }; 17 | 2EA3A4901BA8A7B6005C99B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EA3A48F1BA8A7B6005C99B1 /* QuartzCore.framework */; }; 18 | 2EA3A4931BA8A7FE005C99B1 /* UIEffectDesignerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A4921BA8A7FE005C99B1 /* UIEffectDesignerView.m */; }; 19 | 2EA3A4961BA8A8AE005C99B1 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EA3A4951BA8A8AE005C99B1 /* NSData+Base64.m */; }; 20 | 2EA3A4991BA8A951005C99B1 /* particle.ped in Resources */ = {isa = PBXBuildFile; fileRef = 2EA3A4981BA8A951005C99B1 /* particle.ped */; }; 21 | 2EA3A49B1BA8ACA1005C99B1 /* Parcitle2.ped in Resources */ = {isa = PBXBuildFile; fileRef = 2EA3A49A1BA8ACA1005C99B1 /* Parcitle2.ped */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 2EA3A47E1BA89B43005C99B1 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 2EA3A45C1BA89B43005C99B1 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 2EA3A4631BA89B43005C99B1; 30 | remoteInfo = "XerLee Test"; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 2EA3A4641BA89B43005C99B1 /* XerLee Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "XerLee Test.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 2EA3A4681BA89B43005C99B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 2EA3A4691BA89B43005C99B1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 2EA3A46B1BA89B43005C99B1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 2EA3A46C1BA89B43005C99B1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 2EA3A46E1BA89B43005C99B1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 41 | 2EA3A46F1BA89B43005C99B1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 42 | 2EA3A4721BA89B43005C99B1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | 2EA3A4741BA89B43005C99B1 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 44 | 2EA3A4771BA89B43005C99B1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 45 | 2EA3A47D1BA89B43005C99B1 /* XerLee TestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "XerLee TestTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 2EA3A4821BA89B43005C99B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 2EA3A4831BA89B43005C99B1 /* XerLee_TestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XerLee_TestTests.m; sourceTree = ""; }; 48 | 2EA3A48F1BA8A7B6005C99B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 49 | 2EA3A4911BA8A7FE005C99B1 /* UIEffectDesignerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEffectDesignerView.h; sourceTree = ""; }; 50 | 2EA3A4921BA8A7FE005C99B1 /* UIEffectDesignerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIEffectDesignerView.m; sourceTree = ""; }; 51 | 2EA3A4941BA8A8AE005C99B1 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = ""; }; 52 | 2EA3A4951BA8A8AE005C99B1 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = ""; }; 53 | 2EA3A4981BA8A951005C99B1 /* particle.ped */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = particle.ped; path = Asset/particle.ped; sourceTree = SOURCE_ROOT; }; 54 | 2EA3A49A1BA8ACA1005C99B1 /* Parcitle2.ped */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Parcitle2.ped; path = Asset/Parcitle2.ped; sourceTree = SOURCE_ROOT; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 2EA3A4611BA89B43005C99B1 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 2EA3A4901BA8A7B6005C99B1 /* QuartzCore.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 2EA3A47A1BA89B43005C99B1 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 2EA3A45B1BA89B43005C99B1 = { 77 | isa = PBXGroup; 78 | children = ( 79 | 2EA3A48F1BA8A7B6005C99B1 /* QuartzCore.framework */, 80 | 2EA3A4661BA89B43005C99B1 /* XerLee Test */, 81 | 2EA3A4801BA89B43005C99B1 /* XerLee TestTests */, 82 | 2EA3A4651BA89B43005C99B1 /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 2EA3A4651BA89B43005C99B1 /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 2EA3A4641BA89B43005C99B1 /* XerLee Test.app */, 90 | 2EA3A47D1BA89B43005C99B1 /* XerLee TestTests.xctest */, 91 | ); 92 | name = Products; 93 | sourceTree = ""; 94 | }; 95 | 2EA3A4661BA89B43005C99B1 /* XerLee Test */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 2EA3A46B1BA89B43005C99B1 /* AppDelegate.h */, 99 | 2EA3A46C1BA89B43005C99B1 /* AppDelegate.m */, 100 | 2EA3A46E1BA89B43005C99B1 /* ViewController.h */, 101 | 2EA3A46F1BA89B43005C99B1 /* ViewController.m */, 102 | 2EA3A4971BA8A8B7005C99B1 /* Particle */, 103 | 2EA3A4711BA89B43005C99B1 /* Main.storyboard */, 104 | 2EA3A4741BA89B43005C99B1 /* Images.xcassets */, 105 | 2EA3A4761BA89B43005C99B1 /* LaunchScreen.xib */, 106 | 2EA3A4671BA89B43005C99B1 /* Supporting Files */, 107 | ); 108 | path = "XerLee Test"; 109 | sourceTree = ""; 110 | }; 111 | 2EA3A4671BA89B43005C99B1 /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 2EA3A4681BA89B43005C99B1 /* Info.plist */, 115 | 2EA3A4691BA89B43005C99B1 /* main.m */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 2EA3A4801BA89B43005C99B1 /* XerLee TestTests */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 2EA3A4831BA89B43005C99B1 /* XerLee_TestTests.m */, 124 | 2EA3A4811BA89B43005C99B1 /* Supporting Files */, 125 | ); 126 | path = "XerLee TestTests"; 127 | sourceTree = ""; 128 | }; 129 | 2EA3A4811BA89B43005C99B1 /* Supporting Files */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 2EA3A4821BA89B43005C99B1 /* Info.plist */, 133 | ); 134 | name = "Supporting Files"; 135 | sourceTree = ""; 136 | }; 137 | 2EA3A4971BA8A8B7005C99B1 /* Particle */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 2EA3A4941BA8A8AE005C99B1 /* NSData+Base64.h */, 141 | 2EA3A4951BA8A8AE005C99B1 /* NSData+Base64.m */, 142 | 2EA3A4911BA8A7FE005C99B1 /* UIEffectDesignerView.h */, 143 | 2EA3A4921BA8A7FE005C99B1 /* UIEffectDesignerView.m */, 144 | 2EA3A4981BA8A951005C99B1 /* particle.ped */, 145 | 2EA3A49A1BA8ACA1005C99B1 /* Parcitle2.ped */, 146 | ); 147 | name = Particle; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 2EA3A4631BA89B43005C99B1 /* XerLee Test */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 2EA3A4871BA89B43005C99B1 /* Build configuration list for PBXNativeTarget "XerLee Test" */; 156 | buildPhases = ( 157 | 2EA3A4601BA89B43005C99B1 /* Sources */, 158 | 2EA3A4611BA89B43005C99B1 /* Frameworks */, 159 | 2EA3A4621BA89B43005C99B1 /* Resources */, 160 | ); 161 | buildRules = ( 162 | ); 163 | dependencies = ( 164 | ); 165 | name = "XerLee Test"; 166 | productName = "XerLee Test"; 167 | productReference = 2EA3A4641BA89B43005C99B1 /* XerLee Test.app */; 168 | productType = "com.apple.product-type.application"; 169 | }; 170 | 2EA3A47C1BA89B43005C99B1 /* XerLee TestTests */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 2EA3A48A1BA89B43005C99B1 /* Build configuration list for PBXNativeTarget "XerLee TestTests" */; 173 | buildPhases = ( 174 | 2EA3A4791BA89B43005C99B1 /* Sources */, 175 | 2EA3A47A1BA89B43005C99B1 /* Frameworks */, 176 | 2EA3A47B1BA89B43005C99B1 /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | 2EA3A47F1BA89B43005C99B1 /* PBXTargetDependency */, 182 | ); 183 | name = "XerLee TestTests"; 184 | productName = "XerLee TestTests"; 185 | productReference = 2EA3A47D1BA89B43005C99B1 /* XerLee TestTests.xctest */; 186 | productType = "com.apple.product-type.bundle.unit-test"; 187 | }; 188 | /* End PBXNativeTarget section */ 189 | 190 | /* Begin PBXProject section */ 191 | 2EA3A45C1BA89B43005C99B1 /* Project object */ = { 192 | isa = PBXProject; 193 | attributes = { 194 | LastUpgradeCheck = 0640; 195 | ORGANIZATIONNAME = KingMartin; 196 | TargetAttributes = { 197 | 2EA3A4631BA89B43005C99B1 = { 198 | CreatedOnToolsVersion = 6.4; 199 | }; 200 | 2EA3A47C1BA89B43005C99B1 = { 201 | CreatedOnToolsVersion = 6.4; 202 | TestTargetID = 2EA3A4631BA89B43005C99B1; 203 | }; 204 | }; 205 | }; 206 | buildConfigurationList = 2EA3A45F1BA89B43005C99B1 /* Build configuration list for PBXProject "XerLee Test" */; 207 | compatibilityVersion = "Xcode 3.2"; 208 | developmentRegion = English; 209 | hasScannedForEncodings = 0; 210 | knownRegions = ( 211 | en, 212 | Base, 213 | ); 214 | mainGroup = 2EA3A45B1BA89B43005C99B1; 215 | productRefGroup = 2EA3A4651BA89B43005C99B1 /* Products */; 216 | projectDirPath = ""; 217 | projectRoot = ""; 218 | targets = ( 219 | 2EA3A4631BA89B43005C99B1 /* XerLee Test */, 220 | 2EA3A47C1BA89B43005C99B1 /* XerLee TestTests */, 221 | ); 222 | }; 223 | /* End PBXProject section */ 224 | 225 | /* Begin PBXResourcesBuildPhase section */ 226 | 2EA3A4621BA89B43005C99B1 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | 2EA3A4731BA89B43005C99B1 /* Main.storyboard in Resources */, 231 | 2EA3A4781BA89B43005C99B1 /* LaunchScreen.xib in Resources */, 232 | 2EA3A4751BA89B43005C99B1 /* Images.xcassets in Resources */, 233 | 2EA3A49B1BA8ACA1005C99B1 /* Parcitle2.ped in Resources */, 234 | 2EA3A4991BA8A951005C99B1 /* particle.ped in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | 2EA3A47B1BA89B43005C99B1 /* Resources */ = { 239 | isa = PBXResourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | /* End PBXResourcesBuildPhase section */ 246 | 247 | /* Begin PBXSourcesBuildPhase section */ 248 | 2EA3A4601BA89B43005C99B1 /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 2EA3A4931BA8A7FE005C99B1 /* UIEffectDesignerView.m in Sources */, 253 | 2EA3A4701BA89B43005C99B1 /* ViewController.m in Sources */, 254 | 2EA3A4961BA8A8AE005C99B1 /* NSData+Base64.m in Sources */, 255 | 2EA3A46D1BA89B43005C99B1 /* AppDelegate.m in Sources */, 256 | 2EA3A46A1BA89B43005C99B1 /* main.m in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 2EA3A4791BA89B43005C99B1 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 2EA3A4841BA89B43005C99B1 /* XerLee_TestTests.m in Sources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXSourcesBuildPhase section */ 269 | 270 | /* Begin PBXTargetDependency section */ 271 | 2EA3A47F1BA89B43005C99B1 /* PBXTargetDependency */ = { 272 | isa = PBXTargetDependency; 273 | target = 2EA3A4631BA89B43005C99B1 /* XerLee Test */; 274 | targetProxy = 2EA3A47E1BA89B43005C99B1 /* PBXContainerItemProxy */; 275 | }; 276 | /* End PBXTargetDependency section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 2EA3A4711BA89B43005C99B1 /* Main.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 2EA3A4721BA89B43005C99B1 /* Base */, 283 | ); 284 | name = Main.storyboard; 285 | sourceTree = ""; 286 | }; 287 | 2EA3A4761BA89B43005C99B1 /* LaunchScreen.xib */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 2EA3A4771BA89B43005C99B1 /* Base */, 291 | ); 292 | name = LaunchScreen.xib; 293 | sourceTree = ""; 294 | }; 295 | /* End PBXVariantGroup section */ 296 | 297 | /* Begin XCBuildConfiguration section */ 298 | 2EA3A4851BA89B43005C99B1 /* Debug */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 303 | CLANG_CXX_LIBRARY = "libc++"; 304 | CLANG_ENABLE_MODULES = YES; 305 | CLANG_ENABLE_OBJC_ARC = YES; 306 | CLANG_WARN_BOOL_CONVERSION = YES; 307 | CLANG_WARN_CONSTANT_CONVERSION = YES; 308 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 309 | CLANG_WARN_EMPTY_BODY = YES; 310 | CLANG_WARN_ENUM_CONVERSION = YES; 311 | CLANG_WARN_INT_CONVERSION = YES; 312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 313 | CLANG_WARN_UNREACHABLE_CODE = YES; 314 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 315 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 316 | COPY_PHASE_STRIP = NO; 317 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 318 | ENABLE_STRICT_OBJC_MSGSEND = YES; 319 | GCC_C_LANGUAGE_STANDARD = gnu99; 320 | GCC_DYNAMIC_NO_PIC = NO; 321 | GCC_NO_COMMON_BLOCKS = YES; 322 | GCC_OPTIMIZATION_LEVEL = 0; 323 | GCC_PREPROCESSOR_DEFINITIONS = ( 324 | "DEBUG=1", 325 | "$(inherited)", 326 | ); 327 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 328 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 330 | GCC_WARN_UNDECLARED_SELECTOR = YES; 331 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 332 | GCC_WARN_UNUSED_FUNCTION = YES; 333 | GCC_WARN_UNUSED_VARIABLE = YES; 334 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 335 | MTL_ENABLE_DEBUG_INFO = YES; 336 | ONLY_ACTIVE_ARCH = YES; 337 | SDKROOT = iphoneos; 338 | TARGETED_DEVICE_FAMILY = "1,2"; 339 | }; 340 | name = Debug; 341 | }; 342 | 2EA3A4861BA89B43005C99B1 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 347 | CLANG_CXX_LIBRARY = "libc++"; 348 | CLANG_ENABLE_MODULES = YES; 349 | CLANG_ENABLE_OBJC_ARC = YES; 350 | CLANG_WARN_BOOL_CONVERSION = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 353 | CLANG_WARN_EMPTY_BODY = YES; 354 | CLANG_WARN_ENUM_CONVERSION = YES; 355 | CLANG_WARN_INT_CONVERSION = YES; 356 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 362 | ENABLE_NS_ASSERTIONS = NO; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 367 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 368 | GCC_WARN_UNDECLARED_SELECTOR = YES; 369 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 370 | GCC_WARN_UNUSED_FUNCTION = YES; 371 | GCC_WARN_UNUSED_VARIABLE = YES; 372 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 373 | MTL_ENABLE_DEBUG_INFO = NO; 374 | SDKROOT = iphoneos; 375 | TARGETED_DEVICE_FAMILY = "1,2"; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | 2EA3A4881BA89B43005C99B1 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 384 | INFOPLIST_FILE = "XerLee Test/Info.plist"; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | }; 388 | name = Debug; 389 | }; 390 | 2EA3A4891BA89B43005C99B1 /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 394 | INFOPLIST_FILE = "XerLee Test/Info.plist"; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 396 | PRODUCT_NAME = "$(TARGET_NAME)"; 397 | }; 398 | name = Release; 399 | }; 400 | 2EA3A48B1BA89B43005C99B1 /* Debug */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | BUNDLE_LOADER = "$(TEST_HOST)"; 404 | FRAMEWORK_SEARCH_PATHS = ( 405 | "$(SDKROOT)/Developer/Library/Frameworks", 406 | "$(inherited)", 407 | ); 408 | GCC_PREPROCESSOR_DEFINITIONS = ( 409 | "DEBUG=1", 410 | "$(inherited)", 411 | ); 412 | INFOPLIST_FILE = "XerLee TestTests/Info.plist"; 413 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XerLee Test.app/XerLee Test"; 416 | }; 417 | name = Debug; 418 | }; 419 | 2EA3A48C1BA89B43005C99B1 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | BUNDLE_LOADER = "$(TEST_HOST)"; 423 | FRAMEWORK_SEARCH_PATHS = ( 424 | "$(SDKROOT)/Developer/Library/Frameworks", 425 | "$(inherited)", 426 | ); 427 | INFOPLIST_FILE = "XerLee TestTests/Info.plist"; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XerLee Test.app/XerLee Test"; 431 | }; 432 | name = Release; 433 | }; 434 | /* End XCBuildConfiguration section */ 435 | 436 | /* Begin XCConfigurationList section */ 437 | 2EA3A45F1BA89B43005C99B1 /* Build configuration list for PBXProject "XerLee Test" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | 2EA3A4851BA89B43005C99B1 /* Debug */, 441 | 2EA3A4861BA89B43005C99B1 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | 2EA3A4871BA89B43005C99B1 /* Build configuration list for PBXNativeTarget "XerLee Test" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 2EA3A4881BA89B43005C99B1 /* Debug */, 450 | 2EA3A4891BA89B43005C99B1 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | }; 454 | 2EA3A48A1BA89B43005C99B1 /* Build configuration list for PBXNativeTarget "XerLee TestTests" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 2EA3A48B1BA89B43005C99B1 /* Debug */, 458 | 2EA3A48C1BA89B43005C99B1 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | }; 462 | /* End XCConfigurationList section */ 463 | }; 464 | rootObject = 2EA3A45C1BA89B43005C99B1 /* Project object */; 465 | } 466 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/project.xcworkspace/xcshareddata/XerLee Test.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 5AA1E7B3-602D-4943-8FF3-5D2AA3272349 9 | IDESourceControlProjectName 10 | XerLee Test 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | D879C2A6C25B2A6DD5659D12DBAB5208419FDB67 14 | https://github.com/MartinRGB/MTMaterialDelete.git 15 | 16 | IDESourceControlProjectPath 17 | XerLee Test.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | D879C2A6C25B2A6DD5659D12DBAB5208419FDB67 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/MartinRGB/MTMaterialDelete.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | D879C2A6C25B2A6DD5659D12DBAB5208419FDB67 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | D879C2A6C25B2A6DD5659D12DBAB5208419FDB67 36 | IDESourceControlWCCName 37 | MTMaterialDelete 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/project.xcworkspace/xcuserdata/MartinRGB.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test.xcodeproj/project.xcworkspace/xcuserdata/MartinRGB.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcschemes/XerLee Test.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /XerLee Test.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | XerLee Test.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2EA3A4631BA89B43005C99B1 16 | 17 | primary 18 | 19 | 20 | 2EA3A47C1BA89B43005C99B1 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /XerLee Test/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XerLee Test 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. 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 | -------------------------------------------------------------------------------- /XerLee Test/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XerLee Test 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. 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 | -------------------------------------------------------------------------------- /XerLee Test/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /XerLee Test/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "idiom" : "ipad", 41 | "size" : "29x29", 42 | "scale" : "1x" 43 | }, 44 | { 45 | "idiom" : "ipad", 46 | "size" : "29x29", 47 | "scale" : "2x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "40x40", 52 | "scale" : "1x" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "size" : "40x40", 57 | "scale" : "2x" 58 | }, 59 | { 60 | "idiom" : "ipad", 61 | "size" : "76x76", 62 | "scale" : "1x" 63 | }, 64 | { 65 | "idiom" : "ipad", 66 | "size" : "76x76", 67 | "scale" : "2x" 68 | } 69 | ], 70 | "info" : { 71 | "version" : 1, 72 | "author" : "xcode" 73 | } 74 | } -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/BG.imageset/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/BG.imageset/BG.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/BG.imageset/BG@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/BG.imageset/BG@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/BG.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "BG.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "BG@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "L1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "L1@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L1.imageset/L1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L1.imageset/L1.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L1.imageset/L1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L1.imageset/L1@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "L2.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "L2@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L2.imageset/L2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L2.imageset/L2.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L2.imageset/L2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L2.imageset/L2@2x.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L345.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "L345.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "L345@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L345.imageset/L345.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L345.imageset/L345.png -------------------------------------------------------------------------------- /XerLee Test/Images.xcassets/L345.imageset/L345@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTMaterialDelete/802a0105f68e42fa2076dc80e3c90da0afe2a90b/XerLee Test/Images.xcassets/L345.imageset/L345@2x.png -------------------------------------------------------------------------------- /XerLee Test/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.MartinStudio.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /XerLee Test/NSData+Base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Base64.h 3 | // base64 4 | // 5 | // Created by Matt Gallagher on 2009/06/03. 6 | // Copyright 2009 Matt Gallagher. All rights reserved. 7 | // 8 | // This software is provided 'as-is', without any express or implied 9 | // warranty. In no event will the authors be held liable for any damages 10 | // arising from the use of this software. Permission is granted to anyone to 11 | // use this software for any purpose, including commercial applications, and to 12 | // alter it and redistribute it freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 2. Altered source versions must be plainly marked as such, and must not be 19 | // misrepresented as being the original software. 20 | // 3. This notice may not be removed or altered from any source 21 | // distribution. 22 | // 23 | 24 | #import 25 | 26 | void *NewBase64Decode( 27 | const char *inputBuffer, 28 | size_t length, 29 | size_t *outputLength); 30 | 31 | char *NewBase64Encode( 32 | const void *inputBuffer, 33 | size_t length, 34 | bool separateLines, 35 | size_t *outputLength); 36 | 37 | @interface NSData (Base64) 38 | 39 | + (NSData *)dataFromBase64String:(NSString *)aString; 40 | - (NSString *)base64EncodedString; 41 | 42 | // added by Hiroshi Hashiguchi 43 | - (NSString *)base64EncodedStringWithSeparateLines:(BOOL)separateLines; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /XerLee Test/NSData+Base64.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Base64.m 3 | // base64 4 | // 5 | // Created by Matt Gallagher on 2009/06/03. 6 | // Copyright 2009 Matt Gallagher. All rights reserved. 7 | // 8 | // This software is provided 'as-is', without any express or implied 9 | // warranty. In no event will the authors be held liable for any damages 10 | // arising from the use of this software. Permission is granted to anyone to 11 | // use this software for any purpose, including commercial applications, and to 12 | // alter it and redistribute it freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 2. Altered source versions must be plainly marked as such, and must not be 19 | // misrepresented as being the original software. 20 | // 3. This notice may not be removed or altered from any source 21 | // distribution. 22 | // 23 | 24 | // Marin Todorov: Removed autorelease calls for ARC compatibility 25 | 26 | #import "NSData+Base64.h" 27 | 28 | // 29 | // Mapping from 6 bit pattern to ASCII character. 30 | // 31 | static unsigned char base64EncodeLookup[65] = 32 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 33 | 34 | // 35 | // Definition for "masked-out" areas of the base64DecodeLookup mapping 36 | // 37 | #define xx 65 38 | 39 | // 40 | // Mapping from ASCII character to 6 bit pattern. 41 | // 42 | static unsigned char base64DecodeLookup[256] = 43 | { 44 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 45 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 46 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 62, xx, xx, xx, 63, 47 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, xx, xx, xx, xx, xx, xx, 48 | xx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 49 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, xx, xx, xx, xx, xx, 50 | xx, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 51 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, xx, xx, xx, xx, xx, 52 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 53 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 54 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 55 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 56 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 57 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 58 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 59 | xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, 60 | }; 61 | 62 | // 63 | // Fundamental sizes of the binary and base64 encode/decode units in bytes 64 | // 65 | #define BINARY_UNIT_SIZE 3 66 | #define BASE64_UNIT_SIZE 4 67 | 68 | // 69 | // NewBase64Decode 70 | // 71 | // Decodes the base64 ASCII string in the inputBuffer to a newly malloced 72 | // output buffer. 73 | // 74 | // inputBuffer - the source ASCII string for the decode 75 | // length - the length of the string or -1 (to specify strlen should be used) 76 | // outputLength - if not-NULL, on output will contain the decoded length 77 | // 78 | // returns the decoded buffer. Must be free'd by caller. Length is given by 79 | // outputLength. 80 | // 81 | void *NewBase64Decode( 82 | const char *inputBuffer, 83 | size_t length, 84 | size_t *outputLength) 85 | { 86 | if (length == -1) 87 | { 88 | length = strlen(inputBuffer); 89 | } 90 | 91 | size_t outputBufferSize = 92 | ((length+BASE64_UNIT_SIZE-1) / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE; 93 | unsigned char *outputBuffer = (unsigned char *)malloc(outputBufferSize); 94 | 95 | size_t i = 0; 96 | size_t j = 0; 97 | while (i < length) 98 | { 99 | // 100 | // Accumulate 4 valid characters (ignore everything else) 101 | // 102 | unsigned char accumulated[BASE64_UNIT_SIZE]; 103 | size_t accumulateIndex = 0; 104 | while (i < length) 105 | { 106 | unsigned char decode = base64DecodeLookup[inputBuffer[i++]]; 107 | if (decode != xx) 108 | { 109 | accumulated[accumulateIndex] = decode; 110 | accumulateIndex++; 111 | 112 | if (accumulateIndex == BASE64_UNIT_SIZE) 113 | { 114 | break; 115 | } 116 | } 117 | } 118 | 119 | // 120 | // Store the 6 bits from each of the 4 characters as 3 bytes 121 | // 122 | // (Uses improved bounds checking suggested by Alexandre Colucci) 123 | // 124 | if(accumulateIndex >= 2) 125 | outputBuffer[j] = (accumulated[0] << 2) | (accumulated[1] >> 4); 126 | if(accumulateIndex >= 3) 127 | outputBuffer[j + 1] = (accumulated[1] << 4) | (accumulated[2] >> 2); 128 | if(accumulateIndex >= 4) 129 | outputBuffer[j + 2] = (accumulated[2] << 6) | accumulated[3]; 130 | j += accumulateIndex - 1; 131 | } 132 | 133 | if (outputLength) 134 | { 135 | *outputLength = j; 136 | } 137 | return outputBuffer; 138 | } 139 | 140 | // 141 | // NewBase64Encode 142 | // 143 | // Encodes the arbitrary data in the inputBuffer as base64 into a newly malloced 144 | // output buffer. 145 | // 146 | // inputBuffer - the source data for the encode 147 | // length - the length of the input in bytes 148 | // separateLines - if zero, no CR/LF characters will be added. Otherwise 149 | // a CR/LF pair will be added every 64 encoded chars. 150 | // outputLength - if not-NULL, on output will contain the encoded length 151 | // (not including terminating 0 char) 152 | // 153 | // returns the encoded buffer. Must be free'd by caller. Length is given by 154 | // outputLength. 155 | // 156 | char *NewBase64Encode( 157 | const void *buffer, 158 | size_t length, 159 | bool separateLines, 160 | size_t *outputLength) 161 | { 162 | const unsigned char *inputBuffer = (const unsigned char *)buffer; 163 | 164 | #define MAX_NUM_PADDING_CHARS 2 165 | #define OUTPUT_LINE_LENGTH 64 166 | #define INPUT_LINE_LENGTH ((OUTPUT_LINE_LENGTH / BASE64_UNIT_SIZE) * BINARY_UNIT_SIZE) 167 | #define CR_LF_SIZE 2 168 | 169 | // 170 | // Byte accurate calculation of final buffer size 171 | // 172 | size_t outputBufferSize = 173 | ((length / BINARY_UNIT_SIZE) 174 | + ((length % BINARY_UNIT_SIZE) ? 1 : 0)) 175 | * BASE64_UNIT_SIZE; 176 | if (separateLines) 177 | { 178 | outputBufferSize += 179 | (outputBufferSize / OUTPUT_LINE_LENGTH) * CR_LF_SIZE; 180 | } 181 | 182 | // 183 | // Include space for a terminating zero 184 | // 185 | outputBufferSize += 1; 186 | 187 | // 188 | // Allocate the output buffer 189 | // 190 | char *outputBuffer = (char *)malloc(outputBufferSize); 191 | if (!outputBuffer) 192 | { 193 | return NULL; 194 | } 195 | 196 | size_t i = 0; 197 | size_t j = 0; 198 | const size_t lineLength = separateLines ? INPUT_LINE_LENGTH : length; 199 | size_t lineEnd = lineLength; 200 | 201 | while (true) 202 | { 203 | if (lineEnd > length) 204 | { 205 | lineEnd = length; 206 | } 207 | 208 | for (; i + BINARY_UNIT_SIZE - 1 < lineEnd; i += BINARY_UNIT_SIZE) 209 | { 210 | // 211 | // Inner loop: turn 48 bytes into 64 base64 characters 212 | // 213 | outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; 214 | outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) 215 | | ((inputBuffer[i + 1] & 0xF0) >> 4)]; 216 | outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i + 1] & 0x0F) << 2) 217 | | ((inputBuffer[i + 2] & 0xC0) >> 6)]; 218 | outputBuffer[j++] = base64EncodeLookup[inputBuffer[i + 2] & 0x3F]; 219 | } 220 | 221 | if (lineEnd == length) 222 | { 223 | break; 224 | } 225 | 226 | // 227 | // Add the newline 228 | // 229 | outputBuffer[j++] = '\r'; 230 | outputBuffer[j++] = '\n'; 231 | lineEnd += lineLength; 232 | } 233 | 234 | if (i + 1 < length) 235 | { 236 | // 237 | // Handle the single '=' case 238 | // 239 | outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; 240 | outputBuffer[j++] = base64EncodeLookup[((inputBuffer[i] & 0x03) << 4) 241 | | ((inputBuffer[i + 1] & 0xF0) >> 4)]; 242 | outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i + 1] & 0x0F) << 2]; 243 | outputBuffer[j++] = '='; 244 | } 245 | else if (i < length) 246 | { 247 | // 248 | // Handle the double '=' case 249 | // 250 | outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0xFC) >> 2]; 251 | outputBuffer[j++] = base64EncodeLookup[(inputBuffer[i] & 0x03) << 4]; 252 | outputBuffer[j++] = '='; 253 | outputBuffer[j++] = '='; 254 | } 255 | outputBuffer[j] = 0; 256 | 257 | // 258 | // Set the output length and return the buffer 259 | // 260 | if (outputLength) 261 | { 262 | *outputLength = j; 263 | } 264 | return outputBuffer; 265 | } 266 | 267 | @implementation NSData (Base64) 268 | 269 | // 270 | // dataFromBase64String: 271 | // 272 | // Creates an NSData object containing the base64 decoded representation of 273 | // the base64 string 'aString' 274 | // 275 | // Parameters: 276 | // aString - the base64 string to decode 277 | // 278 | // returns the autoreleased NSData representation of the base64 string 279 | // 280 | + (NSData *)dataFromBase64String:(NSString *)aString 281 | { 282 | NSData *data = [aString dataUsingEncoding:NSASCIIStringEncoding]; 283 | size_t outputLength; 284 | void *outputBuffer = NewBase64Decode([data bytes], [data length], &outputLength); 285 | NSData *result = [NSData dataWithBytes:outputBuffer length:outputLength]; 286 | free(outputBuffer); 287 | return result; 288 | } 289 | 290 | // 291 | // base64EncodedString 292 | // 293 | // Creates an NSString object that contains the base 64 encoding of the 294 | // receiver's data. Lines are broken at 64 characters long. 295 | // 296 | // returns an autoreleased NSString being the base 64 representation of the 297 | // receiver. 298 | // 299 | - (NSString *)base64EncodedString 300 | { 301 | size_t outputLength; 302 | char *outputBuffer = 303 | NewBase64Encode([self bytes], [self length], true, &outputLength); 304 | 305 | NSString *result = 306 | [[NSString alloc] 307 | initWithBytes:outputBuffer 308 | length:outputLength 309 | encoding:NSASCIIStringEncoding]; 310 | free(outputBuffer); 311 | return result; 312 | } 313 | 314 | // added by Hiroshi Hashiguchi 315 | - (NSString *)base64EncodedStringWithSeparateLines:(BOOL)separateLines 316 | { 317 | size_t outputLength; 318 | char *outputBuffer = 319 | NewBase64Encode([self bytes], [self length], separateLines, &outputLength); 320 | 321 | NSString *result = 322 | [[NSString alloc] 323 | initWithBytes:outputBuffer 324 | length:outputLength 325 | encoding:NSASCIIStringEncoding]; 326 | free(outputBuffer); 327 | return result; 328 | } 329 | 330 | 331 | @end 332 | -------------------------------------------------------------------------------- /XerLee Test/UIEffectDesignerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIEffectDesignerView.h 3 | // 4 | // @version 0.1 5 | // @author Marin Todorov, http://www.touch-code-magazine.com 6 | // 7 | 8 | // Copyright (c) 2012 Marin Todorov, Underplot ltd. 9 | // This code is distributed under the terms and conditions of the MIT license. 10 | // 11 | // 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: 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | // 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. 14 | // 15 | // The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/MITLicense 16 | 17 | // ********************************************* 18 | // For more information how to use this class to display particle system effects in your iOS or OSX app 19 | // download the UIEffectDesigner app and have a look at the samples on this page: 20 | // http://www.touch-code-magazine.com/uieffectdesigner/ 21 | // ********************************************* 22 | 23 | // This is an ARC only Objective-C class, compatible with iOS5+ and OSX 10.7+ 24 | 25 | #import "QuartzCore/QuartzCore.h" 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | #import 29 | @interface UIEffectDesignerView : UIView 30 | 31 | #else 32 | 33 | #import 34 | @interface UIEffectDesignerView : NSView 35 | #endif 36 | 37 | @property (strong, nonatomic) CAEmitterLayer* emitter; 38 | 39 | -(instancetype)initWithFile:(NSString*)fileName; 40 | +(instancetype)effectWithFile:(NSString*)fileName; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /XerLee Test/UIEffectDesignerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIEffectDesignerView.m 3 | // 4 | // @version 0.1 5 | // @author Marin Todorov, http://www.touch-code-magazine.com 6 | // 7 | 8 | // Copyright (c) 2012 Marin Todorov, Underplot ltd. 9 | // This code is distributed under the terms and conditions of the MIT license. 10 | // 11 | // 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: 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | // 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. 14 | // 15 | // The MIT License in plain English: http://www.touch-code-magazine.com/JSONModel/MITLicense 16 | 17 | #import "UIEffectDesignerView.h" 18 | #import "NSData+Base64.h" 19 | 20 | //the version this view is compatible with 21 | static float kFileFormatVersionExpected = 0.1; 22 | 23 | @implementation UIEffectDesignerView 24 | { 25 | //the root layer for the NSView in OSX 26 | CALayer* rootLayer; 27 | 28 | //emitter and effect data 29 | NSDictionary* effect; 30 | } 31 | 32 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 33 | //on iOS this is how you customize the view layer 34 | + (Class) layerClass 35 | { 36 | return [CAEmitterLayer class]; 37 | } 38 | #endif 39 | 40 | //class factory method 41 | +(instancetype)effectWithFile:(NSString*)fileName 42 | { 43 | return [[UIEffectDesignerView alloc] initWithFile:fileName]; 44 | } 45 | 46 | //custom initializer 47 | -(instancetype)initWithFile:(NSString*)fileName 48 | { 49 | self = [super init]; 50 | 51 | if (self) { 52 | 53 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 54 | //flip the view on the iPhone 55 | self.transform = CGAffineTransformMake(1, 0, 0, -1, 0, self.bounds.size.height); 56 | #endif 57 | 58 | //load the file 59 | effect = [self _loadFile:fileName]; 60 | 61 | //check for file version compatibility 62 | float fileVersion = [effect[@"version"] floatValue]; 63 | BOOL isValidFileFormat = fileVersion<=kFileFormatVersionExpected; 64 | NSAssert(isValidFileFormat, @"File version not compatible with effect view. Please update the view class UIEffectDesignerView source code"); 65 | 66 | //set the effect view frame 67 | float width = [effect[@"width"] floatValue]; 68 | float height = [effect[@"height"] floatValue]; 69 | float x = [effect[@"x"] floatValue]; 70 | float y = [effect[@"y"] floatValue]; 71 | self.frame = CGRectMake(x-width/2,y-height/2,width,height); 72 | 73 | //initialize the emitter 74 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 75 | self.emitter = (CAEmitterLayer*)self.layer; 76 | #else 77 | self.emitter = [CAEmitterLayer layer]; 78 | #endif 79 | 80 | //setup the emitter metrics 81 | self.emitter.emitterPosition = CGPointMake(self.bounds.size.width /2, self.bounds.size.height/2 ); 82 | self.emitter.emitterSize = self.bounds.size; 83 | 84 | //setup the emitter type and mode 85 | NSArray* kEmitterModes = @[kCAEmitterLayerUnordered, kCAEmitterLayerAdditive, kCAEmitterLayerOldestLast, kCAEmitterLayerOldestFirst]; 86 | self.emitter.emitterMode = kEmitterModes[ [effect[@"emitterMode"] intValue] ]; 87 | 88 | NSArray* kEmitterTypes = @[kCAEmitterLayerRectangle, kCAEmitterLayerLine, kCAEmitterLayerPoint]; 89 | self.emitter.emitterShape = kEmitterTypes[ [effect[@"emitterType"] intValue] ]; 90 | 91 | //create new emitter cell 92 | CAEmitterCell* emitterCell = [CAEmitterCell emitterCell]; 93 | 94 | //load the texture image 95 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 96 | CFDataRef imgData = (__bridge CFDataRef)[NSData dataFromBase64String: effect[@"texture"]]; 97 | CGDataProviderRef imgDataProvider = CGDataProviderCreateWithCFData (imgData); 98 | CGImageRef image = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault); 99 | CFRelease(imgDataProvider); 100 | emitterCell.contents = (__bridge_transfer id)image; 101 | #else 102 | NSData* imageData = [NSData dataFromBase64String:effect[@"texture"]]; 103 | NSImage* image = [[NSImage alloc] initWithData:imageData]; 104 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)[image TIFFRepresentation], NULL); 105 | CGImageRef textureCGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); 106 | CFRelease(source); 107 | emitterCell.contents = (__bridge_transfer id)textureCGImage; 108 | #endif 109 | 110 | emitterCell.name = @"cell"; 111 | 112 | //get the particles start color 113 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 114 | //source: http://stackoverflow.com/a/15242701/208205 115 | NSUInteger red, green, blue; 116 | sscanf([effect[@"color"] UTF8String], "#%02X%02X%02X", &red, &green, &blue); 117 | UIColor* color = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:[effect[@"alpha"] floatValue]]; 118 | #else 119 | unsigned int red, green, blue; 120 | sscanf([effect[@"color"] UTF8String], "#%02X%02X%02X", &red, &green, &blue); 121 | NSColor* color = [NSColor colorWithCalibratedRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:[effect[@"alpha"] floatValue]]; 122 | #endif 123 | emitterCell.color = color.CGColor; 124 | 125 | //copy all the settings to the emitter cell 126 | emitterCell.birthRate = [effect[@"birthRate"] floatValue]; 127 | emitterCell.lifetime = [effect[@"lifetime"] floatValue]; 128 | emitterCell.lifetimeRange = [effect[@"lifetimeRange"] floatValue]; 129 | emitterCell.velocity = [effect[@"velocity"] floatValue]; 130 | emitterCell.velocityRange = [effect[@"velocityRange"] floatValue]; 131 | 132 | emitterCell.redRange = [effect[@"redRange"] floatValue]; 133 | emitterCell.redSpeed = [effect[@"redSpeed"] floatValue]; 134 | emitterCell.greenRange = [effect[@"greenRange"] floatValue]; 135 | emitterCell.greenSpeed = [effect[@"greenSpeed"] floatValue]; 136 | emitterCell.blueRange = [effect[@"blueRange"] floatValue]; 137 | emitterCell.blueSpeed = [effect[@"blueSpeed"] floatValue]; 138 | 139 | emitterCell.emissionLatitude = [effect[@"latitude"] floatValue]; 140 | emitterCell.emissionLongitude = [effect[@"longitude"] floatValue]; 141 | 142 | emitterCell.xAcceleration = [effect[@"xAcceleration"] floatValue]; 143 | emitterCell.yAcceleration = [effect[@"yAcceleration"] floatValue]; 144 | emitterCell.zAcceleration = [effect[@"zAcceleration"] floatValue]; 145 | 146 | emitterCell.alphaRange = [effect[@"alphaRange"] floatValue]; 147 | emitterCell.alphaSpeed = [effect[@"alphaSpeed"] floatValue]; 148 | 149 | emitterCell.scale = [effect[@"scale"] floatValue]; 150 | emitterCell.scaleRange = [effect[@"scaleRange"] floatValue]; 151 | emitterCell.scaleSpeed = [effect[@"scaleSpeed"] floatValue]; 152 | 153 | emitterCell.spin = [effect[@"spin"] floatValue]; 154 | emitterCell.spinRange = [effect[@"spinRange"] floatValue]; 155 | 156 | emitterCell.redSpeed = [effect[@"redSpeed"] floatValue]; 157 | emitterCell.greenSpeed = [effect[@"greenSpeed"] floatValue]; 158 | emitterCell.blueSpeed = [effect[@"blueSpeed"] floatValue]; 159 | 160 | //add the cell to the emitter layer 161 | self.emitter.emitterCells = @[emitterCell]; 162 | 163 | #pragma mark - OSX layer setup 164 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 165 | #else 166 | //on OSX build the UI hierarchy to show particles 167 | 168 | rootLayer = [CALayer layer]; 169 | [rootLayer addSublayer:self.emitter]; 170 | rootLayer.backgroundColor = [NSColor clearColor].CGColor; 171 | 172 | [self setLayer:rootLayer]; 173 | [self setWantsLayer:YES]; 174 | 175 | rootLayer.masksToBounds = NO; 176 | self.emitter.masksToBounds = NO; 177 | 178 | //Force the view to update 179 | [self setNeedsDisplay:YES]; 180 | #endif 181 | 182 | } 183 | 184 | return self; 185 | } 186 | 187 | //just read json file and return a dictionary 188 | -(NSDictionary*)_loadFile:(NSString*)fileName 189 | { 190 | NSString* filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName]; 191 | NSData* fileData = [NSData dataWithContentsOfFile:filePath]; 192 | NSMutableDictionary* dict = [NSJSONSerialization JSONObjectWithData:fileData options:NSJSONReadingMutableContainers error:nil]; 193 | 194 | NSAssert(dict, @"error loading the .ped file"); 195 | 196 | return dict; 197 | } 198 | 199 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 200 | #else 201 | // on OSX - when the view is added to the UI hierarchy 202 | // resize and position it accordind to the effect settings 203 | // and also make sure the window accepts layer views 204 | -(void)viewWillMoveToWindow:(NSWindow *)newWindow 205 | { 206 | ((NSView*)self.superview).wantsLayer = YES; 207 | [self setFrameOrigin:NSMakePoint(self.frame.origin.x, ((NSView*)self.superview).frame.size.height - self.frame.origin.y - self.frame.size.height)]; 208 | } 209 | #endif 210 | 211 | @end -------------------------------------------------------------------------------- /XerLee Test/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // XerLee Test 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /XerLee Test/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // XerLee Test 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIEffectDesignerView.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet UIView *sview; 14 | @property (weak, nonatomic) IBOutlet UIView *sview2; 15 | @property (weak, nonatomic) IBOutlet UIImageView *imageview; 16 | @property (weak, nonatomic) IBOutlet UIImageView *imageview2; 17 | @property (weak, nonatomic) IBOutlet UIImageView *imageview3; 18 | @property(strong,nonatomic) CABasicAnimation*circleMaskAnimation; 19 | @property(strong,nonatomic) CAShapeLayer*MaskLayer; 20 | @property(strong,nonatomic) CAShapeLayer*MaskLayer2; 21 | @property(strong,nonatomic) UIEffectDesignerView*effectView; 22 | @property(strong,nonatomic) UIEffectDesignerView*effectView2; 23 | 24 | 25 | 26 | - (void)handlePan:(UIPanGestureRecognizer *)recognizer; 27 | 28 | 29 | @end 30 | 31 | @implementation ViewController 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | // Do any additional setup after loading the view, typically from a nib. 36 | //一、 37 | //1.Mask Layer设置 38 | _MaskLayer = [[CAShapeLayer alloc]init]; 39 | _MaskLayer.frame = self.view.bounds; 40 | _MaskLayer.fillColor = [[UIColor blackColor] CGColor]; 41 | 42 | _MaskLayer.path = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 300, 73)].CGPath; 43 | //添加mask后,直接属于其子layer 44 | _sview.layer.mask = _MaskLayer; 45 | _sview.layer.masksToBounds = YES; 46 | 47 | //2.添加particle层 48 | _effectView = [UIEffectDesignerView effectWithFile:@"particle.ped"]; 49 | [self.view addSubview:_effectView]; 50 | _effectView.frame = CGRectMake(300, 144, 80, 80); 51 | _effectView.emitter.lifetime = 1.5; 52 | _effectView.alpha = 0; 53 | 54 | UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; 55 | [_sview addGestureRecognizer:recognizer]; 56 | 57 | //二、 58 | //1.Mask Layer设置 59 | _MaskLayer2 = [[CAShapeLayer alloc]init]; 60 | _MaskLayer2.frame = self.view.bounds; 61 | _MaskLayer2.fillColor = [[UIColor blackColor] CGColor]; 62 | 63 | _MaskLayer2.path = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 300, 73)].CGPath; 64 | //添加mask后,直接属于其子layer 65 | _sview2.layer.mask = _MaskLayer2; 66 | _sview2.layer.masksToBounds = YES; 67 | 68 | //2.添加particle层 69 | _effectView2 = [UIEffectDesignerView effectWithFile:@"particle.ped"]; 70 | [self.view addSubview:_effectView2]; 71 | _effectView2.frame = CGRectMake(300, 144, 80, 80); 72 | _effectView2.emitter.lifetime = 1.5; 73 | _effectView2.alpha = 0; 74 | 75 | UIPanGestureRecognizer *recognizer2 = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan2:)]; 76 | [_sview2 addGestureRecognizer:recognizer2]; 77 | } 78 | 79 | - (void)didReceiveMemoryWarning { 80 | [super didReceiveMemoryWarning]; 81 | // Dispose of any resources that can be recreated. 82 | } 83 | 84 | 85 | - (void)handlePan:(UIPanGestureRecognizer *)recognizer 86 | { 87 | 88 | CGPoint location = [recognizer locationInView:_sview]; 89 | CGPoint translation = [recognizer translationInView:_sview]; 90 | CGPoint velocity = [recognizer velocityInView:_sview]; 91 | 92 | NSLog(@"location.x is %f",location.x); 93 | NSLog(@"translation.x is %f",translation.x); 94 | NSLog(@"velocity.x is %f",velocity.x); 95 | 96 | //手势速度影响生成率&速度 97 | _effectView.emitter.velocity = velocity.x/-100; 98 | _effectView.emitter.birthRate = velocity.x/-10+10; 99 | 100 | [_MaskLayer setNeedsDisplay]; 101 | 102 | switch (recognizer.state) { 103 | case UIGestureRecognizerStateBegan: 104 | 105 | { 106 | 107 | } 108 | case UIGestureRecognizerStateChanged: 109 | { 110 | 111 | 112 | //👈滑出现蒙板效果,👉滑不出蒙板效果 113 | if (translation.x <0) { 114 | //Refresh the MaskLayer's translation.x to re-animate 115 | [_MaskLayer removeAllAnimations]; 116 | [_effectView.layer removeAllAnimations]; 117 | //简单跟手 118 | CATransform3D t1 = CATransform3DMakeTranslation(translation.x*1-20,0, 0); 119 | CGAffineTransform t2 = CGAffineTransformMakeTranslation(translation.x*1-20, 0); 120 | _MaskLayer.transform = t1; 121 | _effectView.transform = t2; 122 | _effectView.alpha = 1; 123 | } 124 | else{ 125 | } 126 | 127 | 128 | } 129 | break; 130 | case UIGestureRecognizerStateCancelled: 131 | case UIGestureRecognizerStateEnded: 132 | 133 | { 134 | 135 | if (translation.x <0) { 136 | //👉 137 | if (translation.x >-100) { 138 | //Mask&effectView 👉 139 | CABasicAnimation* maskAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 140 | maskAnimation.fillMode = kCAFillModeForwards; 141 | maskAnimation.removedOnCompletion = NO; 142 | maskAnimation.toValue = [NSNumber numberWithFloat:0]; 143 | maskAnimation.duration = 0.2; 144 | 145 | [_MaskLayer addAnimation:maskAnimation forKey:@"transform.translation.x"]; 146 | [_effectView.layer addAnimation:maskAnimation forKey:@"transform.translation.x"]; 147 | 148 | //Particle消失 149 | [UIView animateWithDuration:0.6 delay:0.6 options:UIViewAnimationOptionCurveLinear animations:^{ 150 | _effectView.emitter.lifetime = 0; 151 | _effectView.alpha = 0; 152 | 153 | }completion:^(BOOL finished){ 154 | _effectView.emitter.lifetime = 1.5; 155 | }]; 156 | 157 | 158 | 159 | 160 | } 161 | else{ 162 | 163 | _effectView.emitter.lifetime = 1.5; 164 | ////Mask&effectView 👈 165 | CABasicAnimation* maskAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 166 | maskAnimation.fillMode = kCAFillModeForwards; 167 | maskAnimation.removedOnCompletion = NO; 168 | maskAnimation.toValue = [NSNumber numberWithFloat:-286]; 169 | maskAnimation.duration = 0.2; 170 | 171 | CABasicAnimation* maskAnimation2 = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 172 | maskAnimation2.fillMode = kCAFillModeForwards; 173 | maskAnimation2.removedOnCompletion = NO; 174 | maskAnimation2.toValue = [NSNumber numberWithFloat:-300]; 175 | maskAnimation2.duration = 0.2; 176 | 177 | [_MaskLayer addAnimation:maskAnimation forKey:@"transform.translation.x"]; 178 | [_effectView.layer addAnimation:maskAnimation2 forKey:@"transform.translation.x"]; 179 | //Particle消失 180 | 181 | 182 | [UIView animateWithDuration:0.6 delay:0.6 options:UIViewAnimationOptionCurveLinear animations:^{ 183 | _effectView.emitter.lifetime = 0; 184 | 185 | //_effectView.alpha = 0; 186 | }completion:^(BOOL finished){ 187 | //_effectView.emitter.lifetime = 1.5; 188 | }]; 189 | 190 | //整体上移 191 | [UIView animateWithDuration:0.6 delay:0 usingSpringWithDamping:0.7 initialSpringVelocity:0.2 options:UIViewAnimationOptionCurveEaseOut animations:^{ 192 | _sview2.center = CGPointMake(_sview2.center.x, _sview2.center.y-83); 193 | _imageview3.center = CGPointMake(_imageview3.center.x, _imageview3.center.y-83); 194 | }completion:^(BOOL finished){ 195 | _sview.alpha = 0; 196 | }]; 197 | 198 | } 199 | } 200 | 201 | 202 | } 203 | break; 204 | case UIGestureRecognizerStateFailed: 205 | 206 | default: 207 | break; 208 | } 209 | 210 | 211 | 212 | } 213 | 214 | - (void)handlePan2:(UIPanGestureRecognizer *)recognizer2 215 | { 216 | 217 | CGPoint location = [recognizer2 locationInView:_sview2]; 218 | CGPoint translation = [recognizer2 translationInView:_sview2]; 219 | CGPoint velocity = [recognizer2 velocityInView:_sview2]; 220 | 221 | NSLog(@"location.x is %f",location.x); 222 | NSLog(@"translation.x is %f",translation.x); 223 | NSLog(@"velocity.x is %f",velocity.x); 224 | 225 | //手势速度影响生成率&速度 226 | _effectView2.emitter.velocity = velocity.x/-100; 227 | _effectView2.emitter.birthRate = velocity.x/-10+10; 228 | 229 | [_MaskLayer2 setNeedsDisplay]; 230 | 231 | switch (recognizer2.state) { 232 | case UIGestureRecognizerStateBegan: 233 | 234 | { 235 | 236 | } 237 | case UIGestureRecognizerStateChanged: 238 | { 239 | 240 | 241 | //👈滑出现蒙板效果,👉滑不出蒙板效果 242 | if (translation.x <0) { 243 | //Refresh the MaskLayer's translation.x to re-animate 244 | [_MaskLayer2 removeAllAnimations]; 245 | [_effectView2.layer removeAllAnimations]; 246 | //简单跟手 247 | CATransform3D t1 = CATransform3DMakeTranslation(translation.x*1-20,0, 0); 248 | CGAffineTransform t2 = CGAffineTransformMakeTranslation(translation.x*1-20, 0); 249 | _MaskLayer2.transform = t1; 250 | _effectView2.transform = t2; 251 | _effectView2.alpha = 1; 252 | } 253 | else{ 254 | } 255 | 256 | 257 | } 258 | break; 259 | case UIGestureRecognizerStateCancelled: 260 | case UIGestureRecognizerStateEnded: 261 | 262 | { 263 | 264 | if (translation.x <0) { 265 | //👉 266 | if (translation.x >-100) { 267 | //Mask&effectView 👉 268 | CABasicAnimation* maskAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 269 | maskAnimation.fillMode = kCAFillModeForwards; 270 | maskAnimation.removedOnCompletion = NO; 271 | maskAnimation.toValue = [NSNumber numberWithFloat:0]; 272 | maskAnimation.duration = 0.2; 273 | 274 | [_MaskLayer2 addAnimation:maskAnimation forKey:@"transform.translation.x"]; 275 | [_effectView2.layer addAnimation:maskAnimation forKey:@"transform.translation.x"]; 276 | 277 | //Particle消失 278 | [UIView animateWithDuration:0.6 delay:0.6 options:UIViewAnimationOptionCurveLinear animations:^{ 279 | _effectView2.emitter.lifetime = 0; 280 | _effectView2.alpha = 0; 281 | 282 | }completion:^(BOOL finished){ 283 | _effectView2.emitter.lifetime = 1.5; 284 | }]; 285 | 286 | 287 | 288 | 289 | } 290 | else{ 291 | 292 | _effectView2.emitter.lifetime = 1.5; 293 | ////Mask&effectView 👈 294 | CABasicAnimation* maskAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 295 | maskAnimation.fillMode = kCAFillModeForwards; 296 | maskAnimation.removedOnCompletion = NO; 297 | maskAnimation.toValue = [NSNumber numberWithFloat:-286]; 298 | maskAnimation.duration = 0.2; 299 | 300 | CABasicAnimation* maskAnimation2 = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 301 | maskAnimation2.fillMode = kCAFillModeForwards; 302 | maskAnimation2.removedOnCompletion = NO; 303 | maskAnimation2.toValue = [NSNumber numberWithFloat:-300]; 304 | maskAnimation2.duration = 0.2; 305 | 306 | [_MaskLayer2 addAnimation:maskAnimation forKey:@"transform.translation.x"]; 307 | [_effectView2.layer addAnimation:maskAnimation2 forKey:@"transform.translation.x"]; 308 | //Particle消失 309 | 310 | 311 | [UIView animateWithDuration:0.6 delay:0.6 options:UIViewAnimationOptionCurveLinear animations:^{ 312 | _effectView2.emitter.lifetime = 0; 313 | 314 | //_effectView.alpha = 0; 315 | }completion:^(BOOL finished){ 316 | //_effectView.emitter.lifetime = 1.5; 317 | }]; 318 | 319 | //整体上移 320 | [UIView animateWithDuration:0.6 delay:0 usingSpringWithDamping:0.7 initialSpringVelocity:0.2 options:UIViewAnimationOptionCurveEaseOut animations:^{ 321 | _imageview3.center = CGPointMake(_imageview3.center.x, _imageview3.center.y-83); 322 | }completion:^(BOOL finished){ 323 | _sview2.alpha = 0; 324 | }]; 325 | 326 | } 327 | } 328 | 329 | 330 | } 331 | break; 332 | case UIGestureRecognizerStateFailed: 333 | 334 | default: 335 | break; 336 | } 337 | 338 | 339 | 340 | } 341 | 342 | @end 343 | -------------------------------------------------------------------------------- /XerLee Test/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XerLee Test 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. 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 | -------------------------------------------------------------------------------- /XerLee TestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.MartinStudio.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /XerLee TestTests/XerLee_TestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XerLee_TestTests.m 3 | // XerLee TestTests 4 | // 5 | // Created by KingMartin on 15/9/16. 6 | // Copyright (c) 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface XerLee_TestTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation XerLee_TestTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------