├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── SubmitTransition.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── SubmitTransition.xccheckout └── xcuserdata │ └── Takuya.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SubmitTransition.xcscheme │ └── xcschememanagement.plist ├── SubmitTransition ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Classes │ ├── CGRectEx.swift │ ├── FadeTransition.swift │ ├── SpinerLayer.swift │ ├── TimerEx.swift │ └── TransitionSubmitButton.swift ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Home.imageset │ │ ├── Contents.json │ │ └── Home.png │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── Login.imageset │ │ ├── Contents.json │ │ └── Login.png ├── Info.plist ├── SecondViewController.swift └── ViewController.swift ├── SubmitTransitionTests ├── Info.plist └── SubmitTransitionTests.swift ├── TKSubmitTransition.podspec └── demo.gif /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takuoka/TKSubmitTransition/1960d8e644c2dd3aa4585b6ed562f90ec8e13065/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | #Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | .DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Takuya Okamoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # TKSubmitTransition 3 | 4 | [![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat 5 | )](https://developer.apple.com/iphone/index.action) 6 | [![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat 7 | )](https://developer.apple.com/swift) 8 | [![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat 9 | )](http://mit-license.org) 10 | [![CocoaPods](https://img.shields.io/cocoapods/v/TKSubmitTransition.svg)]() 11 | 12 | 13 | Inpired by https://dribbble.com/shots/1945593-Login-Home-Screen 14 | 15 | I created Animated UIButton of Loading Animation and Transition Animation. 16 | 17 | As you can see in the GIF Animation Demo below, you can find the “Sign in” button rolling and after that, next UIViewController will fade-in. 18 | 19 | I made them as classes and you can use it with ease. 20 | 21 | [Objective-C version is here.](https://github.com/wwdc14/HySubmitTransitionObjective-C) 22 | 23 | # Demo 24 | ![Demo GIF Animation](https://github.com/entotsu/TKSubmitTransition/blob/master/demo.gif "Demo GIF Animation") 25 | 26 | # Installation 27 | 28 | ## Cocoapods ## 29 | 30 | **Swift 5** 31 | 32 | ``` ruby 33 | pod 'TKSubmitTransition', :git => 'https://github.com/entotsu/TKSubmitTransition.git' 34 | ``` 35 | 36 | **Swift 4** 37 | 38 | ``` ruby 39 | pod 'TKSubmitTransition', :git => 'https://github.com/entotsu/TKSubmitTransition.git', :branch => 'swift4' 40 | ``` 41 | 42 | **Swift 3** 43 | 44 | ``` ruby 45 | pod 'TKSubmitTransition', :git => 'https://github.com/entotsu/TKSubmitTransition.git', :tag => '2.0' 46 | ``` 47 | 48 | 49 | **Swift 2 & Below** 50 | 51 | ``` ruby 52 | pod 'TKSubmitTransition', '~> 0.2' 53 | ``` 54 | 55 | 56 | ## Manually ## 57 | Drag all the files from `SubmitTransition/Classes` into your project. 58 | 59 | # Usage 60 | 61 | ### Storyboard 62 | 63 | Just drag a `UIButton` on to your storyboard and change the custom class to `TKSubmitTransition` in the identity inspector. 64 | 65 | ![Button](http://i.imgur.com/mqSt8y8.png) 66 | 67 | Change the settings of the button via the storyboard. 68 | 69 | ![Settings](http://i.imgur.com/maA1Aiw.png) 70 | 71 | Then create an `IBOutlet` to your view controller. 72 | 73 | ![IBOutlet](http://i.imgur.com/1VK9umA.jpg) 74 | 75 | You can now move on to `Animation Method` for further instructions. 76 | 77 | ### Programatically 78 | 79 | You can use `TKTransitionSubmitButton` just like any other `UIButton`. It works practically the same. 80 | 81 | Add this at the top of your file: 82 | 83 | ``` swift 84 | import SubmitTransition 85 | ``` 86 | 87 | Then create a variable above your view did load for the button 88 | 89 | ``` swift 90 | var bin: TKTransitionSubmitButton! 91 | ``` 92 | 93 | then finally in the view did load add the button 94 | 95 | ``` swift 96 | btn = TKTransitionSubmitButton(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width - 64, height: 44)) 97 | btn.center = self.view.center 98 | btn.frame.bottom = self.view.frame.height - 60 99 | btn.setTitle("Sign in", for: UIControlState()) 100 | btn.titleLabel?.font = UIFont(name: "HelveticaNeue-Light", size: 14) 101 | self.view.addSubview(btn) 102 | ``` 103 | 104 | ## Animation Method 105 | 106 | Use this to animate your button. Follow the steps in `Delegation` to setup the transition. 107 | 108 | ``` swift 109 | func didStartYourLoading() { 110 | btn.startLoadingAnimation() 111 | } 112 | 113 | func didFinishYourLoading() { 114 | btn.startFinishAnimation { 115 | //Your Transition 116 | let secondVC = SecondViewController() 117 | secondVC.transitioningDelegate = self 118 | self.presentViewController(secondVC, animated: true, completion: nil) 119 | } 120 | } 121 | 122 | ``` 123 | 124 | ## Networking 125 | 126 | If you are running requests to a server and are waiting a responce, you can use something like this to stop and start the animation: 127 | 128 | ``` swift 129 | // start loading the button animations 130 | button.startLoadingAnimation() 131 | 132 | // run query in background thread 133 | async.background { 134 | let query = PFQuery(className: "Blah") 135 | query.whereKey("user", equalTo: user) 136 | let results = try! query.findObjects() 137 | 138 | if results.count == 0 { 139 | // insert alertView telling user that their details don't work 140 | } 141 | else { 142 | // return to main thread to complete login 143 | async.main { 144 | // tell the button to finish its animations 145 | button.startFinishingAnimation(1) { 146 | let sb = UIStoryboard(name: "Main", bundle: nil) 147 | let vc = sb.instantiateViewController(withIdentifier: "MainVC") 148 | vc.transitioningDelegate = self 149 | self.present(vc, animated: true, completion: nil) 150 | } 151 | } 152 | } 153 | ``` 154 | Thanks to [@sarfrazb](https://github.com/sarfrazb) for pointing this out. 155 | 156 | ## TKFadeInAnimator 157 | This Library also supply fade-in Animator Class of `UIViewControllerAnimatedTransitioning`. 158 | 159 | Please use This for transition animation. 160 | 161 | ### Delegation 162 | 163 | #### Make sure your class implements the UIViewControllerTransitioningDelegate protocol like so 164 | > class ViewController: UIViewController, UIViewControllerTransitioningDelegate { 165 | 166 | #### Setup the transitioning delegate 167 | `secondVC.transitioningDelegate = self` 168 | 169 | #### Implement the delegate 170 | 171 | **Swift 3/4** 172 | 173 | ``` swift 174 | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 175 | return TKFadeInAnimator(transitionDuration: 0.5, startingAlpha: 0.8) 176 | } 177 | 178 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 179 | return nil 180 | } 181 | ``` 182 | 183 | **Swift 2 & Below** 184 | 185 | ``` swift 186 | // MARK: UIViewControllerTransitioningDelegate 187 | func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 188 | let fadeInAnimator = TKFadeInAnimator() 189 | return fadeInAnimator 190 | } 191 | 192 | func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 193 | return nil 194 | } 195 | 196 | ``` 197 | 198 | If you need any help with the setup feel free to look at the sample or create an issue. 199 | 200 | # Contribution 201 | 202 | - If you've found a bug, please open an issue. 203 | - If you've a feature request, please open a pull request 204 | - Please check any closed issues before you open a new one! 205 | 206 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B00C1CC21B7495FC00412E02 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B00C1CC11B7495FC00412E02 /* SecondViewController.swift */; }; 11 | B0FAC85E1B7356F40034E00B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC85D1B7356F40034E00B /* AppDelegate.swift */; }; 12 | B0FAC8601B7356F40034E00B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC85F1B7356F40034E00B /* ViewController.swift */; }; 13 | B0FAC8631B7356F40034E00B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B0FAC8611B7356F40034E00B /* Main.storyboard */; }; 14 | B0FAC8651B7356F40034E00B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B0FAC8641B7356F40034E00B /* Images.xcassets */; }; 15 | B0FAC8681B7356F40034E00B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B0FAC8661B7356F40034E00B /* LaunchScreen.xib */; }; 16 | B0FAC8741B7356F40034E00B /* SubmitTransitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC8731B7356F40034E00B /* SubmitTransitionTests.swift */; }; 17 | B0FAC87F1B7359000034E00B /* TransitionSubmitButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC87E1B7359000034E00B /* TransitionSubmitButton.swift */; }; 18 | B0FAC8851B736C460034E00B /* TimerEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC8841B736C460034E00B /* TimerEx.swift */; }; 19 | B0FAC8871B7440190034E00B /* CGRectEx.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC8861B7440190034E00B /* CGRectEx.swift */; }; 20 | B0FAC8891B744FB10034E00B /* SpinerLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC8881B744FB10034E00B /* SpinerLayer.swift */; }; 21 | B0FAC88B1B747F990034E00B /* FadeTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FAC88A1B747F990034E00B /* FadeTransition.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | B0FAC86E1B7356F40034E00B /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = B0FAC8501B7356F30034E00B /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = B0FAC8571B7356F30034E00B; 30 | remoteInfo = SubmitTransition; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | B00C1CC11B7495FC00412E02 /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 36 | B0FAC8581B7356F30034E00B /* SubmitTransition.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SubmitTransition.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | B0FAC85C1B7356F30034E00B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | B0FAC85D1B7356F40034E00B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | B0FAC85F1B7356F40034E00B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | B0FAC8621B7356F40034E00B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | B0FAC8641B7356F40034E00B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | B0FAC8671B7356F40034E00B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 43 | B0FAC86D1B7356F40034E00B /* SubmitTransitionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SubmitTransitionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | B0FAC8721B7356F40034E00B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | B0FAC8731B7356F40034E00B /* SubmitTransitionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubmitTransitionTests.swift; sourceTree = ""; }; 46 | B0FAC87E1B7359000034E00B /* TransitionSubmitButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionSubmitButton.swift; sourceTree = ""; }; 47 | B0FAC8841B736C460034E00B /* TimerEx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimerEx.swift; sourceTree = ""; }; 48 | B0FAC8861B7440190034E00B /* CGRectEx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGRectEx.swift; sourceTree = ""; }; 49 | B0FAC8881B744FB10034E00B /* SpinerLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinerLayer.swift; sourceTree = ""; }; 50 | B0FAC88A1B747F990034E00B /* FadeTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FadeTransition.swift; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | B0FAC8551B7356F30034E00B /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | B0FAC86A1B7356F40034E00B /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | B0FAC84F1B7356F30034E00B = { 72 | isa = PBXGroup; 73 | children = ( 74 | B0FAC85A1B7356F30034E00B /* SubmitTransition */, 75 | B0FAC8701B7356F40034E00B /* SubmitTransitionTests */, 76 | B0FAC8591B7356F30034E00B /* Products */, 77 | ); 78 | sourceTree = ""; 79 | }; 80 | B0FAC8591B7356F30034E00B /* Products */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | B0FAC8581B7356F30034E00B /* SubmitTransition.app */, 84 | B0FAC86D1B7356F40034E00B /* SubmitTransitionTests.xctest */, 85 | ); 86 | name = Products; 87 | sourceTree = ""; 88 | }; 89 | B0FAC85A1B7356F30034E00B /* SubmitTransition */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | B0FAC87D1B7358C90034E00B /* Classes */, 93 | B0FAC85D1B7356F40034E00B /* AppDelegate.swift */, 94 | B0FAC85F1B7356F40034E00B /* ViewController.swift */, 95 | B00C1CC11B7495FC00412E02 /* SecondViewController.swift */, 96 | B0FAC8611B7356F40034E00B /* Main.storyboard */, 97 | B0FAC8641B7356F40034E00B /* Images.xcassets */, 98 | B0FAC8661B7356F40034E00B /* LaunchScreen.xib */, 99 | B0FAC85B1B7356F30034E00B /* Supporting Files */, 100 | ); 101 | path = SubmitTransition; 102 | sourceTree = ""; 103 | }; 104 | B0FAC85B1B7356F30034E00B /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | B0FAC85C1B7356F30034E00B /* Info.plist */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | B0FAC8701B7356F40034E00B /* SubmitTransitionTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | B0FAC8731B7356F40034E00B /* SubmitTransitionTests.swift */, 116 | B0FAC8711B7356F40034E00B /* Supporting Files */, 117 | ); 118 | path = SubmitTransitionTests; 119 | sourceTree = ""; 120 | }; 121 | B0FAC8711B7356F40034E00B /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | B0FAC8721B7356F40034E00B /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | B0FAC87D1B7358C90034E00B /* Classes */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | B0FAC87E1B7359000034E00B /* TransitionSubmitButton.swift */, 133 | B0FAC8881B744FB10034E00B /* SpinerLayer.swift */, 134 | B0FAC88A1B747F990034E00B /* FadeTransition.swift */, 135 | B0FAC8861B7440190034E00B /* CGRectEx.swift */, 136 | B0FAC8841B736C460034E00B /* TimerEx.swift */, 137 | ); 138 | path = Classes; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | B0FAC8571B7356F30034E00B /* SubmitTransition */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = B0FAC8771B7356F40034E00B /* Build configuration list for PBXNativeTarget "SubmitTransition" */; 147 | buildPhases = ( 148 | B0FAC8541B7356F30034E00B /* Sources */, 149 | B0FAC8551B7356F30034E00B /* Frameworks */, 150 | B0FAC8561B7356F30034E00B /* Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = SubmitTransition; 157 | productName = SubmitTransition; 158 | productReference = B0FAC8581B7356F30034E00B /* SubmitTransition.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | B0FAC86C1B7356F40034E00B /* SubmitTransitionTests */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = B0FAC87A1B7356F40034E00B /* Build configuration list for PBXNativeTarget "SubmitTransitionTests" */; 164 | buildPhases = ( 165 | B0FAC8691B7356F40034E00B /* Sources */, 166 | B0FAC86A1B7356F40034E00B /* Frameworks */, 167 | B0FAC86B1B7356F40034E00B /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | B0FAC86F1B7356F40034E00B /* PBXTargetDependency */, 173 | ); 174 | name = SubmitTransitionTests; 175 | productName = SubmitTransitionTests; 176 | productReference = B0FAC86D1B7356F40034E00B /* SubmitTransitionTests.xctest */; 177 | productType = "com.apple.product-type.bundle.unit-test"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | B0FAC8501B7356F30034E00B /* Project object */ = { 183 | isa = PBXProject; 184 | attributes = { 185 | LastSwiftMigration = 0700; 186 | LastSwiftUpdateCheck = 0700; 187 | LastUpgradeCheck = 1030; 188 | ORGANIZATIONNAME = Uniface; 189 | TargetAttributes = { 190 | B0FAC8571B7356F30034E00B = { 191 | CreatedOnToolsVersion = 6.4; 192 | LastSwiftMigration = 1030; 193 | }; 194 | B0FAC86C1B7356F40034E00B = { 195 | CreatedOnToolsVersion = 6.4; 196 | LastSwiftMigration = 1030; 197 | TestTargetID = B0FAC8571B7356F30034E00B; 198 | }; 199 | }; 200 | }; 201 | buildConfigurationList = B0FAC8531B7356F30034E00B /* Build configuration list for PBXProject "SubmitTransition" */; 202 | compatibilityVersion = "Xcode 3.2"; 203 | developmentRegion = English; 204 | hasScannedForEncodings = 0; 205 | knownRegions = ( 206 | English, 207 | en, 208 | Base, 209 | ); 210 | mainGroup = B0FAC84F1B7356F30034E00B; 211 | productRefGroup = B0FAC8591B7356F30034E00B /* Products */; 212 | projectDirPath = ""; 213 | projectRoot = ""; 214 | targets = ( 215 | B0FAC8571B7356F30034E00B /* SubmitTransition */, 216 | B0FAC86C1B7356F40034E00B /* SubmitTransitionTests */, 217 | ); 218 | }; 219 | /* End PBXProject section */ 220 | 221 | /* Begin PBXResourcesBuildPhase section */ 222 | B0FAC8561B7356F30034E00B /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | B0FAC8631B7356F40034E00B /* Main.storyboard in Resources */, 227 | B0FAC8681B7356F40034E00B /* LaunchScreen.xib in Resources */, 228 | B0FAC8651B7356F40034E00B /* Images.xcassets in Resources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | B0FAC86B1B7356F40034E00B /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | /* End PBXResourcesBuildPhase section */ 240 | 241 | /* Begin PBXSourcesBuildPhase section */ 242 | B0FAC8541B7356F30034E00B /* Sources */ = { 243 | isa = PBXSourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | B00C1CC21B7495FC00412E02 /* SecondViewController.swift in Sources */, 247 | B0FAC8891B744FB10034E00B /* SpinerLayer.swift in Sources */, 248 | B0FAC88B1B747F990034E00B /* FadeTransition.swift in Sources */, 249 | B0FAC8601B7356F40034E00B /* ViewController.swift in Sources */, 250 | B0FAC8871B7440190034E00B /* CGRectEx.swift in Sources */, 251 | B0FAC85E1B7356F40034E00B /* AppDelegate.swift in Sources */, 252 | B0FAC8851B736C460034E00B /* TimerEx.swift in Sources */, 253 | B0FAC87F1B7359000034E00B /* TransitionSubmitButton.swift in Sources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | B0FAC8691B7356F40034E00B /* Sources */ = { 258 | isa = PBXSourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | B0FAC8741B7356F40034E00B /* SubmitTransitionTests.swift in Sources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXSourcesBuildPhase section */ 266 | 267 | /* Begin PBXTargetDependency section */ 268 | B0FAC86F1B7356F40034E00B /* PBXTargetDependency */ = { 269 | isa = PBXTargetDependency; 270 | target = B0FAC8571B7356F30034E00B /* SubmitTransition */; 271 | targetProxy = B0FAC86E1B7356F40034E00B /* PBXContainerItemProxy */; 272 | }; 273 | /* End PBXTargetDependency section */ 274 | 275 | /* Begin PBXVariantGroup section */ 276 | B0FAC8611B7356F40034E00B /* Main.storyboard */ = { 277 | isa = PBXVariantGroup; 278 | children = ( 279 | B0FAC8621B7356F40034E00B /* Base */, 280 | ); 281 | name = Main.storyboard; 282 | sourceTree = ""; 283 | }; 284 | B0FAC8661B7356F40034E00B /* LaunchScreen.xib */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | B0FAC8671B7356F40034E00B /* Base */, 288 | ); 289 | name = LaunchScreen.xib; 290 | sourceTree = ""; 291 | }; 292 | /* End PBXVariantGroup section */ 293 | 294 | /* Begin XCBuildConfiguration section */ 295 | B0FAC8751B7356F40034E00B /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_COMMA = YES; 307 | CLANG_WARN_CONSTANT_CONVERSION = YES; 308 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 309 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 310 | CLANG_WARN_EMPTY_BODY = YES; 311 | CLANG_WARN_ENUM_CONVERSION = YES; 312 | CLANG_WARN_INFINITE_RECURSION = YES; 313 | CLANG_WARN_INT_CONVERSION = YES; 314 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 315 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 316 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 317 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 318 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 319 | CLANG_WARN_STRICT_PROTOTYPES = YES; 320 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 321 | CLANG_WARN_UNREACHABLE_CODE = YES; 322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 324 | COPY_PHASE_STRIP = NO; 325 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 326 | ENABLE_STRICT_OBJC_MSGSEND = YES; 327 | ENABLE_TESTABILITY = YES; 328 | GCC_C_LANGUAGE_STANDARD = gnu99; 329 | GCC_DYNAMIC_NO_PIC = NO; 330 | GCC_NO_COMMON_BLOCKS = YES; 331 | GCC_OPTIMIZATION_LEVEL = 0; 332 | GCC_PREPROCESSOR_DEFINITIONS = ( 333 | "DEBUG=1", 334 | "$(inherited)", 335 | ); 336 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 344 | MTL_ENABLE_DEBUG_INFO = YES; 345 | ONLY_ACTIVE_ARCH = YES; 346 | SDKROOT = iphoneos; 347 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 348 | TARGETED_DEVICE_FAMILY = "1,2"; 349 | }; 350 | name = Debug; 351 | }; 352 | B0FAC8761B7356F40034E00B /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 357 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 358 | CLANG_CXX_LIBRARY = "libc++"; 359 | CLANG_ENABLE_MODULES = YES; 360 | CLANG_ENABLE_OBJC_ARC = YES; 361 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 362 | CLANG_WARN_BOOL_CONVERSION = YES; 363 | CLANG_WARN_COMMA = YES; 364 | CLANG_WARN_CONSTANT_CONVERSION = YES; 365 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INFINITE_RECURSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 372 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 373 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 375 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 376 | CLANG_WARN_STRICT_PROTOTYPES = YES; 377 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 378 | CLANG_WARN_UNREACHABLE_CODE = YES; 379 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 380 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 381 | COPY_PHASE_STRIP = NO; 382 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 383 | ENABLE_NS_ASSERTIONS = NO; 384 | ENABLE_STRICT_OBJC_MSGSEND = YES; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_NO_COMMON_BLOCKS = YES; 387 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 389 | GCC_WARN_UNDECLARED_SELECTOR = YES; 390 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 391 | GCC_WARN_UNUSED_FUNCTION = YES; 392 | GCC_WARN_UNUSED_VARIABLE = YES; 393 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 394 | MTL_ENABLE_DEBUG_INFO = NO; 395 | SDKROOT = iphoneos; 396 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | VALIDATE_PRODUCT = YES; 399 | }; 400 | name = Release; 401 | }; 402 | B0FAC8781B7356F40034E00B /* Debug */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 407 | INFOPLIST_FILE = SubmitTransition/Info.plist; 408 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 409 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 410 | PRODUCT_BUNDLE_IDENTIFIER = "com.twitter.tk-365.$(PRODUCT_NAME:rfc1034identifier)"; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | SWIFT_VERSION = 5.0; 413 | }; 414 | name = Debug; 415 | }; 416 | B0FAC8791B7356F40034E00B /* Release */ = { 417 | isa = XCBuildConfiguration; 418 | buildSettings = { 419 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 420 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 421 | INFOPLIST_FILE = SubmitTransition/Info.plist; 422 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 423 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 424 | PRODUCT_BUNDLE_IDENTIFIER = "com.twitter.tk-365.$(PRODUCT_NAME:rfc1034identifier)"; 425 | PRODUCT_NAME = "$(TARGET_NAME)"; 426 | SWIFT_VERSION = 5.0; 427 | }; 428 | name = Release; 429 | }; 430 | B0FAC87B1B7356F40034E00B /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | BUNDLE_LOADER = "$(TEST_HOST)"; 434 | FRAMEWORK_SEARCH_PATHS = ( 435 | "$(SDKROOT)/Developer/Library/Frameworks", 436 | "$(inherited)", 437 | ); 438 | GCC_PREPROCESSOR_DEFINITIONS = ( 439 | "DEBUG=1", 440 | "$(inherited)", 441 | ); 442 | INFOPLIST_FILE = SubmitTransitionTests/Info.plist; 443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 444 | PRODUCT_BUNDLE_IDENTIFIER = "com.twitter.tk-365.$(PRODUCT_NAME:rfc1034identifier)"; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | SWIFT_VERSION = 5.0; 447 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SubmitTransition.app/SubmitTransition"; 448 | }; 449 | name = Debug; 450 | }; 451 | B0FAC87C1B7356F40034E00B /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | BUNDLE_LOADER = "$(TEST_HOST)"; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "$(SDKROOT)/Developer/Library/Frameworks", 457 | "$(inherited)", 458 | ); 459 | INFOPLIST_FILE = SubmitTransitionTests/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = "com.twitter.tk-365.$(PRODUCT_NAME:rfc1034identifier)"; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_VERSION = 5.0; 464 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SubmitTransition.app/SubmitTransition"; 465 | }; 466 | name = Release; 467 | }; 468 | /* End XCBuildConfiguration section */ 469 | 470 | /* Begin XCConfigurationList section */ 471 | B0FAC8531B7356F30034E00B /* Build configuration list for PBXProject "SubmitTransition" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | B0FAC8751B7356F40034E00B /* Debug */, 475 | B0FAC8761B7356F40034E00B /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | B0FAC8771B7356F40034E00B /* Build configuration list for PBXNativeTarget "SubmitTransition" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | B0FAC8781B7356F40034E00B /* Debug */, 484 | B0FAC8791B7356F40034E00B /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | B0FAC87A1B7356F40034E00B /* Build configuration list for PBXNativeTarget "SubmitTransitionTests" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | B0FAC87B1B7356F40034E00B /* Debug */, 493 | B0FAC87C1B7356F40034E00B /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | /* End XCConfigurationList section */ 499 | }; 500 | rootObject = B0FAC8501B7356F30034E00B /* Project object */; 501 | } 502 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/project.xcworkspace/xcshareddata/SubmitTransition.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | BAAADD98-B505-4691-AE77-6559761D42D5 9 | IDESourceControlProjectName 10 | SubmitTransition 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 376E39A442AFC4EC56A66CF9A84AB3D937D8DACF 14 | https://github.com/entotsu/TKSubmitTransition.git 15 | 16 | IDESourceControlProjectPath 17 | SubmitTransition.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 376E39A442AFC4EC56A66CF9A84AB3D937D8DACF 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/entotsu/TKSubmitTransition.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 376E39A442AFC4EC56A66CF9A84AB3D937D8DACF 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 376E39A442AFC4EC56A66CF9A84AB3D937D8DACF 36 | IDESourceControlWCCName 37 | SubmitTransition 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/xcuserdata/Takuya.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/xcuserdata/Takuya.xcuserdatad/xcschemes/SubmitTransition.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /SubmitTransition.xcodeproj/xcuserdata/Takuya.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SubmitTransition.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B0FAC8571B7356F30034E00B 16 | 17 | primary 18 | 19 | 20 | B0FAC86C1B7356F40034E00B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SubmitTransition/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SubmitTransition 4 | // 5 | // Created by Takuya Okamoto on 2015/08/06. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SubmitTransition/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SubmitTransition/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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /SubmitTransition/Classes/CGRectEx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGRectEx.swift 3 | // SubmitTransition 4 | // 5 | // Created by Takuya Okamoto on 2015/08/07. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension CGRect { 12 | var x: CGFloat { 13 | get { 14 | return self.origin.x 15 | } 16 | set { 17 | self = CGRect(x: newValue, y: self.y, width: self.width, height: self.height) 18 | } 19 | } 20 | 21 | var y: CGFloat { 22 | get { 23 | return self.origin.y 24 | } 25 | set { 26 | self = CGRect(x: self.x, y: newValue, width: self.width, height: self.height) 27 | } 28 | } 29 | 30 | var width: CGFloat { 31 | get { 32 | return self.size.width 33 | } 34 | set { 35 | self = CGRect(x: self.x, y: self.y, width: newValue, height: self.height) 36 | } 37 | } 38 | 39 | var height: CGFloat { 40 | get { 41 | return self.size.height 42 | } 43 | set { 44 | self = CGRect(x: self.x, y: self.y, width: self.width, height: newValue) 45 | } 46 | } 47 | 48 | 49 | var top: CGFloat { 50 | get { 51 | return self.origin.y 52 | } 53 | set { 54 | y = newValue 55 | } 56 | } 57 | 58 | var bottom: CGFloat { 59 | get { 60 | return self.origin.y + self.size.height 61 | } 62 | set { 63 | self = CGRect(x: x, y: newValue - height, width: width, height: height) 64 | } 65 | } 66 | 67 | var left: CGFloat { 68 | get { 69 | return self.origin.x 70 | } 71 | set { 72 | self.x = newValue 73 | } 74 | } 75 | 76 | var right: CGFloat { 77 | get { 78 | return x + width 79 | } 80 | set { 81 | self = CGRect(x: newValue - width, y: y, width: width, height: height) 82 | } 83 | } 84 | 85 | 86 | var midX: CGFloat { 87 | get { 88 | return self.x + self.width / 2 89 | } 90 | set { 91 | self = CGRect(x: newValue - width / 2, y: y, width: width, height: height) 92 | } 93 | } 94 | 95 | var midY: CGFloat { 96 | get { 97 | return self.y + self.height / 2 98 | } 99 | set { 100 | self = CGRect(x: x, y: newValue - height / 2, width: width, height: height) 101 | } 102 | } 103 | 104 | 105 | var center: CGPoint { 106 | get { 107 | return CGPoint(x: self.midX, y: self.midY) 108 | } 109 | set { 110 | self = CGRect(x: newValue.x - width / 2, y: newValue.y - height / 2, width: width, height: height) 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /SubmitTransition/Classes/FadeTransition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FadeTransition.swift 3 | // SubmitTransition 4 | // 5 | // Created by Takuya Okamoto on 2015/08/07. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | open class TKFadeInAnimator: NSObject, UIViewControllerAnimatedTransitioning { 13 | var transitionDuration: TimeInterval = 0.5 14 | var startingAlpha: CGFloat = 0.0 15 | 16 | public convenience init(transitionDuration: TimeInterval, startingAlpha: CGFloat){ 17 | self.init() 18 | self.transitionDuration = transitionDuration 19 | self.startingAlpha = startingAlpha 20 | } 21 | 22 | open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 23 | return transitionDuration 24 | } 25 | 26 | open func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 27 | let containerView = transitionContext.containerView 28 | 29 | let toView = transitionContext.view(forKey: .to)! 30 | let fromView = (transitionContext.viewController(forKey: .from)?.view)! 31 | 32 | toView.alpha = startingAlpha 33 | fromView.alpha = 0.8 34 | 35 | containerView.addSubview(toView) 36 | 37 | UIView.animate(withDuration: self.transitionDuration(using: transitionContext), animations: { () -> Void in 38 | 39 | toView.alpha = 1.0 40 | fromView.alpha = 0.0 41 | 42 | }, completion: { 43 | _ in 44 | fromView.alpha = 1.0 45 | transitionContext.completeTransition(true) 46 | }) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SubmitTransition/Classes/SpinerLayer.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | 4 | class SpinerLayer: CAShapeLayer { 5 | 6 | var spinnerColor = UIColor.white { 7 | didSet { 8 | strokeColor = spinnerColor.cgColor 9 | } 10 | } 11 | 12 | init(frame:CGRect) { 13 | super.init() 14 | 15 | let radius:CGFloat = (frame.height / 2) * 0.5 16 | self.frame = CGRect(x: 0, y: 0, width: frame.height, height: frame.height) 17 | 18 | let center = CGPoint(x: frame.height / 2, y: bounds.center.y) 19 | let startAngle = 0 - (Double.pi / 2) 20 | let endAngle = Double.pi * 2 - (Double.pi / 2) 21 | let clockwise: Bool = true 22 | self.path = UIBezierPath(arcCenter: center, radius: radius, startAngle: CGFloat(startAngle), endAngle: CGFloat(endAngle), clockwise: clockwise).cgPath 23 | 24 | self.fillColor = nil 25 | self.strokeColor = spinnerColor.cgColor 26 | self.lineWidth = 1 27 | 28 | self.strokeEnd = 0.4 29 | self.isHidden = true 30 | } 31 | 32 | required init?(coder aDecoder: NSCoder) { 33 | fatalError("init(coder:) has not been implemented") 34 | } 35 | 36 | func animation() { 37 | self.isHidden = false 38 | let rotate = CABasicAnimation(keyPath: "transform.rotation.z") 39 | rotate.fromValue = 0 40 | rotate.toValue = Double.pi * 2 41 | rotate.duration = 0.4 42 | rotate.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear) 43 | 44 | rotate.repeatCount = HUGE 45 | rotate.fillMode = CAMediaTimingFillMode.forwards 46 | rotate.isRemovedOnCompletion = false 47 | self.add(rotate, forKey: rotate.keyPath) 48 | 49 | } 50 | 51 | func stopAnimation() { 52 | self.isHidden = true 53 | self.removeAllAnimations() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SubmitTransition/Classes/TimerEx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimerEx.swift 3 | // SubmitTransition 4 | // 5 | // Created by Takuya Okamoto on 2015/08/06. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | extension Timer { 11 | @discardableResult class func schedule(delay: TimeInterval, handler: ((Timer?) -> Void)!) -> Timer! { 12 | let fireDate = delay + CFAbsoluteTimeGetCurrent() 13 | let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, 0, 0, 0, handler) 14 | CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, .commonModes) 15 | return timer 16 | } 17 | @discardableResult class func schedule(repeatInterval interval: TimeInterval, handler: ((Timer?) -> Void)!) -> Timer! { 18 | let fireDate = interval + CFAbsoluteTimeGetCurrent() 19 | let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, interval, 0, 0, handler) 20 | CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, .commonModes) 21 | return timer 22 | } 23 | 24 | 25 | /*class func schedule(delay delay: NSTimeInterval, handler: NSTimer! -> Void) -> NSTimer { 26 | let fireDate = delay + CFAbsoluteTimeGetCurrent() 27 | let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, 0, 0, 0, handler) 28 | CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes) 29 | return timer 30 | } 31 | 32 | class func schedule(repeatInterval interval: NSTimeInterval, handler: NSTimer! -> Void) -> NSTimer { 33 | let fireDate = interval + CFAbsoluteTimeGetCurrent() 34 | let timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, fireDate, interval, 0, 0, handler) 35 | CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes) 36 | return timer 37 | }*/ 38 | } 39 | -------------------------------------------------------------------------------- /SubmitTransition/Classes/TransitionSubmitButton.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | @IBDesignable 5 | open class TKTransitionSubmitButton : UIButton, UIViewControllerTransitioningDelegate, CAAnimationDelegate { 6 | 7 | lazy var spiner: SpinerLayer! = { 8 | let s = SpinerLayer(frame: self.frame) 9 | return s 10 | }() 11 | 12 | @IBInspectable open var spinnerColor: UIColor = UIColor.white { 13 | didSet { 14 | spiner.spinnerColor = spinnerColor 15 | } 16 | } 17 | 18 | open var didEndFinishAnimation : (()->())? = nil 19 | 20 | let springGoEase = CAMediaTimingFunction(controlPoints: 0.45, -0.36, 0.44, 0.92) 21 | let shrinkCurve = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear) 22 | let expandCurve = CAMediaTimingFunction(controlPoints: 0.95, 0.02, 1, 0.05) 23 | let shrinkDuration: CFTimeInterval = 0.1 24 | @IBInspectable open var normalCornerRadius:CGFloat = 0.0 { 25 | didSet { 26 | self.layer.cornerRadius = normalCornerRadius 27 | } 28 | } 29 | 30 | var cachedTitle: String? 31 | var isAnimating = false 32 | 33 | public override init(frame: CGRect) { 34 | super.init(frame: frame) 35 | self.setup() 36 | } 37 | 38 | public required init!(coder aDecoder: NSCoder) { 39 | super.init(coder: aDecoder)! 40 | self.setup() 41 | } 42 | 43 | func setup() { 44 | self.clipsToBounds = true 45 | spiner.spinnerColor = spinnerColor 46 | } 47 | 48 | open func startLoadingAnimation() { 49 | self.isAnimating = true 50 | self.cachedTitle = title(for: UIControl.State()) 51 | self.setTitle("", for: UIControl.State()) 52 | self.layer.addSublayer(spiner) 53 | 54 | // Animate 55 | self.cornerRadius() 56 | self.shrink() 57 | _ = Timer.schedule(delay: self.shrinkDuration - 0.25) { timer in 58 | self.spiner.animation() 59 | } 60 | } 61 | 62 | open func startFinishAnimation(_ delay: TimeInterval, completion:(()->())?) { 63 | self.isAnimating = true 64 | _ = Timer.schedule(delay: delay) { timer in 65 | self.didEndFinishAnimation = completion 66 | self.expand() 67 | self.spiner.stopAnimation() 68 | } 69 | } 70 | 71 | open func animate(_ duration: TimeInterval, completion:(()->())?) { 72 | startLoadingAnimation() 73 | startFinishAnimation(duration, completion: completion) 74 | } 75 | 76 | open func setOriginalState() { 77 | self.returnToOriginalState() 78 | self.spiner.stopAnimation() 79 | } 80 | 81 | public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 82 | let a = anim as! CABasicAnimation 83 | if a.keyPath == "transform.scale" { 84 | didEndFinishAnimation?() 85 | _ = Timer.schedule(delay: 1) { timer in 86 | self.returnToOriginalState() 87 | } 88 | } 89 | } 90 | 91 | open func returnToOriginalState() { 92 | self.spiner.removeFromSuperlayer() 93 | self.layer.removeAllAnimations() 94 | self.setTitle(self.cachedTitle, for: UIControl.State()) 95 | self.spiner.stopAnimation() 96 | self.isAnimating = false 97 | } 98 | 99 | func cornerRadius() { 100 | let cornerRadiusAnim = CABasicAnimation(keyPath: "cornerRadius") 101 | // cornerRadiusAnim.fromValue = frame.width 102 | cornerRadiusAnim.toValue = frame.height/2 103 | cornerRadiusAnim.duration = shrinkDuration 104 | cornerRadiusAnim.timingFunction = shrinkCurve 105 | cornerRadiusAnim.fillMode = CAMediaTimingFillMode.forwards 106 | cornerRadiusAnim.isRemovedOnCompletion = false 107 | layer.add(cornerRadiusAnim, forKey: cornerRadiusAnim.keyPath) 108 | } 109 | 110 | func shrink() { 111 | let shrinkAnim = CABasicAnimation(keyPath: "bounds.size.width") 112 | shrinkAnim.beginTime = CACurrentMediaTime() + 0.1 113 | shrinkAnim.fromValue = frame.width 114 | shrinkAnim.toValue = frame.height 115 | shrinkAnim.duration = shrinkDuration 116 | shrinkAnim.timingFunction = shrinkCurve 117 | shrinkAnim.fillMode = CAMediaTimingFillMode.forwards 118 | shrinkAnim.isRemovedOnCompletion = false 119 | layer.add(shrinkAnim, forKey: shrinkAnim.keyPath) 120 | } 121 | 122 | func expand() { 123 | let expandAnim = CABasicAnimation(keyPath: "transform.scale") 124 | expandAnim.fromValue = 1.0 125 | expandAnim.toValue = 26.0 126 | expandAnim.timingFunction = expandCurve 127 | expandAnim.duration = 0.3 128 | expandAnim.delegate = self 129 | expandAnim.fillMode = CAMediaTimingFillMode.forwards 130 | expandAnim.isRemovedOnCompletion = false 131 | layer.add(expandAnim, forKey: expandAnim.keyPath) 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/Home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Home.png" 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 | } -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/Home.imageset/Home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takuoka/TKSubmitTransition/1960d8e644c2dd3aa4585b6ed562f90ec8e13065/SubmitTransition/Images.xcassets/Home.imageset/Home.png -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/Login.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "Login.png" 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 | } -------------------------------------------------------------------------------- /SubmitTransition/Images.xcassets/Login.imageset/Login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takuoka/TKSubmitTransition/1960d8e644c2dd3aa4585b6ed562f90ec8e13065/SubmitTransition/Images.xcassets/Login.imageset/Login.png -------------------------------------------------------------------------------- /SubmitTransition/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /SubmitTransition/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // SubmitTransition 4 | // 5 | // Created by Takuya Okamoto on 2015/08/07. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | 10 | import UIKit 11 | 12 | class SecondViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | let bg = UIImageView(image: UIImage(named: "Home")) 18 | bg.frame = self.view.frame 19 | self.view.addSubview(bg) 20 | 21 | let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(SecondViewController.onTapScreen)) 22 | bg.isUserInteractionEnabled = true 23 | bg.addGestureRecognizer(tapRecognizer) 24 | } 25 | 26 | @objc func onTapScreen() { 27 | self.dismiss(animated: true, completion: nil) 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /SubmitTransition/ViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class ViewController: UIViewController, UIViewControllerTransitioningDelegate { 4 | var btn: TKTransitionSubmitButton! 5 | 6 | @IBOutlet weak var btnFromNib: TKTransitionSubmitButton! 7 | override func viewDidLoad() { 8 | super.viewDidLoad() 9 | 10 | UIApplication.shared.setStatusBarStyle(.lightContent, animated: false) 11 | 12 | let bg = UIImageView(image: UIImage(named: "Login")) 13 | bg.frame = self.view.frame 14 | self.view.addSubview(bg) 15 | 16 | btn = TKTransitionSubmitButton(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width - 64, height: 44)) 17 | btn.center = self.view.center 18 | btn.backgroundColor = .red 19 | btn.frame.bottom = self.view.frame.height - 60 20 | btn.setTitle("Sign in", for: UIControl.State()) 21 | btn.titleLabel?.font = UIFont(name: "HelveticaNeue-Light", size: 14) 22 | btn.addTarget(self, action: #selector(ViewController.onTapButton(_:)), for: UIControl.Event.touchUpInside) 23 | self.view.addSubview(btn) 24 | 25 | self.view.bringSubviewToFront(self.btnFromNib) 26 | } 27 | 28 | @IBAction func onTapButton(_ button: TKTransitionSubmitButton) { 29 | button.animate(1, completion: { () -> () in 30 | let secondVC = SecondViewController() 31 | secondVC.transitioningDelegate = self 32 | secondVC.modalPresentationStyle = .fullScreen 33 | self.present(secondVC, animated: true, completion: nil) 34 | }) 35 | } 36 | 37 | // MARK: UIViewControllerTransitioningDelegate 38 | func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 39 | return TKFadeInAnimator(transitionDuration: 0.5, startingAlpha: 0.8) 40 | } 41 | 42 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 43 | return nil 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SubmitTransitionTests/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 | -------------------------------------------------------------------------------- /SubmitTransitionTests/SubmitTransitionTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubmitTransitionTests.swift 3 | // SubmitTransitionTests 4 | // 5 | // Created by Takuya Okamoto on 2015/08/06. 6 | // Copyright (c) 2015年 Uniface. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SubmitTransitionTests: 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 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /TKSubmitTransition.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint TKSubmitTransition.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "TKSubmitTransition" 19 | s.version = "3.1.1" 20 | s.summary = "Animated UIButton of Loading Animation and Transition Animation. Inspired by https://dribbble.com/shots/1945593-Login-Home-Screen" 21 | 22 | # s.description = <<-DESC 23 | # Animated UIButton of Loading Animation and Transition Animation. Inspired by https://dribbble.com/shots/1945593-Login-Home-Screen 24 | # DESC 25 | 26 | s.homepage = "https://github.com/entotsu/TKSubmitTransition" 27 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 28 | 29 | 30 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 31 | # 32 | # Licensing your code is important. See http://choosealicense.com for more info. 33 | # CocoaPods will detect a license file if there is a named LICENSE* 34 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 35 | # 36 | 37 | # s.license = "MIT (example)" 38 | s.license = { :type => "MIT", :file => "LICENSE" } 39 | 40 | 41 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 42 | # 43 | # Specify the authors of the library, with email addresses. Email addresses 44 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 45 | # accepts just a name if you'd rather not provide an email address. 46 | # 47 | # Specify a social_media_url where others can refer to, for example a twitter 48 | # profile URL. 49 | # 50 | 51 | s.author = { "Takuya.Okamoto" => "blackn.red42@gmail.com" } 52 | # Or just: s.author = "Takuya.Okamoto" 53 | # s.authors = { "Takuya.Okamoto" => "blackn.red42@gmail.com" } 54 | # s.social_media_url = "http://twitter.com/Takuya.Okamoto" 55 | 56 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 57 | # 58 | # If this Pod runs only on iOS or OS X, then specify the platform and 59 | # the deployment target. You can optionally include the target after the platform. 60 | # 61 | 62 | # s.platform = :ios 63 | s.platform = :ios, "8.0" 64 | 65 | # When using multiple platforms 66 | # s.ios.deployment_target = "5.0" 67 | # s.osx.deployment_target = "10.7" 68 | 69 | 70 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 71 | # 72 | # Specify the location from where the source should be retrieved. 73 | # Supports git, hg, bzr, svn and HTTP. 74 | # 75 | 76 | s.source = { :git => "https://github.com/entotsu/TKSubmitTransition.git", :tag => s.version.to_s } 77 | s.swift_version = '5.0' 78 | 79 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 80 | # 81 | # CocoaPods is smart about how it includes source code. For source files 82 | # giving a folder will include any swift, h, m, mm, c & cpp files. 83 | # For header files it will include any header in the folder. 84 | # Not including the public_header_files will make all headers public. 85 | # 86 | 87 | s.source_files = "Classes", "SubmitTransition/Classes/*.swift" 88 | # s.exclude_files = "Classes/Exclude" 89 | 90 | # s.public_header_files = "Classes/**/*.h" 91 | 92 | 93 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 94 | # 95 | # A list of resources included with the Pod. These are copied into the 96 | # target bundle with a build phase script. Anything else will be cleaned. 97 | # You can preserve files from being cleaned, please don't preserve 98 | # non-essential files like tests, examples and documentation. 99 | # 100 | 101 | # s.resource = "icon.png" 102 | # s.resources = "Resources/*.png" 103 | 104 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 105 | 106 | 107 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 108 | # 109 | # Link your library with frameworks, or libraries. Libraries do not include 110 | # the lib prefix of their name. 111 | # 112 | 113 | # s.framework = "SomeFramework" 114 | # s.frameworks = "SomeFramework", "AnotherFramework" 115 | 116 | # s.library = "iconv" 117 | # s.libraries = "iconv", "xml2" 118 | 119 | 120 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 121 | # 122 | # If your library depends on compiler flags you can set them in the xcconfig hash 123 | # where they will only apply to your library. If you depend on other Podspecs 124 | # you can include multiple dependencies to ensure it works. 125 | 126 | # s.requires_arc = true 127 | 128 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 129 | # s.dependency "JSONKit", "~> 1.4" 130 | 131 | end 132 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takuoka/TKSubmitTransition/1960d8e644c2dd3aa4585b6ed562f90ec8e13065/demo.gif --------------------------------------------------------------------------------