├── Design.gif ├── README.md ├── Trainer.pcvd ├── Trainer.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── MartinRGB.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── MartinRGB.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Trainer.xcscheme │ └── xcschememanagement.plist ├── Trainer ├── AppDelegate.swift ├── Assets.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 │ ├── Contents.json │ ├── Page1 │ │ ├── Add.imageset │ │ │ ├── Add@2x.png │ │ │ └── Contents.json │ │ ├── Add2.imageset │ │ │ ├── Add2.png │ │ │ ├── Add2@2x.png │ │ │ └── Contents.json │ │ ├── Arrow.imageset │ │ │ ├── Arrow@2x.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Explore.imageset │ │ │ ├── Contents.json │ │ │ └── Explore@2x.png │ │ ├── FakeTopBar.imageset │ │ │ ├── Contents.json │ │ │ ├── FakeTopBar.png │ │ │ └── FakeTopBar@2x.png │ │ ├── Glass.imageset │ │ │ ├── Contents.json │ │ │ └── Glass@2x.png │ │ ├── Menu.imageset │ │ │ ├── Contents.json │ │ │ └── Menu@2x.png │ │ ├── RealBG.imageset │ │ │ ├── Contents.json │ │ │ ├── RealBG.png │ │ │ └── RealBG@2x.png │ │ ├── TopBar.imageset │ │ │ ├── Contents.json │ │ │ ├── TopBar.png │ │ │ └── TopBar@2x.png │ │ ├── bgDown.imageset │ │ │ ├── BG Down@2x.png │ │ │ └── Contents.json │ │ ├── card0.imageset │ │ │ ├── Card0.png │ │ │ └── Contents.json │ │ ├── card1.imageset │ │ │ ├── Card1@2x.png │ │ │ └── Contents.json │ │ ├── card2.imageset │ │ │ ├── Card2@2x.png │ │ │ └── Contents.json │ │ └── card3.imageset │ │ │ ├── Card3@2x.png │ │ │ └── Contents.json │ └── Page2 │ │ ├── Avatar1.imageset │ │ ├── Avatar1.png │ │ ├── Avatar1@2x.png │ │ └── Contents.json │ │ ├── Avatar2.imageset │ │ ├── Avatar2.png │ │ ├── Avatar2@2x.png │ │ └── Contents.json │ │ ├── Avatar3.imageset │ │ ├── Avatar3.png │ │ ├── Avatar3@2x.png │ │ └── Contents.json │ │ ├── Contents.json │ │ └── TableViewArrow.imageset │ │ ├── Contents.json │ │ ├── TableViewArrow.png │ │ └── TableViewArrow@2x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CustomTableViewCell.swift ├── CustomTransition.swift ├── DataModel.swift ├── FloatingButton.swift ├── Info.plist ├── OnBoardingViewController.swift ├── SliderLabelContainer.swift ├── TableViewController.swift └── UIColors+FloatingMenu.swift ├── TrainerTests ├── Info.plist └── TrainerTests.swift ├── TrainerUITests ├── Info.plist └── TrainerUITests.swift └── implement.gif /Design.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Design.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MTPrivateTrainerAnimation 2 | 3 | ##Android Versioin:[DWPrivateTrainerAnimation](https://github.com/DavidWangTM/DWPrivateTrainerAnimation) 4 | ##thanks for [DavidWangTM](https://github.com/DavidWangTM)'s work! 5 | 6 | A simple implement of my design,only Onboarding Controller Now,going to write some controller custom transition 7 | 8 | ![My implement](https://github.com/MartinRGB/MTPrivateTrainerAnimation/blob/master/implement.gif?raw=true) 9 | 10 | My implement 11 | 12 | 13 | ![My design](https://github.com/MartinRGB/MTPrivateTrainerAnimation/blob/master/Design.gif?raw=true) 14 | 15 | [My Design](https://dribbble.com/shots/2346124-Private-Trainer-Course-List) 16 | 17 | This is a swift exercise of Private Trainer's Onboarding Animation(It is also show the course category of this app),user will see this anim if he is not login. 18 | 19 | Had spent so many time on implementing other designer's design.This time try to write code for myself.I have myself's design files,so I can get the right value of animation. 20 | 21 | Not much logic code,just some animation adjustment when viewwillappear,will spend some time making the tableview part. 22 | 23 | Roadmap: 24 | 25 | 1.Implement all the design (WIP) 26 | 27 | 2.Seperate the FAB component 28 | 29 | 3.Package/Refactoring in the end 30 | -------------------------------------------------------------------------------- /Trainer.pcvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer.pcvd -------------------------------------------------------------------------------- /Trainer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2E0931FE1C1D8F01006D52AD /* CustomTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E0931FD1C1D8F01006D52AD /* CustomTableViewCell.swift */; }; 11 | 2E441A6C1C1FA87000FFC895 /* UIColors+FloatingMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E441A6B1C1FA87000FFC895 /* UIColors+FloatingMenu.swift */; }; 12 | 2E441A6E1C1FAED800FFC895 /* FloatingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E441A6D1C1FAED800FFC895 /* FloatingButton.swift */; }; 13 | 2E9D6A541BF3382300BCCE55 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9D6A531BF3382300BCCE55 /* AppDelegate.swift */; }; 14 | 2E9D6A561BF3382300BCCE55 /* OnBoardingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9D6A551BF3382300BCCE55 /* OnBoardingViewController.swift */; }; 15 | 2E9D6A591BF3382300BCCE55 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2E9D6A571BF3382300BCCE55 /* Main.storyboard */; }; 16 | 2E9D6A5B1BF3382300BCCE55 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E9D6A5A1BF3382300BCCE55 /* Assets.xcassets */; }; 17 | 2E9D6A5E1BF3382300BCCE55 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2E9D6A5C1BF3382300BCCE55 /* LaunchScreen.storyboard */; }; 18 | 2E9D6A691BF3382300BCCE55 /* TrainerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9D6A681BF3382300BCCE55 /* TrainerTests.swift */; }; 19 | 2E9D6A741BF3382300BCCE55 /* TrainerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9D6A731BF3382300BCCE55 /* TrainerUITests.swift */; }; 20 | 2EA4E2441C118DE9007B50DD /* CustomTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA4E2431C118DE9007B50DD /* CustomTransition.swift */; }; 21 | 2EA5A5AD1C1E8A6E0018DBA6 /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA5A5AC1C1E8A6E0018DBA6 /* DataModel.swift */; }; 22 | 2EA5A5B01C1E926F0018DBA6 /* SliderLabelContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA5A5AF1C1E926F0018DBA6 /* SliderLabelContainer.swift */; }; 23 | 2ED6948E1BFDAA6800FBAD39 /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ED6948D1BFDAA6800FBAD39 /* TableViewController.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 2E9D6A651BF3382300BCCE55 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 2E9D6A481BF3382300BCCE55 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 2E9D6A4F1BF3382300BCCE55; 32 | remoteInfo = Trainer; 33 | }; 34 | 2E9D6A701BF3382300BCCE55 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 2E9D6A481BF3382300BCCE55 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 2E9D6A4F1BF3382300BCCE55; 39 | remoteInfo = Trainer; 40 | }; 41 | /* End PBXContainerItemProxy section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 2E0931FD1C1D8F01006D52AD /* CustomTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTableViewCell.swift; sourceTree = ""; }; 45 | 2E441A6B1C1FA87000FFC895 /* UIColors+FloatingMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColors+FloatingMenu.swift"; sourceTree = ""; }; 46 | 2E441A6D1C1FAED800FFC895 /* FloatingButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FloatingButton.swift; sourceTree = ""; }; 47 | 2E9D6A501BF3382300BCCE55 /* Trainer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Trainer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 2E9D6A531BF3382300BCCE55 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 49 | 2E9D6A551BF3382300BCCE55 /* OnBoardingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnBoardingViewController.swift; sourceTree = ""; }; 50 | 2E9D6A581BF3382300BCCE55 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 2E9D6A5A1BF3382300BCCE55 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 2E9D6A5D1BF3382300BCCE55 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 2E9D6A5F1BF3382300BCCE55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 2E9D6A641BF3382300BCCE55 /* TrainerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TrainerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 2E9D6A681BF3382300BCCE55 /* TrainerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrainerTests.swift; sourceTree = ""; }; 56 | 2E9D6A6A1BF3382300BCCE55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 2E9D6A6F1BF3382300BCCE55 /* TrainerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TrainerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 2E9D6A731BF3382300BCCE55 /* TrainerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrainerUITests.swift; sourceTree = ""; }; 59 | 2E9D6A751BF3382300BCCE55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 2EA4E2431C118DE9007B50DD /* CustomTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTransition.swift; sourceTree = ""; }; 61 | 2EA5A5AC1C1E8A6E0018DBA6 /* DataModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataModel.swift; sourceTree = ""; }; 62 | 2EA5A5AF1C1E926F0018DBA6 /* SliderLabelContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderLabelContainer.swift; sourceTree = ""; }; 63 | 2ED6948D1BFDAA6800FBAD39 /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 2E9D6A4D1BF3382300BCCE55 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 2E9D6A611BF3382300BCCE55 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 2E9D6A6C1BF3382300BCCE55 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 2E441A6F1C1FC4E100FFC895 /* FAB */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 2E441A6B1C1FA87000FFC895 /* UIColors+FloatingMenu.swift */, 95 | 2E441A6D1C1FAED800FFC895 /* FloatingButton.swift */, 96 | ); 97 | name = FAB; 98 | sourceTree = ""; 99 | }; 100 | 2E9D6A471BF3382300BCCE55 = { 101 | isa = PBXGroup; 102 | children = ( 103 | 2E9D6A521BF3382300BCCE55 /* Trainer */, 104 | 2E9D6A721BF3382300BCCE55 /* TrainerUITests */, 105 | 2E9D6A511BF3382300BCCE55 /* Products */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | 2E9D6A511BF3382300BCCE55 /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 2E9D6A501BF3382300BCCE55 /* Trainer.app */, 113 | 2E9D6A641BF3382300BCCE55 /* TrainerTests.xctest */, 114 | 2E9D6A6F1BF3382300BCCE55 /* TrainerUITests.xctest */, 115 | ); 116 | name = Products; 117 | sourceTree = ""; 118 | }; 119 | 2E9D6A521BF3382300BCCE55 /* Trainer */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 2E9D6A531BF3382300BCCE55 /* AppDelegate.swift */, 123 | 2E9D6A551BF3382300BCCE55 /* OnBoardingViewController.swift */, 124 | 2ED6948D1BFDAA6800FBAD39 /* TableViewController.swift */, 125 | 2EA4E2431C118DE9007B50DD /* CustomTransition.swift */, 126 | 2EA5A5AC1C1E8A6E0018DBA6 /* DataModel.swift */, 127 | 2E441A6F1C1FC4E100FFC895 /* FAB */, 128 | 2E0931FD1C1D8F01006D52AD /* CustomTableViewCell.swift */, 129 | 2EA5A5AF1C1E926F0018DBA6 /* SliderLabelContainer.swift */, 130 | 2E9D6A571BF3382300BCCE55 /* Main.storyboard */, 131 | 2E9D6A5A1BF3382300BCCE55 /* Assets.xcassets */, 132 | 2E9D6A5C1BF3382300BCCE55 /* LaunchScreen.storyboard */, 133 | 2E9D6A5F1BF3382300BCCE55 /* Info.plist */, 134 | 2E9D6A671BF3382300BCCE55 /* TrainerTests */, 135 | ); 136 | path = Trainer; 137 | sourceTree = ""; 138 | }; 139 | 2E9D6A671BF3382300BCCE55 /* TrainerTests */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 2E9D6A681BF3382300BCCE55 /* TrainerTests.swift */, 143 | 2E9D6A6A1BF3382300BCCE55 /* Info.plist */, 144 | ); 145 | path = TrainerTests; 146 | sourceTree = SOURCE_ROOT; 147 | }; 148 | 2E9D6A721BF3382300BCCE55 /* TrainerUITests */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 2E9D6A731BF3382300BCCE55 /* TrainerUITests.swift */, 152 | 2E9D6A751BF3382300BCCE55 /* Info.plist */, 153 | ); 154 | path = TrainerUITests; 155 | sourceTree = ""; 156 | }; 157 | /* End PBXGroup section */ 158 | 159 | /* Begin PBXNativeTarget section */ 160 | 2E9D6A4F1BF3382300BCCE55 /* Trainer */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 2E9D6A781BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "Trainer" */; 163 | buildPhases = ( 164 | 2E9D6A4C1BF3382300BCCE55 /* Sources */, 165 | 2E9D6A4D1BF3382300BCCE55 /* Frameworks */, 166 | 2E9D6A4E1BF3382300BCCE55 /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = Trainer; 173 | productName = Trainer; 174 | productReference = 2E9D6A501BF3382300BCCE55 /* Trainer.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | 2E9D6A631BF3382300BCCE55 /* TrainerTests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 2E9D6A7B1BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "TrainerTests" */; 180 | buildPhases = ( 181 | 2E9D6A601BF3382300BCCE55 /* Sources */, 182 | 2E9D6A611BF3382300BCCE55 /* Frameworks */, 183 | 2E9D6A621BF3382300BCCE55 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | 2E9D6A661BF3382300BCCE55 /* PBXTargetDependency */, 189 | ); 190 | name = TrainerTests; 191 | productName = TrainerTests; 192 | productReference = 2E9D6A641BF3382300BCCE55 /* TrainerTests.xctest */; 193 | productType = "com.apple.product-type.bundle.unit-test"; 194 | }; 195 | 2E9D6A6E1BF3382300BCCE55 /* TrainerUITests */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 2E9D6A7E1BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "TrainerUITests" */; 198 | buildPhases = ( 199 | 2E9D6A6B1BF3382300BCCE55 /* Sources */, 200 | 2E9D6A6C1BF3382300BCCE55 /* Frameworks */, 201 | 2E9D6A6D1BF3382300BCCE55 /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | 2E9D6A711BF3382300BCCE55 /* PBXTargetDependency */, 207 | ); 208 | name = TrainerUITests; 209 | productName = TrainerUITests; 210 | productReference = 2E9D6A6F1BF3382300BCCE55 /* TrainerUITests.xctest */; 211 | productType = "com.apple.product-type.bundle.ui-testing"; 212 | }; 213 | /* End PBXNativeTarget section */ 214 | 215 | /* Begin PBXProject section */ 216 | 2E9D6A481BF3382300BCCE55 /* Project object */ = { 217 | isa = PBXProject; 218 | attributes = { 219 | LastSwiftUpdateCheck = 0710; 220 | LastUpgradeCheck = 0710; 221 | ORGANIZATIONNAME = KingMartin; 222 | TargetAttributes = { 223 | 2E9D6A4F1BF3382300BCCE55 = { 224 | CreatedOnToolsVersion = 7.1; 225 | }; 226 | 2E9D6A631BF3382300BCCE55 = { 227 | CreatedOnToolsVersion = 7.1; 228 | TestTargetID = 2E9D6A4F1BF3382300BCCE55; 229 | }; 230 | 2E9D6A6E1BF3382300BCCE55 = { 231 | CreatedOnToolsVersion = 7.1; 232 | TestTargetID = 2E9D6A4F1BF3382300BCCE55; 233 | }; 234 | }; 235 | }; 236 | buildConfigurationList = 2E9D6A4B1BF3382300BCCE55 /* Build configuration list for PBXProject "Trainer" */; 237 | compatibilityVersion = "Xcode 3.2"; 238 | developmentRegion = English; 239 | hasScannedForEncodings = 0; 240 | knownRegions = ( 241 | en, 242 | Base, 243 | ); 244 | mainGroup = 2E9D6A471BF3382300BCCE55; 245 | productRefGroup = 2E9D6A511BF3382300BCCE55 /* Products */; 246 | projectDirPath = ""; 247 | projectRoot = ""; 248 | targets = ( 249 | 2E9D6A4F1BF3382300BCCE55 /* Trainer */, 250 | 2E9D6A631BF3382300BCCE55 /* TrainerTests */, 251 | 2E9D6A6E1BF3382300BCCE55 /* TrainerUITests */, 252 | ); 253 | }; 254 | /* End PBXProject section */ 255 | 256 | /* Begin PBXResourcesBuildPhase section */ 257 | 2E9D6A4E1BF3382300BCCE55 /* Resources */ = { 258 | isa = PBXResourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | 2E9D6A5E1BF3382300BCCE55 /* LaunchScreen.storyboard in Resources */, 262 | 2E9D6A5B1BF3382300BCCE55 /* Assets.xcassets in Resources */, 263 | 2E9D6A591BF3382300BCCE55 /* Main.storyboard in Resources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | 2E9D6A621BF3382300BCCE55 /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | 2E9D6A6D1BF3382300BCCE55 /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXResourcesBuildPhase section */ 282 | 283 | /* Begin PBXSourcesBuildPhase section */ 284 | 2E9D6A4C1BF3382300BCCE55 /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 2E9D6A561BF3382300BCCE55 /* OnBoardingViewController.swift in Sources */, 289 | 2E0931FE1C1D8F01006D52AD /* CustomTableViewCell.swift in Sources */, 290 | 2E441A6E1C1FAED800FFC895 /* FloatingButton.swift in Sources */, 291 | 2E441A6C1C1FA87000FFC895 /* UIColors+FloatingMenu.swift in Sources */, 292 | 2ED6948E1BFDAA6800FBAD39 /* TableViewController.swift in Sources */, 293 | 2EA5A5B01C1E926F0018DBA6 /* SliderLabelContainer.swift in Sources */, 294 | 2E9D6A541BF3382300BCCE55 /* AppDelegate.swift in Sources */, 295 | 2EA4E2441C118DE9007B50DD /* CustomTransition.swift in Sources */, 296 | 2EA5A5AD1C1E8A6E0018DBA6 /* DataModel.swift in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | 2E9D6A601BF3382300BCCE55 /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | 2E9D6A691BF3382300BCCE55 /* TrainerTests.swift in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | 2E9D6A6B1BF3382300BCCE55 /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 2E9D6A741BF3382300BCCE55 /* TrainerUITests.swift in Sources */, 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | }; 316 | /* End PBXSourcesBuildPhase section */ 317 | 318 | /* Begin PBXTargetDependency section */ 319 | 2E9D6A661BF3382300BCCE55 /* PBXTargetDependency */ = { 320 | isa = PBXTargetDependency; 321 | target = 2E9D6A4F1BF3382300BCCE55 /* Trainer */; 322 | targetProxy = 2E9D6A651BF3382300BCCE55 /* PBXContainerItemProxy */; 323 | }; 324 | 2E9D6A711BF3382300BCCE55 /* PBXTargetDependency */ = { 325 | isa = PBXTargetDependency; 326 | target = 2E9D6A4F1BF3382300BCCE55 /* Trainer */; 327 | targetProxy = 2E9D6A701BF3382300BCCE55 /* PBXContainerItemProxy */; 328 | }; 329 | /* End PBXTargetDependency section */ 330 | 331 | /* Begin PBXVariantGroup section */ 332 | 2E9D6A571BF3382300BCCE55 /* Main.storyboard */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 2E9D6A581BF3382300BCCE55 /* Base */, 336 | ); 337 | name = Main.storyboard; 338 | sourceTree = ""; 339 | }; 340 | 2E9D6A5C1BF3382300BCCE55 /* LaunchScreen.storyboard */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 2E9D6A5D1BF3382300BCCE55 /* Base */, 344 | ); 345 | name = LaunchScreen.storyboard; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXVariantGroup section */ 349 | 350 | /* Begin XCBuildConfiguration section */ 351 | 2E9D6A761BF3382300BCCE55 /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INT_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN_UNREACHABLE_CODE = YES; 367 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 368 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 369 | COPY_PHASE_STRIP = NO; 370 | DEBUG_INFORMATION_FORMAT = dwarf; 371 | ENABLE_STRICT_OBJC_MSGSEND = YES; 372 | ENABLE_TESTABILITY = YES; 373 | GCC_C_LANGUAGE_STANDARD = gnu99; 374 | GCC_DYNAMIC_NO_PIC = NO; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_OPTIMIZATION_LEVEL = 0; 377 | GCC_PREPROCESSOR_DEFINITIONS = ( 378 | "DEBUG=1", 379 | "$(inherited)", 380 | ); 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 388 | MTL_ENABLE_DEBUG_INFO = YES; 389 | ONLY_ACTIVE_ARCH = YES; 390 | SDKROOT = iphoneos; 391 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 392 | }; 393 | name = Debug; 394 | }; 395 | 2E9D6A771BF3382300BCCE55 /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ALWAYS_SEARCH_USER_PATHS = NO; 399 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 400 | CLANG_CXX_LIBRARY = "libc++"; 401 | CLANG_ENABLE_MODULES = YES; 402 | CLANG_ENABLE_OBJC_ARC = YES; 403 | CLANG_WARN_BOOL_CONVERSION = YES; 404 | CLANG_WARN_CONSTANT_CONVERSION = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INT_CONVERSION = YES; 409 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 410 | CLANG_WARN_UNREACHABLE_CODE = YES; 411 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 412 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 413 | COPY_PHASE_STRIP = NO; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | ENABLE_NS_ASSERTIONS = NO; 416 | ENABLE_STRICT_OBJC_MSGSEND = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 426 | MTL_ENABLE_DEBUG_INFO = NO; 427 | SDKROOT = iphoneos; 428 | VALIDATE_PRODUCT = YES; 429 | }; 430 | name = Release; 431 | }; 432 | 2E9D6A791BF3382300BCCE55 /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 436 | INFOPLIST_FILE = Trainer/Info.plist; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 438 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.Trainer; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | }; 441 | name = Debug; 442 | }; 443 | 2E9D6A7A1BF3382300BCCE55 /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 447 | INFOPLIST_FILE = Trainer/Info.plist; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.Trainer; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | }; 452 | name = Release; 453 | }; 454 | 2E9D6A7C1BF3382300BCCE55 /* Debug */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | BUNDLE_LOADER = "$(TEST_HOST)"; 458 | INFOPLIST_FILE = TrainerTests/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.TrainerTests; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Trainer.app/Trainer"; 463 | }; 464 | name = Debug; 465 | }; 466 | 2E9D6A7D1BF3382300BCCE55 /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | BUNDLE_LOADER = "$(TEST_HOST)"; 470 | INFOPLIST_FILE = TrainerTests/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 472 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.TrainerTests; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Trainer.app/Trainer"; 475 | }; 476 | name = Release; 477 | }; 478 | 2E9D6A7F1BF3382300BCCE55 /* Debug */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | INFOPLIST_FILE = TrainerUITests/Info.plist; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.TrainerUITests; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | TEST_TARGET_NAME = Trainer; 486 | USES_XCTRUNNER = YES; 487 | }; 488 | name = Debug; 489 | }; 490 | 2E9D6A801BF3382300BCCE55 /* Release */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | INFOPLIST_FILE = TrainerUITests/Info.plist; 494 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 495 | PRODUCT_BUNDLE_IDENTIFIER = com.MartinStudio.TrainerUITests; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | TEST_TARGET_NAME = Trainer; 498 | USES_XCTRUNNER = YES; 499 | }; 500 | name = Release; 501 | }; 502 | /* End XCBuildConfiguration section */ 503 | 504 | /* Begin XCConfigurationList section */ 505 | 2E9D6A4B1BF3382300BCCE55 /* Build configuration list for PBXProject "Trainer" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 2E9D6A761BF3382300BCCE55 /* Debug */, 509 | 2E9D6A771BF3382300BCCE55 /* Release */, 510 | ); 511 | defaultConfigurationIsVisible = 0; 512 | defaultConfigurationName = Release; 513 | }; 514 | 2E9D6A781BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "Trainer" */ = { 515 | isa = XCConfigurationList; 516 | buildConfigurations = ( 517 | 2E9D6A791BF3382300BCCE55 /* Debug */, 518 | 2E9D6A7A1BF3382300BCCE55 /* Release */, 519 | ); 520 | defaultConfigurationIsVisible = 0; 521 | defaultConfigurationName = Release; 522 | }; 523 | 2E9D6A7B1BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "TrainerTests" */ = { 524 | isa = XCConfigurationList; 525 | buildConfigurations = ( 526 | 2E9D6A7C1BF3382300BCCE55 /* Debug */, 527 | 2E9D6A7D1BF3382300BCCE55 /* Release */, 528 | ); 529 | defaultConfigurationIsVisible = 0; 530 | defaultConfigurationName = Release; 531 | }; 532 | 2E9D6A7E1BF3382300BCCE55 /* Build configuration list for PBXNativeTarget "TrainerUITests" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 2E9D6A7F1BF3382300BCCE55 /* Debug */, 536 | 2E9D6A801BF3382300BCCE55 /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | /* End XCConfigurationList section */ 542 | }; 543 | rootObject = 2E9D6A481BF3382300BCCE55 /* Project object */; 544 | } 545 | -------------------------------------------------------------------------------- /Trainer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Trainer.xcodeproj/project.xcworkspace/xcuserdata/MartinRGB.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer.xcodeproj/project.xcworkspace/xcuserdata/MartinRGB.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Trainer.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Trainer.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcschemes/Trainer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Trainer.xcodeproj/xcuserdata/MartinRGB.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Trainer.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2E9D6A4F1BF3382300BCCE55 16 | 17 | primary 18 | 19 | 20 | 2E9D6A631BF3382300BCCE55 21 | 22 | primary 23 | 24 | 25 | 2E9D6A6E1BF3382300BCCE55 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Trainer/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/11/11. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillResignActive(application: UIApplication) { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | func applicationDidEnterBackground(application: UIApplication) { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(application: UIApplication) { 32 | // 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. 33 | } 34 | 35 | func applicationDidBecomeActive(application: UIApplication) { 36 | // 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. 37 | } 38 | 39 | func applicationWillTerminate(application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Trainer/Assets.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 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Add.imageset/Add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Add.imageset/Add@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Add@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Add2.imageset/Add2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Add2.imageset/Add2.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Add2.imageset/Add2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Add2.imageset/Add2@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Add2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Add2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Add2@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Arrow.imageset/Arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Arrow.imageset/Arrow@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Arrow@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Explore.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Explore@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Explore.imageset/Explore@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Explore.imageset/Explore@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/FakeTopBar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "FakeTopBar.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "FakeTopBar@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/FakeTopBar.imageset/FakeTopBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/FakeTopBar.imageset/FakeTopBar.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/FakeTopBar.imageset/FakeTopBar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/FakeTopBar.imageset/FakeTopBar@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Glass.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Glass@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Glass.imageset/Glass@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Glass.imageset/Glass@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Menu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Menu@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/Menu.imageset/Menu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/Menu.imageset/Menu@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/RealBG.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "RealBG.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "RealBG@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/RealBG.imageset/RealBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/RealBG.imageset/RealBG.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/RealBG.imageset/RealBG@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/RealBG.imageset/RealBG@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/TopBar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TopBar.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TopBar@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/TopBar.imageset/TopBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/TopBar.imageset/TopBar.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/TopBar.imageset/TopBar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/TopBar.imageset/TopBar@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/bgDown.imageset/BG Down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/bgDown.imageset/BG Down@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/bgDown.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "BG Down@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card0.imageset/Card0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/card0.imageset/Card0.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Card0.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card1.imageset/Card1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/card1.imageset/Card1@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Card1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card2.imageset/Card2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/card2.imageset/Card2@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Card2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card3.imageset/Card3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page1/card3.imageset/Card3@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page1/card3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Card3@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar1.imageset/Avatar1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar1.imageset/Avatar1.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar1.imageset/Avatar1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar1.imageset/Avatar1@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Avatar1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Avatar1@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar2.imageset/Avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar2.imageset/Avatar2.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar2.imageset/Avatar2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar2.imageset/Avatar2@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Avatar2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Avatar2@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar3.imageset/Avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar3.imageset/Avatar3.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar3.imageset/Avatar3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/Avatar3.imageset/Avatar3@2x.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Avatar3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Avatar3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Avatar3@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/TableViewArrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "TableViewArrow.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "TableViewArrow@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/TableViewArrow.imageset/TableViewArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/TableViewArrow.imageset/TableViewArrow.png -------------------------------------------------------------------------------- /Trainer/Assets.xcassets/Page2/TableViewArrow.imageset/TableViewArrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/Trainer/Assets.xcassets/Page2/TableViewArrow.imageset/TableViewArrow@2x.png -------------------------------------------------------------------------------- /Trainer/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Trainer/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 89 | 96 | 97 | 98 | 99 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 145 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /Trainer/CustomTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTableViewCell.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/13. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | class CustomTableViewCell: UITableViewCell { 14 | 15 | @IBOutlet weak var avatarImageView: UIImageView! 16 | @IBOutlet weak var courseNameLabel: UILabel! 17 | @IBOutlet weak var teacherNameLabel: UILabel! 18 | @IBOutlet weak var processingBarView: UIView! 19 | @IBOutlet weak var totalProcessingBarView: UIView! 20 | @IBOutlet weak var classLabel: UILabel! 21 | @IBOutlet weak var finishedLabel: UILabel! 22 | @IBOutlet weak var totalClassLabel: UILabel! 23 | @IBOutlet weak var classDataView: UIView! 24 | @IBOutlet weak var totalStudentView: UIView! 25 | 26 | var feed:FeedInfo! 27 | var cellDuringColor:UIColor! 28 | 29 | var tensSliderContainer:SliderLabelContainer! 30 | var singleSliderContainer:SliderLabelContainer! 31 | 32 | var hundredStudentConatiner = SliderLabelContainer(frame: CGRectMake(-3, 21, 26, 30), type: SliderLabelContainerType.HundredDigitType,fontsize:36,color:UIColor.deepBlueColor) 33 | var tenStudentConatiner = SliderLabelContainer(frame: CGRectMake(15, 21, 26, 30), type: SliderLabelContainerType.TensDigitType,fontsize:36,color:UIColor.deepBlueColor) 34 | var singleStudentConatiner = SliderLabelContainer(frame: CGRectMake(34, 21, 26, 30), type: SliderLabelContainerType.SingleDigitType,fontsize:36,color:UIColor.deepBlueColor) 35 | 36 | override func awakeFromNib() { 37 | super.awakeFromNib() 38 | 39 | totalStudentView.addSubview(hundredStudentConatiner) 40 | totalStudentView.addSubview(tenStudentConatiner) 41 | totalStudentView.addSubview(singleStudentConatiner) 42 | 43 | // Initialization code 44 | } 45 | 46 | override func layoutSubviews() { 47 | 48 | if((tensSliderContainer) != nil){ 49 | tensSliderContainer.removeFromSuperview() 50 | } 51 | if((singleSliderContainer) != nil){ 52 | singleSliderContainer.removeFromSuperview() 53 | } 54 | 55 | courseNameLabel?.text = feed.courseName 56 | teacherNameLabel?.text = feed.coachName 57 | avatarImageView?.image = feed.coachAvatar 58 | 59 | let color:UIColor = feed.primaryColor 60 | classLabel?.textColor = color 61 | finishedLabel?.textColor = color 62 | processingBarView.backgroundColor = color 63 | totalProcessingBarView.backgroundColor = feed.alphaColor 64 | totalClassLabel?.text = "of \(feed.totalClass)" 65 | 66 | //Imp:Progress Bar & Number 67 | 68 | totalProcessingBarView.clipsToBounds = true 69 | cellDuringColor = color 70 | 71 | tensSliderContainer = SliderLabelContainer(frame: CGRectMake(6, 22, 35, 45), type: SliderLabelContainerType.TensDigitType,fontsize:54,color:cellDuringColor) 72 | singleSliderContainer = SliderLabelContainer(frame: CGRectMake(34, 22, 36, 45), type: SliderLabelContainerType.SingleDigitType,fontsize:54,color:cellDuringColor) 73 | 74 | classDataView.addSubview(tensSliderContainer) 75 | classDataView.addSubview(singleSliderContainer) 76 | 77 | UIView.animateWithDuration(1, delay: 0.15 , options: UIViewAnimationOptions.CurveEaseOut, animations: { () -> Void in 78 | 79 | self.processingBarView.transform = CGAffineTransformMakeTranslation(self.totalProcessingBarView.frame.size.width * self.feed.process, 0) 80 | 81 | let num = self.feed.duringClass 82 | self.startLoadNumber(num) 83 | 84 | let num2 = self.feed.totalStudent 85 | self.startLoadStudentNumber(num2) 86 | },completion: nil) 87 | } 88 | 89 | override func setSelected(selected: Bool, animated: Bool) { 90 | super.setSelected(selected, animated: animated) 91 | 92 | // Configure the view for the selected state 93 | } 94 | 95 | //######## Function MARK:Status Bar Hidden Method ######## 96 | func startLoadNumber(num:Int){ 97 | let tensDigit:Int = num/10 98 | let singleDigit:Int = num%10 99 | 100 | tensSliderContainer.scrollToNum(tensDigit) 101 | singleSliderContainer.scrollToNum(singleDigit) 102 | 103 | } 104 | 105 | func startLoadStudentNumber(num:Int){ 106 | let hundredDigit:Int = num/100 107 | let tensDigit:Int = (num - Int(num/100) * 100)/10 108 | let singleDigit:Int = num%10 109 | 110 | hundredStudentConatiner.scrollToNum(hundredDigit) 111 | tenStudentConatiner.scrollToNum(tensDigit) 112 | singleStudentConatiner.scrollToNum(singleDigit) 113 | 114 | 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /Trainer/CustomTransition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTransition.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/4. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /Trainer/DataModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataModel.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/14. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | struct FeedInfo { 12 | 13 | let primaryColor:UIColor 14 | let alphaColor:UIColor 15 | let coachAvatar:UIImage 16 | let courseName:String! 17 | let coachName:String! 18 | let duringClass:Int! 19 | let totalClass:Int! 20 | let process:CGFloat 21 | let totalStudent:Int! 22 | 23 | } 24 | 25 | let feedData = [ 26 | 27 | FeedInfo(primaryColor: UIColor.flatBlueColor, alphaColor: UIColor.flatBlueAlphaColor, coachAvatar: UIImage(named:"Avatar1")!, courseName: "Elite Diving Course", coachName: "Daryl Fox", duringClass: 21, totalClass: 35, process: 21/35, totalStudent: 264), 28 | 29 | FeedInfo(primaryColor: UIColor.flatYellowColor, alphaColor: UIColor.flatYellowAlphaColor, coachAvatar: UIImage(named:"Avatar2")!, courseName: "iOS Newbie Camp", coachName: "Luis Rodriguez", duringClass: 16, totalClass: 32, process: 16/32, totalStudent: 342), 30 | 31 | FeedInfo(primaryColor: UIColor.flatRedColor,alphaColor:UIColor.flatRedAlphaColor, coachAvatar: UIImage(named:"Avatar3")!, courseName: "The Color Master", coachName: "Taylor Rodriguez", duringClass: 32, totalClass: 42, process: 32/42, totalStudent: 768), 32 | 33 | FeedInfo(primaryColor: UIColor.flatBlueColor, alphaColor: UIColor.flatBlueAlphaColor, coachAvatar: UIImage(named:"Avatar1")!, courseName: "Elite Diving Course", coachName: "Daryl Fox", duringClass: 21, totalClass: 35, process: 21/35, totalStudent: 264), 34 | 35 | FeedInfo(primaryColor: UIColor.flatYellowColor, alphaColor: UIColor.flatYellowAlphaColor, coachAvatar: UIImage(named:"Avatar2")!, courseName: "iOS Newbie Camp", coachName: "Luis Rodriguez", duringClass: 16, totalClass: 32, process: 16/32, totalStudent: 342), 36 | 37 | FeedInfo(primaryColor: UIColor.flatRedColor,alphaColor:UIColor.flatRedAlphaColor, coachAvatar: UIImage(named:"Avatar3")!, courseName: "The Color Master", coachName: "Taylor Rodriguez", duringClass: 32, totalClass: 42, process: 32/42, totalStudent: 768), 38 | 39 | FeedInfo(primaryColor: UIColor.flatBlueColor, alphaColor: UIColor.flatBlueAlphaColor, coachAvatar: UIImage(named:"Avatar1")!, courseName: "Elite Diving Course", coachName: "Daryl Fox", duringClass: 21, totalClass: 35, process: 21/35, totalStudent: 264), 40 | 41 | FeedInfo(primaryColor: UIColor.flatYellowColor, alphaColor: UIColor.flatYellowAlphaColor, coachAvatar: UIImage(named:"Avatar2")!, courseName: "iOS Newbie Camp", coachName: "Luis Rodriguez", duringClass: 16, totalClass: 32, process: 16/32, totalStudent: 342), 42 | 43 | FeedInfo(primaryColor: UIColor.flatRedColor,alphaColor:UIColor.flatRedAlphaColor, coachAvatar: UIImage(named:"Avatar3")!, courseName: "The Color Master", coachName: "Taylor Rodriguez", duringClass: 32, totalClass: 42, process: 32/42, totalStudent: 768), 44 | 45 | FeedInfo(primaryColor: UIColor.flatBlueColor, alphaColor: UIColor.flatBlueAlphaColor, coachAvatar: UIImage(named:"Avatar1")!, courseName: "Elite Diving Course", coachName: "Daryl Fox", duringClass: 21, totalClass: 35, process: 21/35, totalStudent: 264) 46 | 47 | ] -------------------------------------------------------------------------------- /Trainer/FloatingButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FloatingButton.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/15. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FloatingButton: UIButton { 12 | 13 | 14 | convenience init(image:UIImage?, backgroundColor:UIColor = UIColor.fabBlueColor){ 15 | self.init() 16 | setImage(image, forState: .Normal) 17 | setBackgroundImage(backgroundColor.pixelImage, forState: .Normal) 18 | } 19 | 20 | init(){ 21 | super.init(frame:CGRect(x: 0,y: 0,width: UIScreen.mainScreen().bounds.width * 0.16,height: UIScreen.mainScreen().bounds.width * 0.16)) 22 | setup() 23 | } 24 | 25 | required init(coder aDecoder: NSCoder) { 26 | super.init(coder: aDecoder)! 27 | } 28 | 29 | override func awakeFromNib() { 30 | super.awakeFromNib() 31 | setup() 32 | } 33 | 34 | func setup() { 35 | tintColor = UIColor.whiteColor() 36 | 37 | if backgroundImageForState(.Normal) == nil { 38 | setBackgroundImage(UIColor.flatBlueColor.pixelImage, forState: .Normal) 39 | } 40 | 41 | 42 | layer.cornerRadius = frame.width/2 43 | layer.masksToBounds = true 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Trainer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Trainer/OnBoardingViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/11/11. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class OnBoardingViewController: UIViewController { 12 | 13 | //######## Delcare MARK:Delcare constants & variable ######## 14 | let card0:UIImageView! = UIImageView() 15 | let card1:UIImageView! = UIImageView() 16 | let card2:UIImageView! = UIImageView() 17 | let card3:UIImageView! = UIImageView() 18 | let bgDown:UIImageView! = UIImageView() 19 | let bgUp:UIImageView! = UIImageView() 20 | 21 | let arrow:UIImageView! = UIImageView() 22 | let explore:UIImageView! = UIImageView() 23 | let addImageView:UIImageView! = UIImageView() 24 | let fakeTabBarImageView:UIImageView = UIImageView() 25 | 26 | let wave:CAShapeLayer! = CAShapeLayer() 27 | let waveforCard:CAShapeLayer! = CAShapeLayer() 28 | var rectangleFABLayer:CAShapeLayer! = CAShapeLayer() 29 | var rectangleBlurFABLayer:CAShapeLayer! = CAShapeLayer() 30 | 31 | var rectanglePath:UIBezierPath! = UIBezierPath() 32 | var rectangleBlurPath:UIBezierPath! = UIBezierPath() 33 | 34 | 35 | let waveMaskView:UIView! = UIView() 36 | let waveMaskViewforCard:UIView! = UIView() 37 | let cardContainer:UIView! = UIView() 38 | let containerViewForFAB:UIView! = UIView() 39 | 40 | let tapRec:UITapGestureRecognizer = UITapGestureRecognizer() 41 | 42 | //######## Setup MARK:ViewDidLoad ######## 43 | override func viewDidLoad() { 44 | super.viewDidLoad() 45 | 46 | 47 | 48 | } 49 | 50 | //######## Setup MARK:ViewWillAppear ######## 51 | override func viewWillAppear(animated: Bool) { 52 | super.viewWillAppear(true) 53 | 54 | self.navigationController?.setNavigationBarHidden(true, animated: false) 55 | 56 | 57 | recycleAnimation() 58 | setup() 59 | drawFABinView() 60 | animationSetup() 61 | animationFABSetup() 62 | 63 | } 64 | 65 | //######## Setup MARK:cycle Animation ######## 66 | func recycleAnimation() 67 | { 68 | fakeTabBarImageView.removeFromSuperview() 69 | card0.layer.removeAllAnimations() 70 | card1.layer.removeAllAnimations() 71 | card2.layer.removeAllAnimations() 72 | card3.layer.removeAllAnimations() 73 | waveMaskView.layer.removeAllAnimations() 74 | waveMaskViewforCard.layer.removeAllAnimations() 75 | containerViewForFAB.layer.removeAllAnimations() 76 | rectangleBlurFABLayer.removeAllAnimations() 77 | rectangleFABLayer.removeAllAnimations() 78 | arrow.layer.removeAllAnimations() 79 | explore.layer.removeAllAnimations() 80 | wave.removeAllAnimations() 81 | addImageView.layer.removeAllAnimations() 82 | 83 | } 84 | //######## Setup MARK:hide The Status Bar ######## 85 | override func prefersStatusBarHidden() -> Bool { 86 | return true 87 | } 88 | 89 | 90 | //######## Setup MARK:Setup Asset ######## 91 | func setup(){ 92 | 93 | // MARK: Wave Background 94 | bgDown.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) 95 | bgDown.image = UIImage(named: "bgDown") 96 | self.view.addSubview(bgDown) 97 | 98 | bgUp.frame = CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height) 99 | bgUp.image = UIImage(named: "RealBG") 100 | self.view.addSubview(bgUp) 101 | 102 | 103 | 104 | // MARK: Card 105 | let cardXPosition = 1.08 * self.view.frame.size.width 106 | let cardWidth = 0.859 * self.view.frame.size.width 107 | let cardHeight = 0.216 * self.view.frame.size.height 108 | 109 | // MARK: Container for Card 110 | cardContainer.frame = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) 111 | self.view.addSubview(cardContainer) 112 | 113 | card1.frame = CGRectMake(cardXPosition, 0.166 * self.view.frame.size.height, cardWidth, cardHeight) 114 | card1.image = UIImage(named: "card1") 115 | cardContainer.addSubview(card1) 116 | 117 | card2.frame = CGRectMake(cardXPosition, 0.398 * self.view.frame.size.height, cardWidth, cardHeight) 118 | card2.image = UIImage(named: "card2") 119 | cardContainer.addSubview(card2) 120 | 121 | card3.frame = CGRectMake(cardXPosition, 0.628 * self.view.frame.size.height, cardWidth, cardHeight) 122 | card3.image = UIImage(named: "card3") 123 | cardContainer.addSubview(card3) 124 | 125 | // MARK:Add bezierpath to CAShaplyer then to UIView(as maskView) 126 | self.wave.path = createOriginalBGMask() 127 | wave.fillColor = UIColor(red: 0, green: 0, blue: 0, alpha: 1).CGColor 128 | wave.frame = CGRectMake(0,0,self.view.frame.size.width,0.954 * self.view.frame.height) 129 | 130 | self.waveforCard.path = createCardMask() 131 | waveforCard.fillColor = UIColor(red: 0.5, green: 0.5, blue: 0.5, alpha: 1).CGColor 132 | waveforCard.frame = CGRectMake(0,0,self.view.frame.size.width,0.954 * self.view.frame.height) 133 | 134 | 135 | 136 | waveMaskView.frame = CGRectMake(0,-0.954 * self.view.frame.height,self.view.frame.width,0.954 * self.view.frame.height) 137 | waveMaskView.layer.addSublayer(wave) 138 | 139 | waveMaskViewforCard.frame = CGRectMake(0,-0.954 * self.view.frame.height,self.view.frame.width,0.954 * self.view.frame.height) 140 | waveMaskViewforCard.layer.addSublayer(waveforCard) 141 | 142 | 143 | bgUp.maskView = waveMaskView 144 | cardContainer.maskView = waveMaskViewforCard 145 | 146 | // MARK: Text 147 | card0.frame = CGRectMake(1.096 * self.view.frame.size.width , 0.048 * self.view.frame.size.height, 0.808 * self.view.frame.size.width, 0.068 * self.view.frame.size.height) 148 | card0.image = UIImage(named: "card0") 149 | self.view.insertSubview(card0, aboveSubview: bgUp) 150 | 151 | 152 | } 153 | 154 | 155 | //######## Anim MARK:Setup Animation ######## 156 | func animationSetup(){ 157 | 158 | let initTime = CACurrentMediaTime() + 0.45 159 | 160 | //0 161 | let card0CommonAnimx = CABasicAnimation(keyPath: "position.x") 162 | card0CommonAnimx.beginTime = initTime 163 | card0CommonAnimx.duration = 0.8 164 | card0CommonAnimx.toValue = self.view.frame.width/2 165 | card0CommonAnimx.removedOnCompletion = false 166 | card0CommonAnimx.autoreverses = false 167 | card0CommonAnimx.fillMode = kCAFillModeForwards 168 | card0CommonAnimx.timingFunction = CAMediaTimingFunction(controlPoints: 0.0198866546154, 0.73028874407181, 0.35400216579437, 1) 169 | 170 | card0.layer.addAnimation(card0CommonAnimx, forKey: "card0Positionx") 171 | 172 | let card0CommonAnims = CABasicAnimation(keyPath: "transform") 173 | card0CommonAnims.beginTime = initTime 174 | card0CommonAnims.duration = 0.8 175 | card0CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.15, 0.95, 1.0)) 176 | card0CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 177 | card0CommonAnims.removedOnCompletion = false 178 | card0CommonAnims.autoreverses = false 179 | card0CommonAnims.fillMode = kCAFillModeForwards 180 | card0CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.33333333, 0, 0.66666667, 1) 181 | 182 | card0.layer.addAnimation(card0CommonAnims, forKey: "card0Positions") 183 | 184 | //1 185 | let card1CommonAnimx = CABasicAnimation(keyPath: "position.x") 186 | card1CommonAnimx.beginTime = initTime + 4/30 187 | card1CommonAnimx.duration = 0.8 188 | card1CommonAnimx.toValue = self.view.frame.width/2 189 | card1CommonAnimx.removedOnCompletion = false 190 | card1CommonAnimx.autoreverses = false 191 | card1CommonAnimx.fillMode = kCAFillModeForwards 192 | card1CommonAnimx.timingFunction = CAMediaTimingFunction(controlPoints: 0.0198866546154, 0.73028874407181, 0.35400216579437, 1) 193 | 194 | card1.layer.addAnimation(card1CommonAnimx, forKey: "card1Positionx") 195 | 196 | let card1CommonAnims = CABasicAnimation(keyPath: "transform") 197 | card1CommonAnims.beginTime = initTime + 4/30 198 | card1CommonAnims.duration = 0.8 199 | card1CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.15, 0.95, 1.0)) 200 | card1CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 201 | card1CommonAnims.removedOnCompletion = false 202 | card1CommonAnims.autoreverses = false 203 | card1CommonAnims.fillMode = kCAFillModeForwards 204 | card1CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.33333333, 0, 0.66666667, 1) 205 | 206 | card1.layer.addAnimation(card1CommonAnims, forKey: "card1Positions") 207 | 208 | //2 209 | let card2CommonAnimx = CABasicAnimation(keyPath: "position.x") 210 | card2CommonAnimx.beginTime = initTime + 8/30 211 | card2CommonAnimx.duration = 0.8 212 | card2CommonAnimx.toValue = self.view.frame.width/2 213 | card2CommonAnimx.removedOnCompletion = false 214 | card2CommonAnimx.autoreverses = false 215 | card2CommonAnimx.fillMode = kCAFillModeForwards 216 | card2CommonAnimx.timingFunction = CAMediaTimingFunction(controlPoints: 0.0198866546154, 0.73028874407181, 0.35400216579437, 1) 217 | 218 | card2.layer.addAnimation(card2CommonAnimx, forKey: "card2Positionx") 219 | 220 | let card2CommonAnims = CABasicAnimation(keyPath: "transform") 221 | card2CommonAnims.beginTime = initTime + 8/30 222 | card2CommonAnims.duration = 0.8 223 | card2CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.15, 0.95, 1.0)) 224 | card2CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 225 | card2CommonAnims.removedOnCompletion = false 226 | card2CommonAnims.autoreverses = false 227 | card2CommonAnims.fillMode = kCAFillModeForwards 228 | card2CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.33333333, 0, 0.66666667, 1) 229 | 230 | card2.layer.addAnimation(card2CommonAnims, forKey: "card2Positions") 231 | 232 | //3 233 | let card3CommonAnimx = CABasicAnimation(keyPath: "position.x") 234 | card3CommonAnimx.beginTime = initTime + 12/30 235 | card3CommonAnimx.duration = 0.8 236 | card3CommonAnimx.toValue = self.view.frame.width/2 237 | card3CommonAnimx.removedOnCompletion = false 238 | card3CommonAnimx.autoreverses = false 239 | card3CommonAnimx.fillMode = kCAFillModeForwards 240 | card3CommonAnimx.timingFunction = CAMediaTimingFunction(controlPoints: 0.0198866546154, 0.73028874407181, 0.35400216579437, 1) 241 | 242 | card3.layer.addAnimation(card3CommonAnimx, forKey: "card3Positionx") 243 | 244 | let card3CommonAnims = CABasicAnimation(keyPath: "transform") 245 | card3CommonAnims.beginTime = initTime + 12/30 246 | card3CommonAnims.duration = 0.8 247 | card3CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.15, 0.95, 1.0)) 248 | card3CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 249 | card3CommonAnims.removedOnCompletion = false 250 | card3CommonAnims.autoreverses = false 251 | card3CommonAnims.fillMode = kCAFillModeForwards 252 | card3CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.33333333, 0, 0.66666667, 1) 253 | 254 | card3.layer.addAnimation(card3CommonAnims, forKey: "transform") 255 | 256 | //maskBG 257 | let maskViewY = CABasicAnimation(keyPath: "bounds") 258 | let currentYPositon = CGRectMake(0,-0.954 * self.view.frame.height,self.view.frame.width,0.954 * self.view.frame.height) 259 | let afterYPosition = CGRectMake(0,0,self.view.frame.width,0.954 * self.view.frame.height) 260 | maskViewY.beginTime = initTime 261 | maskViewY.duration = 0.8 + 1/30 262 | maskViewY.fromValue = NSValue(CGRect:afterYPosition) 263 | maskViewY.toValue = NSValue(CGRect:currentYPositon) 264 | maskViewY.removedOnCompletion = false 265 | maskViewY.autoreverses = false 266 | maskViewY.fillMode = kCAFillModeForwards 267 | maskViewY.timingFunction = CAMediaTimingFunction(controlPoints: 0.10197902679443, 0.4998767276381, 0.53825780883972, 1) 268 | 269 | waveMaskView.layer.addAnimation(maskViewY, forKey: "maskViewY") 270 | 271 | //maskCard 272 | let maskCardViewY = CABasicAnimation(keyPath: "bounds") 273 | let currentYPositonCard = CGRectMake(0,-0.954 * self.view.frame.height,self.view.frame.width,0.954 * self.view.frame.height) 274 | let afterYPositionCard = CGRectMake(0,0,self.view.frame.width,0.954 * self.view.frame.height) 275 | maskCardViewY.beginTime = initTime + 0.1 276 | maskCardViewY.duration = 0.8 + 1/30 277 | maskCardViewY.fromValue = NSValue(CGRect:afterYPositionCard) 278 | maskCardViewY.toValue = NSValue(CGRect:currentYPositonCard) 279 | maskCardViewY.removedOnCompletion = false 280 | maskCardViewY.autoreverses = false 281 | maskCardViewY.fillMode = kCAFillModeForwards 282 | maskCardViewY.timingFunction = CAMediaTimingFunction(controlPoints: 0.10197902679443, 0.4998767276381, 0.53825780883972, 1) 283 | 284 | waveMaskViewforCard.layer.addAnimation(maskCardViewY, forKey: "maskViewY") 285 | 286 | } 287 | 288 | //######## Setup MARK:Draw FAB Button ######## 289 | func drawFABinView(){ 290 | 291 | let context = UIGraphicsGetCurrentContext() 292 | 293 | //Container for FAB 294 | 295 | containerViewForFAB.frame = CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281, 0.873 * self.view.frame.size.height, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.155) 296 | self.view.addSubview(containerViewForFAB) 297 | //self.navigationController!.view.addSubview(containerViewForFAB) 298 | 299 | //FAB Path 300 | rectanglePath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.084, self.view.frame.size.height * 0.883, self.view.frame.size.width * 0.168, self.view.frame.size.width * 0.168), cornerRadius: self.view.frame.size.width * 0.084) 301 | CGContextSaveGState(context) 302 | rectanglePath.fill() 303 | 304 | rectangleBlurPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.084+3, self.view.frame.size.height * 0.883+4, self.view.frame.size.width * 0.168, self.view.frame.size.width * 0.168), cornerRadius: self.view.frame.size.width * 0.084) 305 | CGContextSaveGState(context) 306 | rectangleBlurPath.fill() 307 | 308 | //ShapeLayer(Base & Blur) 309 | self.rectangleFABLayer.path = rectanglePath.CGPath 310 | rectangleFABLayer.fillColor = UIColor.fabBlueColor.CGColor 311 | rectangleFABLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) 312 | 313 | rectangleBlurFABLayer.path = rectangleBlurPath.CGPath 314 | rectangleBlurFABLayer.fillColor = UIColor.fabShadowColor.CGColor 315 | rectangleBlurFABLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) 316 | 317 | containerViewForFAB.layer.addSublayer(rectangleBlurFABLayer) 318 | containerViewForFAB.layer.addSublayer(rectangleFABLayer) 319 | 320 | //Arrow & Text & Add Image 321 | arrow.image = UIImage(named: "Arrow") 322 | arrow.frame = CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.0425, self.view.frame.size.height * 0.918, self.view.frame.size.width * 0.085, self.view.frame.size.width * 0.045) 323 | 324 | explore.image = UIImage(named: "Explore") 325 | explore.frame = CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.3595, self.view.frame.size.height * 0.921, self.view.frame.size.width * 0.211, self.view.frame.size.width * 0.067) 326 | 327 | addImageView.image = UIImage(named: "Add") 328 | addImageView.frame = CGRectMake(self.view.frame.size.width * (0.5 - 0.0826/2) , 0.918 * self.view.frame.size.height, 0.0826 * self.view.frame.size.width, 0.0826 * self.view.frame.size.width) 329 | addImageView.layer.transform = CATransform3DMakeScale(0, 0, 0) 330 | 331 | //Add to Superview & Setting 332 | containerViewForFAB.addSubview(arrow) 333 | containerViewForFAB.addSubview(explore) 334 | containerViewForFAB.addSubview(addImageView) 335 | containerViewForFAB.alpha = 0.8 336 | 337 | CGContextRestoreGState(context) 338 | 339 | 340 | } 341 | 342 | //######## Anim MARK:Animate FAB Button ######## 343 | func animationFABSetup() { 344 | 345 | 346 | let initTime = CACurrentMediaTime() + 0.45 + 1/6 347 | 348 | //Ball 349 | let containerViewForFABY = CABasicAnimation(keyPath: "bounds") 350 | let currentYPositonCard = CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281, 0.908 * self.view.frame.size.height, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.119) 351 | let afterYPositionCard = CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281, 0.686 * self.view.frame.size.height, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.119) 352 | containerViewForFABY.beginTime = initTime 353 | containerViewForFABY.duration = 1 + 14/30 354 | containerViewForFABY.fromValue = NSValue(CGRect:afterYPositionCard) 355 | containerViewForFABY.toValue = NSValue(CGRect:currentYPositonCard) 356 | containerViewForFABY.removedOnCompletion = false 357 | containerViewForFABY.autoreverses = false 358 | containerViewForFABY.fillMode = kCAFillModeForwards 359 | containerViewForFABY.timingFunction = CAMediaTimingFunction(controlPoints: 0.09147787840335, 1.71311978494373, 0.17607621676994, 0.83763306077712) 360 | 361 | containerViewForFAB.layer.addAnimation(containerViewForFABY, forKey: "maskViewY") 362 | 363 | //Btn 364 | let btnPath = CABasicAnimation(keyPath: "path") 365 | let fromPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.084, self.view.frame.size.height * 0.883, self.view.frame.size.width * 0.168, self.view.frame.size.width * 0.168), cornerRadius: self.view.frame.size.width * 0.084) 366 | 367 | let toPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281, self.view.frame.size.height * (0.883+0.025), self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.118), cornerRadius: self.view.frame.size.width * 0.118) 368 | 369 | btnPath.beginTime = initTime + 5/6 370 | btnPath.duration = 0.5 371 | btnPath.fromValue = fromPath.CGPath 372 | btnPath.toValue = toPath.CGPath 373 | btnPath.removedOnCompletion = false 374 | btnPath.autoreverses = false 375 | btnPath.fillMode = kCAFillModeForwards 376 | btnPath.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 377 | 378 | rectangleFABLayer.addAnimation(btnPath, forKey: "path") 379 | 380 | let btnblurPath = CABasicAnimation(keyPath: "path") 381 | let blurfromPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.084+3, self.view.frame.size.height * 0.883+4, self.view.frame.size.width * 0.168, self.view.frame.size.width * 0.168), cornerRadius: self.view.frame.size.width * 0.084) 382 | 383 | let blurtoPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281+3, self.view.frame.size.height * (0.883+0.025)+4, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.118), cornerRadius: self.view.frame.size.width * 0.118) 384 | 385 | btnblurPath.beginTime = initTime + 5/6 386 | btnblurPath.duration = 0.5 387 | btnblurPath.fromValue = blurfromPath.CGPath 388 | btnblurPath.toValue = blurtoPath.CGPath 389 | btnblurPath.removedOnCompletion = false 390 | btnblurPath.autoreverses = false 391 | btnblurPath.fillMode = kCAFillModeForwards 392 | btnblurPath.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 393 | 394 | rectangleBlurFABLayer.addAnimation(btnblurPath, forKey: "path") 395 | 396 | //Arrow 397 | let arrowscale = CABasicAnimation(keyPath: "transform") 398 | arrowscale.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1, 1, 1.0)) 399 | arrowscale.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.5, 0.5, 1.0)) 400 | 401 | arrowscale.beginTime = initTime + 5/6 402 | arrowscale.duration = 2/3 403 | arrowscale.removedOnCompletion = false 404 | arrowscale.autoreverses = false 405 | arrowscale.fillMode = kCAFillModeForwards 406 | arrowscale.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 407 | 408 | arrow.layer.addAnimation(arrowscale, forKey: "path") 409 | 410 | let arrowbounds = CABasicAnimation(keyPath: "position") 411 | arrowbounds.beginTime = initTime + 5/6 412 | arrowbounds.duration = 2/3 413 | arrowbounds.toValue = NSValue(CGPoint:CGPointMake(self.view.frame.width * 0.712, self.view.frame.height * 0.942)) 414 | arrowbounds.removedOnCompletion = false 415 | arrowbounds.autoreverses = false 416 | arrowbounds.fillMode = kCAFillModeForwards 417 | arrowbounds.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 418 | 419 | arrow.layer.addAnimation(arrowbounds, forKey: "maskViewY") 420 | 421 | //Text 422 | let textpositon = CABasicAnimation(keyPath: "position") 423 | textpositon.beginTime = initTime + 5/6 424 | textpositon.duration = 2/3 425 | textpositon.toValue = NSValue(CGPoint:CGPointMake(self.view.frame.size.width/2, self.view.frame.height * 0.942)) 426 | textpositon.removedOnCompletion = false 427 | textpositon.autoreverses = false 428 | textpositon.fillMode = kCAFillModeForwards 429 | textpositon.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 430 | 431 | explore.layer.addAnimation(textpositon, forKey: "maskViewY") 432 | 433 | //Setting Tapping Event 434 | containerViewForFAB.userInteractionEnabled = false 435 | 436 | delay(1.45 + 1/3) { () -> () in 437 | 438 | self.containerViewForFAB.userInteractionEnabled = true 439 | 440 | } 441 | containerViewForFAB.addGestureRecognizer(tapRec) 442 | 443 | //必须有冒号,这里注意一下 444 | tapRec.addTarget(self, action: Selector("tappedFAB:")) 445 | 446 | //Wave Loop Shaking 447 | UIView.animateWithDuration(3, delay: 0.2, options: [.Autoreverse,.Repeat,.CurveEaseOut], animations: { 448 | 449 | self.waveMaskView.frame = CGRectMake(0,-(0.970) * self.view.frame.height,self.view.frame.width,(0.970) * self.view.frame.height) 450 | 451 | 452 | }, completion: nil) 453 | 454 | } 455 | 456 | 457 | //######## Delegate MARK:tapped FAB ######## 458 | func tappedFAB(sender:UITapGestureRecognizer){ 459 | 460 | 461 | 462 | containerViewForFAB.userInteractionEnabled = false 463 | 464 | print("tapped") 465 | 466 | //One:AddKeyframeAnimation 467 | let pathAnim = CAKeyframeAnimation(keyPath: "path") 468 | pathAnim.duration = 1.7 469 | pathAnim.keyTimes = [0,0.287,0.739,1] 470 | pathAnim.values = [createOriginalBGMask(),createOneChangedBGMask(),createTwoChangedBGMask(),createThreeChangedBGMask()] 471 | pathAnim.timingFunctions = [CAMediaTimingFunction(controlPoints: 0.33, 0, 0.66, 1),CAMediaTimingFunction(controlPoints: 0.33, 0, 0.83, 1),CAMediaTimingFunction(controlPoints: 0.33, 0, 0.66, 1)] 472 | pathAnim.removedOnCompletion = false 473 | pathAnim.autoreverses = false 474 | pathAnim.fillMode = kCAFillModeForwards 475 | pathAnim.additive = true 476 | 477 | wave.addAnimation(pathAnim, forKey: "Path") 478 | 479 | //**** 480 | delay(2/2) { () -> () in 481 | self.fakeTabBarImageView.frame = CGRect(x: 0,y: 0,width: self.view.frame.width,height: 65/667 * self.view.frame.height) 482 | self.fakeTabBarImageView.image = UIImage(named:"FakeTopBar") 483 | self.view.insertSubview(self.fakeTabBarImageView, belowSubview: self.waveMaskView) 484 | } 485 | 486 | //Two:maskBG 487 | 488 | //Y Position part 489 | self.delay(0.5, closure: { () -> () in 490 | let maskViewY = CABasicAnimation(keyPath: "transform.translation.y") 491 | maskViewY.duration = 1.2 492 | maskViewY.fromValue = 0.954 * self.view.frame.height 493 | maskViewY.toValue = 0.0497 * self.view.frame.height 494 | maskViewY.removedOnCompletion = false 495 | maskViewY.autoreverses = false 496 | maskViewY.fillMode = kCAFillModeForwards 497 | maskViewY.timingFunction = CAMediaTimingFunction(controlPoints: 0.47806126521184, 0.19381397222118, 0.11399554528546, 1.23447799181117) 498 | 499 | self.waveMaskView.layer.addAnimation(maskViewY, forKey: "maskViewY") 500 | }) 501 | 502 | //Three: FAB & BLur Shape Animation 503 | let btnPath = CABasicAnimation(keyPath: "path") 504 | let fromPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281, self.view.frame.size.height * (0.883+0.025), self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.118), cornerRadius: self.view.frame.size.width * 0.118) 505 | 506 | let toPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.08, self.view.frame.size.height * (0.883+0.0125), self.view.frame.size.width * 0.16, self.view.frame.size.width * 0.16), cornerRadius: self.view.frame.size.width * 0.16) 507 | 508 | btnPath.duration = 0.5 509 | btnPath.fromValue = fromPath.CGPath 510 | btnPath.toValue = toPath.CGPath 511 | btnPath.removedOnCompletion = false 512 | btnPath.autoreverses = false 513 | btnPath.fillMode = kCAFillModeForwards 514 | btnPath.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.83, 1) 515 | 516 | rectangleFABLayer.addAnimation(btnPath, forKey: "path") 517 | 518 | let btnblurPath = CABasicAnimation(keyPath: "path") 519 | let blurfromPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.281+3, self.view.frame.size.height * (0.883+0.025)+4, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.118), cornerRadius: self.view.frame.size.width * 0.118) 520 | 521 | let blurtoPath = UIBezierPath(roundedRect: CGRectMake(self.view.frame.size.width/2 - self.view.frame.size.width * 0.08+3, self.view.frame.size.height * (0.883+0.0125)+4, self.view.frame.size.width * 0.16, self.view.frame.size.width * 0.16), cornerRadius: self.view.frame.size.width * 0.16) 522 | 523 | btnblurPath.duration = 0.5 524 | btnblurPath.fromValue = blurfromPath.CGPath 525 | btnblurPath.toValue = blurtoPath.CGPath 526 | btnblurPath.removedOnCompletion = false 527 | btnblurPath.autoreverses = false 528 | btnblurPath.fillMode = kCAFillModeForwards 529 | btnblurPath.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.83, 1) 530 | 531 | rectangleBlurFABLayer.addAnimation(btnblurPath, forKey: "path") 532 | 533 | //Four: FAB & BLur Position Animation 534 | let containerViewForFABX = CABasicAnimation(keyPath: "bounds") 535 | let changedBounds = CGRectMake(-self.view.frame.size.width * 0.099, 0.923 * self.view.frame.size.height, self.view.frame.size.width * 0.562, self.view.frame.size.width * 0.119) 536 | containerViewForFABX.duration = 0.5 537 | containerViewForFABX.toValue = NSValue(CGRect:changedBounds) 538 | containerViewForFABX.removedOnCompletion = false 539 | containerViewForFABX.autoreverses = false 540 | containerViewForFABX.fillMode = kCAFillModeForwards 541 | containerViewForFABX.timingFunction = CAMediaTimingFunction(controlPoints: 0.33, 0, 0.66, 1) 542 | 543 | containerViewForFAB.layer.addAnimation(containerViewForFABX, forKey: "Position") 544 | 545 | //Five:Text & arrow scale & position 546 | let smallScale = CABasicAnimation(keyPath: "transform") 547 | smallScale.duration = 0.5 548 | smallScale.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)) 549 | smallScale.removedOnCompletion = false 550 | smallScale.autoreverses = false 551 | smallScale.fillMode = kCAFillModeForwards 552 | smallScale.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 553 | 554 | arrow.layer.addAnimation(smallScale, forKey: "scale") 555 | explore.layer.addAnimation(smallScale, forKey: "scale") 556 | 557 | let arrowPosition = CABasicAnimation(keyPath: "position") 558 | arrowPosition.duration = 0.5 559 | arrowPosition.fromValue = NSValue(CGPoint:CGPointMake(self.view.frame.width * 0.712, self.view.frame.height * 0.942)) 560 | arrowPosition.toValue = NSValue(CGPoint:CGPointMake(self.view.frame.width * 0.5, self.view.frame.height * 0.942)) 561 | arrowPosition.removedOnCompletion = false 562 | arrowPosition.autoreverses = false 563 | arrowPosition.fillMode = kCAFillModeForwards 564 | arrowPosition.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.1, 1) 565 | 566 | arrow.layer.addAnimation(arrowPosition, forKey: "maskViewY") 567 | 568 | //Six:Add scale & rotate 569 | 570 | let addScale = CABasicAnimation(keyPath: "transform") 571 | addScale.beginTime = CACurrentMediaTime() + 1/6 572 | addScale.duration = 0.6 573 | addScale.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(0, 0, 0)) 574 | addScale.toValue = NSValue(CATransform3D:CATransform3DMakeScale(1, 1, 1.0)) 575 | addScale.removedOnCompletion = false 576 | addScale.autoreverses = false 577 | addScale.fillMode = kCAFillModeForwards 578 | addScale.timingFunction = CAMediaTimingFunction(controlPoints: 0.45743735297974, 0.651, 0.31650201812927, 1.25) 579 | 580 | addImageView.layer.addAnimation(addScale, forKey: "Scale") 581 | 582 | let addRotation = CABasicAnimation(keyPath: "transform.rotation") 583 | addRotation.beginTime = CACurrentMediaTime() + 1/6 584 | addRotation.duration = 38/30 585 | addRotation.fromValue = CGFloat(M_PI * -1/4) 586 | addRotation.toValue = CGFloat(M_PI * 1/2) 587 | addRotation.removedOnCompletion = false 588 | addRotation.autoreverses = false 589 | addRotation.fillMode = kCAFillModeForwards 590 | addRotation.timingFunction = CAMediaTimingFunction(controlPoints: 0.33, 0, 0.66, 1) 591 | 592 | addImageView.layer.addAnimation(addRotation, forKey: "Rotation") 593 | 594 | //Seven Card Part 595 | 596 | //0 597 | delay(1/3) { () -> () in 598 | let card0CommonAnimy = CABasicAnimation(keyPath: "position.y") 599 | card0CommonAnimy.duration = 0.8 600 | card0CommonAnimy.toValue = -self.view.frame.width * 0.867 601 | card0CommonAnimy.removedOnCompletion = false 602 | card0CommonAnimy.autoreverses = false 603 | card0CommonAnimy.fillMode = kCAFillModeForwards 604 | card0CommonAnimy.timingFunction = CAMediaTimingFunction(controlPoints: 0.57892719268799, 0.23139206636869, 0.11117681503296, 1.17028867040992) 605 | 606 | self.card0.layer.addAnimation(card0CommonAnimy, forKey: "card0Positiony") 607 | 608 | let card0CommonAnims = CABasicAnimation(keyPath: "transform") 609 | card0CommonAnims.duration = 0.5 610 | card0CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 611 | card0CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.95, 1.15, 1.0)) 612 | card0CommonAnims.removedOnCompletion = false 613 | card0CommonAnims.autoreverses = false 614 | card0CommonAnims.fillMode = kCAFillModeForwards 615 | card0CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.84, 1) 616 | 617 | self.card0.layer.addAnimation(card0CommonAnims, forKey: "card0Positions") 618 | } 619 | 620 | //1 621 | delay(1/3+1/15) { () -> () in 622 | 623 | let card1CommonAnimy = CABasicAnimation(keyPath: "position.y") 624 | card1CommonAnimy.duration = 0.8 625 | card1CommonAnimy.toValue = -self.view.frame.width * 0.749 626 | card1CommonAnimy.removedOnCompletion = false 627 | card1CommonAnimy.autoreverses = false 628 | card1CommonAnimy.fillMode = kCAFillModeForwards 629 | card1CommonAnimy.timingFunction = CAMediaTimingFunction(controlPoints: 0.57892719268799, 0.23139206636869, 0.11117681503296, 1.17028867040992) 630 | 631 | self.card1.layer.addAnimation(card1CommonAnimy, forKey: "card1Positiony") 632 | 633 | let card1CommonAnims = CABasicAnimation(keyPath: "transform") 634 | card1CommonAnims.duration = 0.5 635 | card1CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 636 | card1CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.95, 1.15, 1.0)) 637 | card1CommonAnims.removedOnCompletion = false 638 | card1CommonAnims.autoreverses = false 639 | card1CommonAnims.fillMode = kCAFillModeForwards 640 | card1CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.84, 1) 641 | 642 | self.card1.layer.addAnimation(card1CommonAnims, forKey: "card1Positions") 643 | } 644 | 645 | //2 646 | delay(1/3+2/15) { () -> () in 647 | 648 | let card2CommonAnimy = CABasicAnimation(keyPath: "position.y") 649 | card2CommonAnimy.duration = 0.8 650 | card2CommonAnimy.toValue = -self.view.frame.width * 0.517 651 | card2CommonAnimy.removedOnCompletion = false 652 | card2CommonAnimy.autoreverses = false 653 | card2CommonAnimy.fillMode = kCAFillModeForwards 654 | card2CommonAnimy.timingFunction = CAMediaTimingFunction(controlPoints: 0.57892719268799, 0.23139206636869, 0.11117681503296, 1.17028867040992) 655 | 656 | self.card2.layer.addAnimation(card2CommonAnimy, forKey: "card2Positiony") 657 | 658 | let card2CommonAnims = CABasicAnimation(keyPath: "transform") 659 | card2CommonAnims.duration = 0.5 660 | card2CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 661 | card2CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.95, 1.15, 1.0)) 662 | card2CommonAnims.removedOnCompletion = false 663 | card2CommonAnims.autoreverses = false 664 | card2CommonAnims.fillMode = kCAFillModeForwards 665 | card2CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.84, 1) 666 | 667 | self.card2.layer.addAnimation(card2CommonAnims, forKey: "card2Positions") 668 | } 669 | 670 | delay(1/3+3/15) { () -> () in 671 | //3 672 | let card3CommonAnimy = CABasicAnimation(keyPath: "position.y") 673 | card3CommonAnimy.duration = 0.8 674 | card3CommonAnimy.toValue = -self.view.frame.width * 0.287 675 | card3CommonAnimy.removedOnCompletion = false 676 | card3CommonAnimy.autoreverses = false 677 | card3CommonAnimy.fillMode = kCAFillModeForwards 678 | card3CommonAnimy.timingFunction = CAMediaTimingFunction(controlPoints: 0.57892719268799, 0.23139206636869, 0.11117681503296, 1.17028867040992) 679 | 680 | self.card3.layer.addAnimation(card3CommonAnimy, forKey: "card3Positiony") 681 | 682 | let card3CommonAnims = CABasicAnimation(keyPath: "transform") 683 | card3CommonAnims.duration = 0.5 684 | card3CommonAnims.fromValue = NSValue(CATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)) 685 | card3CommonAnims.toValue = NSValue(CATransform3D:CATransform3DMakeScale(0.95, 1.15, 1.0)) 686 | card3CommonAnims.removedOnCompletion = false 687 | card3CommonAnims.autoreverses = false 688 | card3CommonAnims.fillMode = kCAFillModeForwards 689 | card3CommonAnims.timingFunction = CAMediaTimingFunction(controlPoints: 0.16, 0, 0.84, 1) 690 | 691 | self.card3.layer.addAnimation(card3CommonAnims, forKey: "transform") 692 | } 693 | 694 | 695 | 696 | delay(8/15 + 0.7) { () -> () in 697 | self.performSegueWithIdentifier("PushSegue", sender: nil) 698 | self.waveMaskView.layer.removeAllAnimations() 699 | } 700 | 701 | } 702 | 703 | 704 | //######## Function MARK:Delay Method ######## 705 | func delay(delay:Double, closure:()->()) { 706 | dispatch_after( 707 | dispatch_time( 708 | DISPATCH_TIME_NOW, 709 | Int64(delay * Double(NSEC_PER_SEC)) 710 | ), 711 | dispatch_get_main_queue(), closure) 712 | } 713 | 714 | //######## Function MARK:Create Wave Shape Function######## 715 | func createMaskPath(point1:CGPoint,point2:CGPoint,point3:CGPoint,point3cp1:CGPoint,point3cp2:CGPoint,point4:CGPoint,point4cp1:CGPoint,point4cp2:CGPoint,point5:CGPoint,point5cp1:CGPoint,point5cp2:CGPoint,point6:CGPoint,point6cp1:CGPoint,point6cp2:CGPoint,point7:CGPoint,point7cp1:CGPoint,point7cp2:CGPoint,point8:CGPoint,point8cp1:CGPoint,point8cp2:CGPoint,point9:CGPoint,point9cp1:CGPoint,point9cp2:CGPoint,point10:CGPoint,point10cp1:CGPoint,point10cp2:CGPoint) -> UIBezierPath { 716 | 717 | let context = UIGraphicsGetCurrentContext() 718 | let path = UIBezierPath() 719 | 720 | path.moveToPoint(point1) 721 | path.addLineToPoint(point2) 722 | path.addCurveToPoint(point3, controlPoint1:point3cp1 , controlPoint2:point3cp2) 723 | path.addCurveToPoint(point4, controlPoint1:point4cp1 , controlPoint2:point4cp2) 724 | path.addCurveToPoint(point5, controlPoint1:point5cp1 , controlPoint2:point5cp2) 725 | path.addCurveToPoint(point6, controlPoint1:point6cp1 , controlPoint2:point6cp2) 726 | path.addCurveToPoint(point7, controlPoint1:point7cp1 , controlPoint2:point7cp2) 727 | path.addCurveToPoint(point8, controlPoint1:point8cp1 , controlPoint2:point8cp2) 728 | path.addCurveToPoint(point9, controlPoint1:point9cp1 , controlPoint2:point9cp2) 729 | path.addCurveToPoint(point10, controlPoint1:point10cp1 , controlPoint2:point10cp2) 730 | path.closePath() 731 | UIColor.grayColor().setFill() 732 | CGContextSaveGState(context) 733 | path.fill() 734 | 735 | CGContextRestoreGState(context) 736 | return path 737 | } 738 | 739 | //######## Drawing MARK: BezierDrawing for BG Wave Mask ######## 740 | func createOriginalBGMask() -> CGPathRef{ 741 | 742 | let point1 = CGPointMake(0, 0) 743 | let point2 = CGPointMake(375/375 * self.view.frame.size.width, 0) 744 | let point3 = CGPointMake(375/375 * self.view.frame.size.width, 613/667 * self.view.frame.size.height) 745 | let point3cp1 = CGPointMake(375/375 * self.view.frame.size.width, 0) 746 | let point3cp2 = CGPointMake(375/375 * self.view.frame.size.width, 464/667 * self.view.frame.size.height) 747 | let point4 = CGPointMake(292.27/375 * self.view.frame.size.width, 634.02/667 * self.view.frame.size.height) 748 | let point4cp1 = CGPointMake(342.06/375 * self.view.frame.size.width, 626.74/667 * self.view.frame.size.height) 749 | let point4cp2 = CGPointMake(315.32/375 * self.view.frame.size.width, 632.86/667 * self.view.frame.size.height) 750 | let point5 = CGPointMake(237.73/375 * self.view.frame.size.width, 627.18/667 * self.view.frame.size.height) 751 | let point5cp1 = CGPointMake(271.75/375 * self.view.frame.size.width, 635.06/667 * self.view.frame.size.height) 752 | let point5cp2 = CGPointMake(254.16/375 * self.view.frame.size.width, 632.15/667 * self.view.frame.size.height) 753 | let point6 = CGPointMake(186.45/375 * self.view.frame.size.width, 606.26/667 * self.view.frame.size.height) 754 | let point6cp1 = CGPointMake(220.02/375 * self.view.frame.size.width, 621.82/667 * self.view.frame.size.height) 755 | let point6cp2 = CGPointMake(203.66/375 * self.view.frame.size.width, 614.06/667 * self.view.frame.size.height) 756 | let point7 = CGPointMake(130.81/375 * self.view.frame.size.width, 585.29/667 * self.view.frame.size.height) 757 | let point7cp1 = CGPointMake(169.45/375 * self.view.frame.size.width, 598.56/667 * self.view.frame.size.height) 758 | let point7cp2 = CGPointMake(151.62/375 * self.view.frame.size.width, 590.81/667 * self.view.frame.size.height) 759 | let point8 = CGPointMake(74.57/375 * self.view.frame.size.width, 577.47/667 * self.view.frame.size.height) 760 | let point8cp1 = CGPointMake(114.29/375 * self.view.frame.size.width, 580.9/667 * self.view.frame.size.height) 761 | let point8cp2 = CGPointMake(95.9/375 * self.view.frame.size.width, 577.92/667 * self.view.frame.size.height) 762 | let point9 = CGPointMake(0, 585/667 * self.view.frame.size.height) 763 | let point9cp1 = CGPointMake(53.07/375 * self.view.frame.size.width, 577.02/667 * self.view.frame.size.height) 764 | let point9cp2 = CGPointMake(28.58/375 * self.view.frame.size.width, 579.14/667 * self.view.frame.size.height) 765 | let point10 = CGPointMake(0, 0) 766 | let point10cp1 = CGPointMake(0, 454.5/667 * self.view.frame.size.height) 767 | let point10cp2 = CGPointMake(0, 0) 768 | 769 | let maskPath:UIBezierPath = createMaskPath(point1,point2: point2,point3: point3,point3cp1: point3cp1,point3cp2: point3cp2,point4: point4,point4cp1: point4cp1,point4cp2: point4cp2,point5: point5,point5cp1: point5cp1,point5cp2: point5cp2,point6: point6,point6cp1: point6cp1,point6cp2: point6cp2,point7: point7,point7cp1: point7cp1,point7cp2: point7cp2,point8: point8,point8cp1: point8cp1,point8cp2: point8cp2,point9: point9,point9cp1: point9cp1,point9cp2: point9cp2,point10: point10,point10cp1: point10cp1,point10cp2: point10cp2) 770 | 771 | return maskPath.CGPath 772 | 773 | } 774 | 775 | //######## Drawing MARK: BezierDrawing for Card Mask ######## 776 | func createCardMask() -> CGPathRef{ 777 | 778 | let point1 = CGPointMake(0, 0) 779 | let point2 = CGPointMake(376/375 * self.view.frame.size.width, 0) 780 | let point3 = CGPointMake(376/375 * self.view.frame.size.width, 614/667 * self.view.frame.size.height) 781 | let point3cp1 = CGPointMake(376/375 * self.view.frame.size.width, 0) 782 | let point3cp2 = CGPointMake(376/375 * self.view.frame.size.width, 496/667 * self.view.frame.size.height) 783 | let point4 = CGPointMake(293.77/375 * self.view.frame.size.width, 635.18/667 * self.view.frame.size.height) 784 | let point4cp1 = CGPointMake(344.22/375 * self.view.frame.size.width, 629.89/667 * self.view.frame.size.height) 785 | let point4cp2 = CGPointMake(317.68/375 * self.view.frame.size.width, 635.59/667 * self.view.frame.size.height) 786 | let point5 = CGPointMake(238.96/375 * self.view.frame.size.width, 624.13/667 * self.view.frame.size.height) 787 | let point5cp1 = CGPointMake(274.23/375 * self.view.frame.size.width, 634.84/667 * self.view.frame.size.height) 788 | let point5cp2 = CGPointMake(256.44/375 * self.view.frame.size.width, 630.41/667 * self.view.frame.size.height) 789 | let point6 = CGPointMake(187.95/375 * self.view.frame.size.width, 602.77/667 * self.view.frame.size.height) 790 | let point6cp1 = CGPointMake(222.1/375 * self.view.frame.size.width, 618.07/667 * self.view.frame.size.height) 791 | let point6cp2 = CGPointMake(205.53/375 * self.view.frame.size.width, 610.29/667 * self.view.frame.size.height) 792 | 793 | let point7 = CGPointMake(136.66/375 * self.view.frame.size.width, 584.43/667 * self.view.frame.size.height) 794 | let point7cp1 = CGPointMake(172/375 * self.view.frame.size.width, 595.94/667 * self.view.frame.size.height) 795 | let point7cp2 = CGPointMake(155.23/375 * self.view.frame.size.width, 589.33/667 * self.view.frame.size.height) 796 | let point8 = CGPointMake(84.96/375 * self.view.frame.size.width, 576.58/667 * self.view.frame.size.height) 797 | let point8cp1 = CGPointMake(120.91/375 * self.view.frame.size.width, 580.28/667 * self.view.frame.size.height) 798 | let point8cp2 = CGPointMake(103.87/375 * self.view.frame.size.width, 577.36/667 * self.view.frame.size.height) 799 | 800 | let point9 = CGPointMake(0, 586.5/667 * self.view.frame.size.height) 801 | let point9cp1 = CGPointMake(60.27/375 * self.view.frame.size.width, 575.56/667 * self.view.frame.size.height) 802 | let point9cp2 = CGPointMake(32.39/375 * self.view.frame.size.width, 578.19/667 * self.view.frame.size.height) 803 | let point10 = CGPointMake(0, 0) 804 | let point10cp1 = CGPointMake(0, 449/667 * self.view.frame.size.height) 805 | let point10cp2 = CGPointMake(0, 0) 806 | 807 | let maskPathforCard:UIBezierPath = createMaskPath(point1,point2: point2,point3: point3,point3cp1: point3cp1,point3cp2: point3cp2,point4: point4,point4cp1: point4cp1,point4cp2: point4cp2,point5: point5,point5cp1: point5cp1,point5cp2: point5cp2,point6: point6,point6cp1: point6cp1,point6cp2: point6cp2,point7: point7,point7cp1: point7cp1,point7cp2: point7cp2,point8: point8,point8cp1: point8cp1,point8cp2: point8cp2,point9: point9,point9cp1: point9cp1,point9cp2: point9cp2,point10: point10,point10cp1: point10cp1,point10cp2: point10cp2) 808 | 809 | return maskPathforCard.CGPath 810 | 811 | } 812 | 813 | //######## Drawing MARK: BezierDrawing for OneChanged BG Wave Mask ######## 814 | func createOneChangedBGMask() ->CGPathRef{ 815 | 816 | let onepoint1 = CGPointMake(0, 0) 817 | let onepoint2 = CGPointMake(375/375 * self.view.frame.size.width, 0) 818 | let onepoint3 = CGPointMake(461/375 * self.view.frame.size.width, 587/667 * self.view.frame.size.height) 819 | let onepoint3cp1 = CGPointMake(375/375 * self.view.frame.size.width, 0) 820 | let onepoint3cp2 = CGPointMake(461/375 * self.view.frame.size.width, 438/667 * self.view.frame.size.height) 821 | let onepoint4 = CGPointMake(375/375 * self.view.frame.size.width, 614/667 * self.view.frame.size.height) 822 | let onepoint4cp1 = CGPointMake(428/375 * self.view.frame.size.width, 601/667 * self.view.frame.size.height) 823 | let onepoint4cp2 = CGPointMake(399/375 * self.view.frame.size.width, 596/667 * self.view.frame.size.height) 824 | let onepoint5 = CGPointMake(292/375 * self.view.frame.size.width, 649/667 * self.view.frame.size.height) 825 | let onepoint5cp1 = CGPointMake(354/375 * self.view.frame.size.width, 630/667 * self.view.frame.size.height) 826 | let onepoint5cp2 = CGPointMake(322/375 * self.view.frame.size.width, 652/667 * self.view.frame.size.height) 827 | let onepoint6 = CGPointMake(199/375 * self.view.frame.size.width, 640/667 * self.view.frame.size.height) 828 | let onepoint6cp1 = CGPointMake(260/375 * self.view.frame.size.width, 646/667 * self.view.frame.size.height) 829 | let onepoint6cp2 = CGPointMake(225/375 * self.view.frame.size.width, 631/667 * self.view.frame.size.height) 830 | let onepoint7 = CGPointMake(88/375 * self.view.frame.size.width, 640/667 * self.view.frame.size.height) 831 | let onepoint7cp1 = CGPointMake(173/375 * self.view.frame.size.width, 649/667 * self.view.frame.size.height) 832 | let onepoint7cp2 = CGPointMake(119/375 * self.view.frame.size.width, 648/667 * self.view.frame.size.height) 833 | let onepoint8 = CGPointMake(0/375 * self.view.frame.size.width, 568/667 * self.view.frame.size.height) 834 | let onepoint8cp1 = CGPointMake(63/375 * self.view.frame.size.width, 634/667 * self.view.frame.size.height) 835 | let onepoint8cp2 = CGPointMake(36/375 * self.view.frame.size.width, 568/667 * self.view.frame.size.height) 836 | let onepoint9 = CGPointMake(-113.5/375 * self.view.frame.size.width, 578/667 * self.view.frame.size.height) 837 | let onepoint9cp1 = CGPointMake(-36/375 * self.view.frame.size.width, 568/667 * self.view.frame.size.height) 838 | let onepoint9cp2 = CGPointMake(-85/375 * self.view.frame.size.width, 572/667 * self.view.frame.size.height) 839 | let onepoint10 = CGPointMake(0, 0) 840 | let onepoint10cp1 = CGPointMake(-113.5/375 * self.view.frame.size.width , 447/667 * self.view.frame.size.height) 841 | let onepoint10cp2 = CGPointMake(0, 0) 842 | 843 | let oneChangedBGMask:UIBezierPath = self.createMaskPath(onepoint1,point2: onepoint2,point3: onepoint3,point3cp1: onepoint3cp1,point3cp2: onepoint3cp2,point4: onepoint4,point4cp1: onepoint4cp1,point4cp2: onepoint4cp2,point5: onepoint5,point5cp1: onepoint5cp1,point5cp2: onepoint5cp2,point6: onepoint6,point6cp1: onepoint6cp1,point6cp2: onepoint6cp2,point7: onepoint7,point7cp1: onepoint7cp1,point7cp2: onepoint7cp2,point8: onepoint8,point8cp1: onepoint8cp1,point8cp2: onepoint8cp2,point9: onepoint9,point9cp1: onepoint9cp1,point9cp2: onepoint9cp2,point10: onepoint10,point10cp1: onepoint10cp1,point10cp2: onepoint10cp2) 844 | 845 | return oneChangedBGMask.CGPath 846 | 847 | } 848 | 849 | //######## Drawing MARK: BezierDrawing for TwoChanged BG Wave Mask ######## 850 | func createTwoChangedBGMask() ->CGPathRef{ 851 | 852 | let np1:CGPoint = CGPointMake(0, 0) 853 | let np2:CGPoint = CGPointMake(375/375 * self.view.frame.size.width, 0) 854 | let np3:CGPoint = CGPointMake(493/375 * self.view.frame.size.width, 617/667 * self.view.frame.size.height) 855 | let np3cp1:CGPoint = CGPointMake(375/375 * self.view.frame.size.width, 0) 856 | let np3cp2:CGPoint = CGPointMake(493/375 * self.view.frame.size.width, 468/667 * self.view.frame.size.height) 857 | let np4:CGPoint = CGPointMake(410/375 * self.view.frame.size.width, 652/667 * self.view.frame.size.height) 858 | let np4cp1:CGPoint = CGPointMake(448/375 * self.view.frame.size.width, 632/667 * self.view.frame.size.height) 859 | let np4cp2:CGPoint = CGPointMake(425/375 * self.view.frame.size.width, 643/667 * self.view.frame.size.height) 860 | let np5:CGPoint = CGPointMake(302/375 * self.view.frame.size.width, 679/667 * self.view.frame.size.height) 861 | let np5cp1:CGPoint = CGPointMake(389/375 * self.view.frame.size.width, 668/667 * self.view.frame.size.height) 862 | let np5cp2:CGPoint = CGPointMake(332/375 * self.view.frame.size.width, 682/667 * self.view.frame.size.height) 863 | let np6:CGPoint = CGPointMake(206/375 * self.view.frame.size.width, 672/667 * self.view.frame.size.height) 864 | let np6cp1:CGPoint = CGPointMake(269.65/375 * self.view.frame.size.width, 675.76/667 * self.view.frame.size.height) 865 | let np6cp2:CGPoint = CGPointMake(260.5/375 * self.view.frame.size.width, 662/667 * self.view.frame.size.height) 866 | let np7:CGPoint = CGPointMake(76/375 * self.view.frame.size.width, 668/667 * self.view.frame.size.height) 867 | let np7cp1:CGPoint = CGPointMake(182/375 * self.view.frame.size.width, 679.82/667 * self.view.frame.size.height) 868 | let np7cp2:CGPoint = CGPointMake(106.5/375 * self.view.frame.size.width, 683.5/667 * self.view.frame.size.height) 869 | let np8:CGPoint = CGPointMake(-72/375 * self.view.frame.size.width, 672/667 * self.view.frame.size.height) 870 | let np8cp1:CGPoint = CGPointMake(43.61/375 * self.view.frame.size.width, 651.54/667 * self.view.frame.size.height) 871 | let np8cp2:CGPoint = CGPointMake(-19/375 * self.view.frame.size.width, 671.5/667 * self.view.frame.size.height) 872 | let np9:CGPoint = CGPointMake(-144/375 * self.view.frame.size.width, 626/667 * self.view.frame.size.height) 873 | let np9cp1:CGPoint = CGPointMake(-106.52/375 * self.view.frame.size.width, 672.33/667 * self.view.frame.size.height) 874 | let np9cp2:CGPoint = CGPointMake(-135/375 * self.view.frame.size.width, 641/667 * self.view.frame.size.height) 875 | let np10:CGPoint = CGPointMake(0, 0) 876 | let np10cp1:CGPoint = CGPointMake(-144/375 * self.view.frame.size.width, 495.5/667 * self.view.frame.size.height) 877 | let np10cp2:CGPoint = CGPointMake(0,0) 878 | 879 | let twoChangedBGMask:UIBezierPath = self.createMaskPath(np1,point2: np2,point3: np3,point3cp1: np3cp1,point3cp2: np3cp2,point4: np4,point4cp1: np4cp1,point4cp2: np4cp2,point5: np5,point5cp1: np5cp1,point5cp2: np5cp2,point6: np6,point6cp1: np6cp1,point6cp2: np6cp2,point7: np7,point7cp1: np7cp1,point7cp2: np7cp2,point8: np8,point8cp1: np8cp1,point8cp2: np8cp2,point9: np9,point9cp1: np9cp1,point9cp2: np9cp2,point10: np10,point10cp1: np10cp1,point10cp2: np10cp2) 880 | 881 | return twoChangedBGMask.CGPath 882 | 883 | } 884 | 885 | func createThreeChangedBGMask() -> CGPathRef{ 886 | 887 | 888 | let heightAdjust = (0.8943 + 15/667) * self.view.frame.height 889 | 890 | let np1:CGPoint = CGPointMake(0, 0) 891 | let np2:CGPoint = CGPointMake(375/375 * self.view.frame.size.width, 0) 892 | let np3:CGPoint = CGPointMake(461/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 893 | let np3cp1:CGPoint = CGPointMake(375/375 * self.view.frame.size.width, 0 + heightAdjust) 894 | let np3cp2:CGPoint = CGPointMake(461/375 * self.view.frame.size.width, -85/667 * self.view.frame.size.height + heightAdjust) 895 | let np4:CGPoint = CGPointMake(375/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 896 | let np4cp1:CGPoint = CGPointMake(428.06/375 * self.view.frame.size.width, 77.74/667 * self.view.frame.size.height + heightAdjust) 897 | let np4cp2:CGPoint = CGPointMake(398.57/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 898 | let np5:CGPoint = CGPointMake(292/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 899 | let np5cp1:CGPoint = CGPointMake(354/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 900 | let np5cp2:CGPoint = CGPointMake(322/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 901 | let np6:CGPoint = CGPointMake(199/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 902 | let np6cp1:CGPoint = CGPointMake(259.65/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 903 | let np6cp2:CGPoint = CGPointMake(225/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 904 | let np7:CGPoint = CGPointMake(88/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 905 | let np7cp1:CGPoint = CGPointMake(173.33/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 906 | let np7cp2:CGPoint = CGPointMake(119/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 907 | let np8:CGPoint = CGPointMake(0/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 908 | let np8cp1:CGPoint = CGPointMake(63.39/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 909 | let np8cp2:CGPoint = CGPointMake(33.73/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 910 | let np9:CGPoint = CGPointMake(-113.5/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 911 | let np9cp1:CGPoint = CGPointMake(-34/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 912 | let np9cp2:CGPoint = CGPointMake(-84.92/375 * self.view.frame.size.width, 64/667 * self.view.frame.size.height + heightAdjust) 913 | let np10:CGPoint = CGPointMake(0, 0 + heightAdjust) 914 | let np10cp1:CGPoint = CGPointMake(-113.5/375 * self.view.frame.size.width, 66.5/667 * self.view.frame.size.height + heightAdjust) 915 | let np10cp2:CGPoint = CGPointMake(0,0 + heightAdjust) 916 | 917 | let threeChangedBGMask:UIBezierPath = self.createMaskPath(np1,point2: np2,point3: np3,point3cp1: np3cp1,point3cp2: np3cp2,point4: np4,point4cp1: np4cp1,point4cp2: np4cp2,point5: np5,point5cp1: np5cp1,point5cp2: np5cp2,point6: np6,point6cp1: np6cp1,point6cp2: np6cp2,point7: np7,point7cp1: np7cp1,point7cp2: np7cp2,point8: np8,point8cp1: np8cp1,point8cp2: np8cp2,point9: np9,point9cp1: np9cp1,point9cp2: np9cp2,point10: np10,point10cp1: np10cp1,point10cp2: np10cp2) 918 | 919 | return threeChangedBGMask.CGPath 920 | 921 | 922 | 923 | } 924 | 925 | 926 | } 927 | 928 | -------------------------------------------------------------------------------- /Trainer/SliderLabelContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliderLabelContainer.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/14. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | //枚举Slider三种形式 个、十、百 14 | enum SliderLabelContainerType{ 15 | case SingleDigitType 16 | case TensDigitType 17 | case HundredDigitType 18 | } 19 | 20 | class SliderLabelContainer: UIView { 21 | 22 | var singleDigitScroll:UIScrollView! 23 | 24 | private var scrollType:SliderLabelContainerType = SliderLabelContainerType.SingleDigitType 25 | 26 | //Slider ScrollView的初始化 27 | init(frame: CGRect,type:SliderLabelContainerType,fontsize:Int,color:UIColor) { 28 | super.init(frame:frame) 29 | scrollType = type 30 | 31 | 32 | singleDigitScroll = UIScrollView(frame: self.bounds) 33 | singleDigitScroll.userInteractionEnabled = false 34 | singleDigitScroll.showsVerticalScrollIndicator = false 35 | singleDigitScroll.contentSize = CGSizeMake(CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)*10) 36 | 37 | //利用遍历排列scrollView 38 | for i in 0...10{ 39 | let label:UILabel = UILabel(frame: CGRectMake(0,CGRectGetHeight(self.bounds)*CGFloat(i),CGRectGetWidth(self.bounds),CGRectGetHeight(self.bounds))) 40 | label.text = "\(i)" 41 | label.textAlignment = NSTextAlignment.Center 42 | label.font = UIFont(name: "Avenir-Light", size: CGFloat(fontsize)) 43 | label.textColor = color 44 | singleDigitScroll.addSubview(label) 45 | } 46 | self.addSubview(singleDigitScroll) 47 | 48 | } 49 | 50 | //Animation Part 51 | func scrollToNum(num:Int){ 52 | if scrollType == .SingleDigitType{ 53 | self.singleDigitScroll.contentOffset = CGPointMake(0, CGRectGetHeight(self.bounds) * CGFloat(num)) 54 | 55 | // UIView.animateWithDuration(0.85, animations: { () -> Void in 56 | // 57 | // }) 58 | 59 | 60 | } 61 | else if scrollType == .TensDigitType{ 62 | self.singleDigitScroll.contentOffset = CGPointMake(0, CGRectGetHeight(self.bounds) * CGFloat(num)) 63 | 64 | // UIView.animateWithDuration(1, animations: { () -> Void in 65 | // 66 | // }) 67 | } 68 | else if scrollType == .HundredDigitType{ 69 | self.singleDigitScroll.contentOffset = CGPointMake(0, CGRectGetHeight(self.bounds) * CGFloat(num)) 70 | 71 | // UIView.animateWithDuration(1.15, animations: { () -> Void in 72 | // 73 | // }) 74 | } 75 | 76 | } 77 | 78 | required init?(coder aDecoder: NSCoder) { 79 | fatalError("init(coder:) has not been implemented") 80 | } 81 | 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /Trainer/TableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/11/19. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | 14 | class TableViewController: UITableViewController { 15 | 16 | @IBOutlet weak var menuIcon: UIBarButtonItem! 17 | @IBOutlet weak var glassIcon: UIBarButtonItem! 18 | 19 | 20 | let fab = FloatingButton() 21 | var isHidden:Bool = false 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | //MARK:add the FAB 27 | if let image = UIImage(named: "Add2.png"){ 28 | fab.setImage(image, forState: .Normal) 29 | } 30 | 31 | fab.frame = CGRectMake(0.895*self.view.bounds.width - 50, 0.945*self.view.bounds.height-50, 50, 50) 32 | fab.alpha = 0.8 33 | //Way to add target for btn 34 | fab.addTarget(self, action: "FABonclick:", forControlEvents: UIControlEvents.TouchUpInside) 35 | //Pin The Fab,disable the FAB scroll effect 36 | self.navigationController!.view.addSubview(fab) 37 | 38 | 39 | 40 | //Mark:Show the Nav Bar 41 | self.navigationController?.setNavigationBarHidden(false, animated: false) 42 | 43 | //Mark:Nav Background Img 44 | navigationController?.navigationBar.setBackgroundImage(UIImage(named: "TopBar"), forBarMetrics: .Default) 45 | 46 | //Mark:Nav Frame & Label Init 47 | //navigationController?.navigationBar.frame = CGRectMake(0,0,self.view.frame.width,self.view.frame.height*0.096) 48 | 49 | //?? 50 | //self.menuIcon.imageInsets = UIEdgeInsets(top: self.view.frame.size.width/60, left: self.view.frame.size.width/60, bottom: self.view.frame.size.width/60, right: -self.view.frame.size.width/60) 51 | //self.glassIcon.imageInsets = UIEdgeInsets(top: self.view.frame.size.width/60, left: self.view.frame.size.width/20, bottom: self.view.frame.size.width/60, right: -self.view.frame.size.width/10) 52 | 53 | //Mark:Simple make some constraint for layout 54 | //courseTableView.frame = CGRectMake(0, self.view.bounds.height * 0.096, self.view.bounds.width, self.view.bounds.height * 0.904) 55 | 56 | self.navigationController?.navigationBar.alpha = 1 57 | 58 | if tableView.rowHeight > 150{ 59 | 60 | tableView.rowHeight = self.view.bounds.height * 0.265 61 | } 62 | else{ 63 | tableView.rowHeight = 150 64 | } 65 | 66 | tableView.showsVerticalScrollIndicator = false 67 | 68 | 69 | } 70 | 71 | // Mark: - Custom the animation when cell comes in 72 | 73 | override func viewWillAppear(animated: Bool) { 74 | super.viewWillAppear(true) 75 | 76 | //1. Init the Cell's Position 77 | 78 | //Very Important Step 79 | self.tableView.reloadData() 80 | 81 | let tableHeight:CGFloat = self.tableView.bounds.size.height 82 | let visibleCells:NSArray = tableView.visibleCells 83 | 84 | for var beforeCell = 0;beforeCell < visibleCells.count;beforeCell++ { 85 | let visibleCell:CustomTableViewCell = visibleCells.objectAtIndex(beforeCell) as! CustomTableViewCell 86 | if(visibleCell.isKindOfClass(CustomTableViewCell)){ 87 | visibleCell.transform = CGAffineTransformMakeTranslation(0, tableHeight) 88 | } 89 | } 90 | 91 | //Now Animation(Chained Delay) 92 | 93 | var index = 0 94 | 95 | for movingVisibleCells in visibleCells{ 96 | let visibleCell: CustomTableViewCell = movingVisibleCells as! CustomTableViewCell 97 | UIView.animateWithDuration(1.5, delay: 0.05 * Double(index), usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 98 | 99 | visibleCell.transform = CGAffineTransformMakeTranslation(0, 0); 100 | 101 | }, completion: nil) 102 | 103 | index += 1 104 | } 105 | 106 | } 107 | 108 | // MARK: - Table view data source 109 | 110 | @IBAction func back(sender: AnyObject) { 111 | navigationController?.popViewControllerAnimated(false) 112 | } 113 | 114 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 115 | return feedData.count 116 | } 117 | 118 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 119 | let cell = tableView.dequeueReusableCellWithIdentifier("customCell", forIndexPath: indexPath) as! CustomTableViewCell 120 | 121 | initCoachCell(cell,indexPath: indexPath) 122 | return cell 123 | } 124 | 125 | 126 | 127 | 128 | //######## Function MARK:Cell Init Method ######## 129 | func initCoachCell(cell:CustomTableViewCell,indexPath:NSIndexPath){ 130 | cell.feed = feedData[indexPath.row] 131 | } 132 | 133 | 134 | 135 | //######## Function MARK:Status Bar Hidden Method ######## 136 | override func prefersStatusBarHidden() -> Bool { 137 | return false 138 | } 139 | 140 | 141 | //######## Function MARK:Delay Method ######## 142 | func delay(delay:Double, closure:()->()) { 143 | dispatch_after( 144 | dispatch_time( 145 | DISPATCH_TIME_NOW, 146 | Int64(delay * Double(NSEC_PER_SEC)) 147 | ), 148 | dispatch_get_main_queue(), closure) 149 | } 150 | 151 | func FABonclick(sender:UITapGestureRecognizer){ 152 | print("Jesus") 153 | } 154 | 155 | } 156 | -------------------------------------------------------------------------------- /Trainer/UIColors+FloatingMenu.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColors+FloatingMenu.swift 3 | // Trainer 4 | // 5 | // Created by KingMartin on 15/12/15. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor{ 12 | class var flatBlueColor:UIColor{ 13 | return UIColor(red: 125/255.0, green: 190/255.0, blue: 229/255.0, alpha: 1) 14 | } 15 | class var flatYellowColor:UIColor { 16 | return UIColor(red: 229/255.0, green: 194/255.0, blue: 125/255.0, alpha: 1) 17 | } 18 | class var flatRedColor:UIColor{ 19 | return UIColor(red: 229/255.0, green: 125/255.0, blue: 125/255.0, alpha: 1) 20 | } 21 | class var flatBlueAlphaColor:UIColor{ 22 | return UIColor(red: 125/255.0, green: 190/255.0, blue: 229/255.0, alpha: 0.45) 23 | } 24 | class var flatYellowAlphaColor:UIColor { 25 | return UIColor(red: 229/255.0, green: 194/255.0, blue: 125/255.0, alpha: 0.45) 26 | } 27 | class var flatRedAlphaColor:UIColor{ 28 | return UIColor(red: 229/255.0, green: 125/255.0, blue: 125/255.0, alpha: 0.45) 29 | } 30 | class var deepBlueColor:UIColor { 31 | return UIColor(red: 78/255.0, green: 107/255.0, blue: 128/255.0, alpha: 1) 32 | } 33 | class var fabBlueColor:UIColor { 34 | return UIColor(red: 0.482, green: 0.741, blue: 0.894, alpha: 1.000) 35 | } 36 | class var fabShadowColor:UIColor{ 37 | return UIColor(red: 0, green: 0, blue: 0, alpha: 0.07) 38 | } 39 | 40 | var pixelImage: UIImage { 41 | let rect = CGRect(x: 0, y: 0, width: 1, height: 1) 42 | UIGraphicsBeginImageContextWithOptions(rect.size, true, 0) 43 | 44 | self.setFill() 45 | UIRectFill(rect) 46 | 47 | let image = UIGraphicsGetImageFromCurrentImageContext() 48 | UIGraphicsEndImageContext() 49 | 50 | return image 51 | } 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /TrainerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TrainerTests/TrainerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TrainerTests.swift 3 | // TrainerTests 4 | // 5 | // Created by KingMartin on 15/11/11. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Trainer 11 | 12 | class TrainerTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /TrainerUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TrainerUITests/TrainerUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TrainerUITests.swift 3 | // TrainerUITests 4 | // 5 | // Created by KingMartin on 15/11/11. 6 | // Copyright © 2015年 KingMartin. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class TrainerUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /implement.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinRGB/MTPrivateTrainerAnimation/6e037bf7b23f386754388700aa69e6ff37d53b04/implement.gif --------------------------------------------------------------------------------