├── .gitignore ├── LICENSE ├── LZBViewControllerTransitionAnimation ├── LZBViewControllerTransitionAnimation.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── LZBViewControllerTransitionAnimation │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── LZBCustomTransition │ ├── .DS_Store │ ├── Bubble │ │ ├── LZBBubbleTransition.h │ │ ├── LZBBubbleTransition.m │ │ ├── QQphone2.png │ │ ├── oneBubbleViewController.h │ │ ├── oneBubbleViewController.m │ │ ├── twoBubbleViewController.h │ │ └── twoBubbleViewController.m │ ├── CustomPresentDismiss │ │ ├── LZBCustomModalTransition.h │ │ ├── LZBCustomModalTransition.m │ │ ├── oneCustomModalViewContoller.h │ │ ├── oneCustomModalViewContoller.m │ │ ├── twoCustomModalViewContoller.h │ │ └── twoCustomModalViewContoller.m │ ├── LZBBaseTransition.h │ ├── LZBBaseTransition.m │ ├── Page(翻页转场) │ │ ├── LZBPageTransition.h │ │ ├── LZBPageTransition.m │ │ ├── onePageViewController.h │ │ ├── onePageViewController.m │ │ ├── twoPageViewController.h │ │ └── twoPageViewController.m │ ├── PresentWithDismiss │ │ ├── LZBPresentDismissTransition.h │ │ ├── LZBPresentDismissTransition.m │ │ ├── OnePresentViewController.h │ │ ├── OnePresentViewController.m │ │ ├── TwoPresentViewController.h │ │ └── TwoPresentViewController.m │ ├── PushWithPop │ │ ├── LZBBaseViewController.h │ │ ├── LZBBaseViewController.m │ │ ├── LZBPushPopTransition.h │ │ ├── LZBPushPopTransition.m │ │ ├── OneViewController.h │ │ ├── OneViewController.m │ │ ├── TwoViewController.h │ │ └── TwoViewController.m │ ├── QQPhone │ │ ├── LZBQQPhoneTransition.h │ │ ├── LZBQQPhoneTransition.m │ │ ├── oneQQPhoneViewController.h │ │ ├── oneQQPhoneViewController.m │ │ ├── twoQQPhoneViewController.h │ │ └── twoQQPhoneViewController.m │ └── Resource │ │ ├── QQPhone@2x.png │ │ ├── QQ_main.png │ │ ├── button.png │ │ ├── fengjin.png │ │ ├── meinv1.png │ │ ├── meinv2.png │ │ ├── tupain1.png │ │ ├── tupain2.png │ │ └── wechat_main.png │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /.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 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 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 | # https://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 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 18574C051D158589006E8E5E /* meinv2.png in Resources */ = {isa = PBXBuildFile; fileRef = 18574C041D158589006E8E5E /* meinv2.png */; }; 11 | 18574C071D158594006E8E5E /* meinv1.png in Resources */ = {isa = PBXBuildFile; fileRef = 18574C061D158594006E8E5E /* meinv1.png */; }; 12 | 18697A6F1D138DF200B1DDB0 /* LZBBubbleTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A6E1D138DF200B1DDB0 /* LZBBubbleTransition.m */; }; 13 | 18697A721D138E1200B1DDB0 /* oneBubbleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A711D138E1200B1DDB0 /* oneBubbleViewController.m */; }; 14 | 18697A751D138E2500B1DDB0 /* twoBubbleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A741D138E2500B1DDB0 /* twoBubbleViewController.m */; }; 15 | 18697A771D13D2F500B1DDB0 /* QQphone2.png in Resources */ = {isa = PBXBuildFile; fileRef = 18697A761D13D2F500B1DDB0 /* QQphone2.png */; }; 16 | 18697A7B1D13E71300B1DDB0 /* LZBPageTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A7A1D13E71300B1DDB0 /* LZBPageTransition.m */; }; 17 | 18697A7E1D13E73800B1DDB0 /* onePageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A7D1D13E73800B1DDB0 /* onePageViewController.m */; }; 18 | 18697A811D13E74600B1DDB0 /* twoPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18697A801D13E74600B1DDB0 /* twoPageViewController.m */; }; 19 | 187C95361D127B3E000B5964 /* LZBQQPhoneTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 187C95351D127B3E000B5964 /* LZBQQPhoneTransition.m */; }; 20 | 187C95391D128323000B5964 /* oneQQPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 187C95381D128323000B5964 /* oneQQPhoneViewController.m */; }; 21 | 187C953C1D128332000B5964 /* twoQQPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 187C953B1D128332000B5964 /* twoQQPhoneViewController.m */; }; 22 | 187C953E1D12841C000B5964 /* QQPhone@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 187C953D1D12841C000B5964 /* QQPhone@2x.png */; }; 23 | 187C95401D128443000B5964 /* wechat_main.png in Resources */ = {isa = PBXBuildFile; fileRef = 187C953F1D128443000B5964 /* wechat_main.png */; }; 24 | 187C95421D12846B000B5964 /* QQ_main.png in Resources */ = {isa = PBXBuildFile; fileRef = 187C95411D12846B000B5964 /* QQ_main.png */; }; 25 | 188E14211D12468B00EBA390 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14201D12468B00EBA390 /* main.m */; }; 26 | 188E14241D12468B00EBA390 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14231D12468B00EBA390 /* AppDelegate.m */; }; 27 | 188E14271D12468B00EBA390 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14261D12468B00EBA390 /* ViewController.m */; }; 28 | 188E142A1D12468B00EBA390 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 188E14281D12468B00EBA390 /* Main.storyboard */; }; 29 | 188E142C1D12468B00EBA390 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 188E142B1D12468B00EBA390 /* Assets.xcassets */; }; 30 | 188E142F1D12468B00EBA390 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 188E142D1D12468B00EBA390 /* LaunchScreen.storyboard */; }; 31 | 188E14501D1246AB00EBA390 /* LZBCustomModalTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14391D1246AB00EBA390 /* LZBCustomModalTransition.m */; }; 32 | 188E14511D1246AB00EBA390 /* oneCustomModalViewContoller.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E143B1D1246AB00EBA390 /* oneCustomModalViewContoller.m */; }; 33 | 188E14521D1246AB00EBA390 /* twoCustomModalViewContoller.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E143D1D1246AB00EBA390 /* twoCustomModalViewContoller.m */; }; 34 | 188E14531D1246AB00EBA390 /* LZBBaseTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E143F1D1246AB00EBA390 /* LZBBaseTransition.m */; }; 35 | 188E14541D1246AB00EBA390 /* LZBPresentDismissTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14421D1246AB00EBA390 /* LZBPresentDismissTransition.m */; }; 36 | 188E14551D1246AB00EBA390 /* OnePresentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14441D1246AB00EBA390 /* OnePresentViewController.m */; }; 37 | 188E14561D1246AB00EBA390 /* TwoPresentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14461D1246AB00EBA390 /* TwoPresentViewController.m */; }; 38 | 188E14571D1246AB00EBA390 /* LZBBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E14491D1246AB00EBA390 /* LZBBaseViewController.m */; }; 39 | 188E14581D1246AB00EBA390 /* LZBPushPopTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E144B1D1246AB00EBA390 /* LZBPushPopTransition.m */; }; 40 | 188E14591D1246AB00EBA390 /* OneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E144D1D1246AB00EBA390 /* OneViewController.m */; }; 41 | 188E145A1D1246AB00EBA390 /* TwoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188E144F1D1246AB00EBA390 /* TwoViewController.m */; }; 42 | 188E14601D1246BE00EBA390 /* button.png in Resources */ = {isa = PBXBuildFile; fileRef = 188E145C1D1246BE00EBA390 /* button.png */; }; 43 | 188E14611D1246BE00EBA390 /* fengjin.png in Resources */ = {isa = PBXBuildFile; fileRef = 188E145D1D1246BE00EBA390 /* fengjin.png */; }; 44 | 188E14621D1246BE00EBA390 /* tupain1.png in Resources */ = {isa = PBXBuildFile; fileRef = 188E145E1D1246BE00EBA390 /* tupain1.png */; }; 45 | 188E14631D1246BE00EBA390 /* tupain2.png in Resources */ = {isa = PBXBuildFile; fileRef = 188E145F1D1246BE00EBA390 /* tupain2.png */; }; 46 | /* End PBXBuildFile section */ 47 | 48 | /* Begin PBXFileReference section */ 49 | 18574C041D158589006E8E5E /* meinv2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = meinv2.png; sourceTree = ""; }; 50 | 18574C061D158594006E8E5E /* meinv1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = meinv1.png; sourceTree = ""; }; 51 | 18697A6D1D138DF200B1DDB0 /* LZBBubbleTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBBubbleTransition.h; sourceTree = ""; }; 52 | 18697A6E1D138DF200B1DDB0 /* LZBBubbleTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBBubbleTransition.m; sourceTree = ""; }; 53 | 18697A701D138E1200B1DDB0 /* oneBubbleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oneBubbleViewController.h; sourceTree = ""; }; 54 | 18697A711D138E1200B1DDB0 /* oneBubbleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = oneBubbleViewController.m; sourceTree = ""; }; 55 | 18697A731D138E2500B1DDB0 /* twoBubbleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = twoBubbleViewController.h; sourceTree = ""; }; 56 | 18697A741D138E2500B1DDB0 /* twoBubbleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = twoBubbleViewController.m; sourceTree = ""; }; 57 | 18697A761D13D2F500B1DDB0 /* QQphone2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = QQphone2.png; path = ../Bubble/QQphone2.png; sourceTree = ""; }; 58 | 18697A791D13E71300B1DDB0 /* LZBPageTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBPageTransition.h; sourceTree = ""; }; 59 | 18697A7A1D13E71300B1DDB0 /* LZBPageTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBPageTransition.m; sourceTree = ""; }; 60 | 18697A7C1D13E73800B1DDB0 /* onePageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = onePageViewController.h; sourceTree = ""; }; 61 | 18697A7D1D13E73800B1DDB0 /* onePageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = onePageViewController.m; sourceTree = ""; }; 62 | 18697A7F1D13E74600B1DDB0 /* twoPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = twoPageViewController.h; sourceTree = ""; }; 63 | 18697A801D13E74600B1DDB0 /* twoPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = twoPageViewController.m; sourceTree = ""; }; 64 | 187C95341D127B3E000B5964 /* LZBQQPhoneTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBQQPhoneTransition.h; sourceTree = ""; }; 65 | 187C95351D127B3E000B5964 /* LZBQQPhoneTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBQQPhoneTransition.m; sourceTree = ""; }; 66 | 187C95371D128323000B5964 /* oneQQPhoneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oneQQPhoneViewController.h; sourceTree = ""; }; 67 | 187C95381D128323000B5964 /* oneQQPhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = oneQQPhoneViewController.m; sourceTree = ""; }; 68 | 187C953A1D128332000B5964 /* twoQQPhoneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = twoQQPhoneViewController.h; sourceTree = ""; }; 69 | 187C953B1D128332000B5964 /* twoQQPhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = twoQQPhoneViewController.m; sourceTree = ""; }; 70 | 187C953D1D12841C000B5964 /* QQPhone@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "QQPhone@2x.png"; sourceTree = ""; }; 71 | 187C953F1D128443000B5964 /* wechat_main.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wechat_main.png; sourceTree = ""; }; 72 | 187C95411D12846B000B5964 /* QQ_main.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = QQ_main.png; sourceTree = ""; }; 73 | 188E141C1D12468B00EBA390 /* LZBViewControllerTransitionAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LZBViewControllerTransitionAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 74 | 188E14201D12468B00EBA390 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 75 | 188E14221D12468B00EBA390 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 76 | 188E14231D12468B00EBA390 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 77 | 188E14251D12468B00EBA390 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 78 | 188E14261D12468B00EBA390 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 79 | 188E14291D12468B00EBA390 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 80 | 188E142B1D12468B00EBA390 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 81 | 188E142E1D12468B00EBA390 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 82 | 188E14301D12468B00EBA390 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 83 | 188E14381D1246AB00EBA390 /* LZBCustomModalTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBCustomModalTransition.h; sourceTree = ""; }; 84 | 188E14391D1246AB00EBA390 /* LZBCustomModalTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBCustomModalTransition.m; sourceTree = ""; }; 85 | 188E143A1D1246AB00EBA390 /* oneCustomModalViewContoller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = oneCustomModalViewContoller.h; sourceTree = ""; }; 86 | 188E143B1D1246AB00EBA390 /* oneCustomModalViewContoller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = oneCustomModalViewContoller.m; sourceTree = ""; }; 87 | 188E143C1D1246AB00EBA390 /* twoCustomModalViewContoller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = twoCustomModalViewContoller.h; sourceTree = ""; }; 88 | 188E143D1D1246AB00EBA390 /* twoCustomModalViewContoller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = twoCustomModalViewContoller.m; sourceTree = ""; }; 89 | 188E143E1D1246AB00EBA390 /* LZBBaseTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBBaseTransition.h; sourceTree = ""; }; 90 | 188E143F1D1246AB00EBA390 /* LZBBaseTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBBaseTransition.m; sourceTree = ""; }; 91 | 188E14411D1246AB00EBA390 /* LZBPresentDismissTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBPresentDismissTransition.h; sourceTree = ""; }; 92 | 188E14421D1246AB00EBA390 /* LZBPresentDismissTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBPresentDismissTransition.m; sourceTree = ""; }; 93 | 188E14431D1246AB00EBA390 /* OnePresentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnePresentViewController.h; sourceTree = ""; }; 94 | 188E14441D1246AB00EBA390 /* OnePresentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnePresentViewController.m; sourceTree = ""; }; 95 | 188E14451D1246AB00EBA390 /* TwoPresentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwoPresentViewController.h; sourceTree = ""; }; 96 | 188E14461D1246AB00EBA390 /* TwoPresentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwoPresentViewController.m; sourceTree = ""; }; 97 | 188E14481D1246AB00EBA390 /* LZBBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LZBBaseViewController.h; path = LZBCustomTransition/PushWithPop/LZBBaseViewController.h; sourceTree = ""; }; 98 | 188E14491D1246AB00EBA390 /* LZBBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LZBBaseViewController.m; path = LZBCustomTransition/PushWithPop/LZBBaseViewController.m; sourceTree = ""; }; 99 | 188E144A1D1246AB00EBA390 /* LZBPushPopTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBPushPopTransition.h; sourceTree = ""; }; 100 | 188E144B1D1246AB00EBA390 /* LZBPushPopTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBPushPopTransition.m; sourceTree = ""; }; 101 | 188E144C1D1246AB00EBA390 /* OneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneViewController.h; sourceTree = ""; }; 102 | 188E144D1D1246AB00EBA390 /* OneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OneViewController.m; sourceTree = ""; }; 103 | 188E144E1D1246AB00EBA390 /* TwoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwoViewController.h; sourceTree = ""; }; 104 | 188E144F1D1246AB00EBA390 /* TwoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwoViewController.m; sourceTree = ""; }; 105 | 188E145C1D1246BE00EBA390 /* button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button.png; sourceTree = ""; }; 106 | 188E145D1D1246BE00EBA390 /* fengjin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = fengjin.png; sourceTree = ""; }; 107 | 188E145E1D1246BE00EBA390 /* tupain1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tupain1.png; sourceTree = ""; }; 108 | 188E145F1D1246BE00EBA390 /* tupain2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tupain2.png; sourceTree = ""; }; 109 | /* End PBXFileReference section */ 110 | 111 | /* Begin PBXFrameworksBuildPhase section */ 112 | 188E14191D12468B00EBA390 /* Frameworks */ = { 113 | isa = PBXFrameworksBuildPhase; 114 | buildActionMask = 2147483647; 115 | files = ( 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXFrameworksBuildPhase section */ 120 | 121 | /* Begin PBXGroup section */ 122 | 18697A6C1D138DCD00B1DDB0 /* Bubble(气泡) */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 18697A6D1D138DF200B1DDB0 /* LZBBubbleTransition.h */, 126 | 18697A6E1D138DF200B1DDB0 /* LZBBubbleTransition.m */, 127 | 18697A701D138E1200B1DDB0 /* oneBubbleViewController.h */, 128 | 18697A711D138E1200B1DDB0 /* oneBubbleViewController.m */, 129 | 18697A731D138E2500B1DDB0 /* twoBubbleViewController.h */, 130 | 18697A741D138E2500B1DDB0 /* twoBubbleViewController.m */, 131 | ); 132 | name = "Bubble(气泡)"; 133 | path = Bubble; 134 | sourceTree = ""; 135 | }; 136 | 18697A781D13E6EE00B1DDB0 /* Page(翻页转场) */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 18697A791D13E71300B1DDB0 /* LZBPageTransition.h */, 140 | 18697A7A1D13E71300B1DDB0 /* LZBPageTransition.m */, 141 | 18697A7C1D13E73800B1DDB0 /* onePageViewController.h */, 142 | 18697A7D1D13E73800B1DDB0 /* onePageViewController.m */, 143 | 18697A7F1D13E74600B1DDB0 /* twoPageViewController.h */, 144 | 18697A801D13E74600B1DDB0 /* twoPageViewController.m */, 145 | ); 146 | path = "Page(翻页转场)"; 147 | sourceTree = ""; 148 | }; 149 | 187C95331D127B14000B5964 /* QQPhone(高仿QQ电话) */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 187C95341D127B3E000B5964 /* LZBQQPhoneTransition.h */, 153 | 187C95351D127B3E000B5964 /* LZBQQPhoneTransition.m */, 154 | 187C95371D128323000B5964 /* oneQQPhoneViewController.h */, 155 | 187C95381D128323000B5964 /* oneQQPhoneViewController.m */, 156 | 187C953A1D128332000B5964 /* twoQQPhoneViewController.h */, 157 | 187C953B1D128332000B5964 /* twoQQPhoneViewController.m */, 158 | ); 159 | name = "QQPhone(高仿QQ电话)"; 160 | path = QQPhone; 161 | sourceTree = ""; 162 | }; 163 | 188E14131D12468B00EBA390 = { 164 | isa = PBXGroup; 165 | children = ( 166 | 188E141E1D12468B00EBA390 /* LZBViewControllerTransitionAnimation */, 167 | 188E141D1D12468B00EBA390 /* Products */, 168 | ); 169 | sourceTree = ""; 170 | }; 171 | 188E141D1D12468B00EBA390 /* Products */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 188E141C1D12468B00EBA390 /* LZBViewControllerTransitionAnimation.app */, 175 | ); 176 | name = Products; 177 | sourceTree = ""; 178 | }; 179 | 188E141E1D12468B00EBA390 /* LZBViewControllerTransitionAnimation */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 188E14361D1246AB00EBA390 /* LZBCustomTransition */, 183 | 188E14221D12468B00EBA390 /* AppDelegate.h */, 184 | 188E14231D12468B00EBA390 /* AppDelegate.m */, 185 | 188E14251D12468B00EBA390 /* ViewController.h */, 186 | 188E14261D12468B00EBA390 /* ViewController.m */, 187 | 188E14481D1246AB00EBA390 /* LZBBaseViewController.h */, 188 | 188E14491D1246AB00EBA390 /* LZBBaseViewController.m */, 189 | 188E14281D12468B00EBA390 /* Main.storyboard */, 190 | 188E142B1D12468B00EBA390 /* Assets.xcassets */, 191 | 188E142D1D12468B00EBA390 /* LaunchScreen.storyboard */, 192 | 188E14301D12468B00EBA390 /* Info.plist */, 193 | 188E141F1D12468B00EBA390 /* Supporting Files */, 194 | ); 195 | path = LZBViewControllerTransitionAnimation; 196 | sourceTree = ""; 197 | }; 198 | 188E141F1D12468B00EBA390 /* Supporting Files */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 188E14201D12468B00EBA390 /* main.m */, 202 | ); 203 | name = "Supporting Files"; 204 | sourceTree = ""; 205 | }; 206 | 188E14361D1246AB00EBA390 /* LZBCustomTransition */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | 188E143E1D1246AB00EBA390 /* LZBBaseTransition.h */, 210 | 188E143F1D1246AB00EBA390 /* LZBBaseTransition.m */, 211 | 18697A781D13E6EE00B1DDB0 /* Page(翻页转场) */, 212 | 18697A6C1D138DCD00B1DDB0 /* Bubble(气泡) */, 213 | 187C95331D127B14000B5964 /* QQPhone(高仿QQ电话) */, 214 | 188E14371D1246AB00EBA390 /* CustomPresentDismiss(自定义模态) */, 215 | 188E14401D1246AB00EBA390 /* PresentWithDismiss */, 216 | 188E14471D1246AB00EBA390 /* PushWithPop */, 217 | 188E145B1D1246BE00EBA390 /* Resource */, 218 | ); 219 | path = LZBCustomTransition; 220 | sourceTree = ""; 221 | }; 222 | 188E14371D1246AB00EBA390 /* CustomPresentDismiss(自定义模态) */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | 188E14381D1246AB00EBA390 /* LZBCustomModalTransition.h */, 226 | 188E14391D1246AB00EBA390 /* LZBCustomModalTransition.m */, 227 | 188E143A1D1246AB00EBA390 /* oneCustomModalViewContoller.h */, 228 | 188E143B1D1246AB00EBA390 /* oneCustomModalViewContoller.m */, 229 | 188E143C1D1246AB00EBA390 /* twoCustomModalViewContoller.h */, 230 | 188E143D1D1246AB00EBA390 /* twoCustomModalViewContoller.m */, 231 | ); 232 | name = "CustomPresentDismiss(自定义模态)"; 233 | path = CustomPresentDismiss; 234 | sourceTree = ""; 235 | }; 236 | 188E14401D1246AB00EBA390 /* PresentWithDismiss */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | 188E14411D1246AB00EBA390 /* LZBPresentDismissTransition.h */, 240 | 188E14421D1246AB00EBA390 /* LZBPresentDismissTransition.m */, 241 | 188E14431D1246AB00EBA390 /* OnePresentViewController.h */, 242 | 188E14441D1246AB00EBA390 /* OnePresentViewController.m */, 243 | 188E14451D1246AB00EBA390 /* TwoPresentViewController.h */, 244 | 188E14461D1246AB00EBA390 /* TwoPresentViewController.m */, 245 | ); 246 | path = PresentWithDismiss; 247 | sourceTree = ""; 248 | }; 249 | 188E14471D1246AB00EBA390 /* PushWithPop */ = { 250 | isa = PBXGroup; 251 | children = ( 252 | 188E144A1D1246AB00EBA390 /* LZBPushPopTransition.h */, 253 | 188E144B1D1246AB00EBA390 /* LZBPushPopTransition.m */, 254 | 188E144C1D1246AB00EBA390 /* OneViewController.h */, 255 | 188E144D1D1246AB00EBA390 /* OneViewController.m */, 256 | 188E144E1D1246AB00EBA390 /* TwoViewController.h */, 257 | 188E144F1D1246AB00EBA390 /* TwoViewController.m */, 258 | ); 259 | path = PushWithPop; 260 | sourceTree = ""; 261 | }; 262 | 188E145B1D1246BE00EBA390 /* Resource */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | 18574C061D158594006E8E5E /* meinv1.png */, 266 | 18574C041D158589006E8E5E /* meinv2.png */, 267 | 18697A761D13D2F500B1DDB0 /* QQphone2.png */, 268 | 187C95411D12846B000B5964 /* QQ_main.png */, 269 | 187C953F1D128443000B5964 /* wechat_main.png */, 270 | 187C953D1D12841C000B5964 /* QQPhone@2x.png */, 271 | 188E145C1D1246BE00EBA390 /* button.png */, 272 | 188E145D1D1246BE00EBA390 /* fengjin.png */, 273 | 188E145E1D1246BE00EBA390 /* tupain1.png */, 274 | 188E145F1D1246BE00EBA390 /* tupain2.png */, 275 | ); 276 | path = Resource; 277 | sourceTree = ""; 278 | }; 279 | /* End PBXGroup section */ 280 | 281 | /* Begin PBXNativeTarget section */ 282 | 188E141B1D12468B00EBA390 /* LZBViewControllerTransitionAnimation */ = { 283 | isa = PBXNativeTarget; 284 | buildConfigurationList = 188E14331D12468B00EBA390 /* Build configuration list for PBXNativeTarget "LZBViewControllerTransitionAnimation" */; 285 | buildPhases = ( 286 | 188E14181D12468B00EBA390 /* Sources */, 287 | 188E14191D12468B00EBA390 /* Frameworks */, 288 | 188E141A1D12468B00EBA390 /* Resources */, 289 | ); 290 | buildRules = ( 291 | ); 292 | dependencies = ( 293 | ); 294 | name = LZBViewControllerTransitionAnimation; 295 | productName = LZBViewControllerTransitionAnimation; 296 | productReference = 188E141C1D12468B00EBA390 /* LZBViewControllerTransitionAnimation.app */; 297 | productType = "com.apple.product-type.application"; 298 | }; 299 | /* End PBXNativeTarget section */ 300 | 301 | /* Begin PBXProject section */ 302 | 188E14141D12468B00EBA390 /* Project object */ = { 303 | isa = PBXProject; 304 | attributes = { 305 | LastUpgradeCheck = 0730; 306 | ORGANIZATIONNAME = apple; 307 | TargetAttributes = { 308 | 188E141B1D12468B00EBA390 = { 309 | CreatedOnToolsVersion = 7.3.1; 310 | DevelopmentTeam = 8LYGY3ZDDQ; 311 | }; 312 | }; 313 | }; 314 | buildConfigurationList = 188E14171D12468B00EBA390 /* Build configuration list for PBXProject "LZBViewControllerTransitionAnimation" */; 315 | compatibilityVersion = "Xcode 3.2"; 316 | developmentRegion = English; 317 | hasScannedForEncodings = 0; 318 | knownRegions = ( 319 | en, 320 | Base, 321 | ); 322 | mainGroup = 188E14131D12468B00EBA390; 323 | productRefGroup = 188E141D1D12468B00EBA390 /* Products */; 324 | projectDirPath = ""; 325 | projectRoot = ""; 326 | targets = ( 327 | 188E141B1D12468B00EBA390 /* LZBViewControllerTransitionAnimation */, 328 | ); 329 | }; 330 | /* End PBXProject section */ 331 | 332 | /* Begin PBXResourcesBuildPhase section */ 333 | 188E141A1D12468B00EBA390 /* Resources */ = { 334 | isa = PBXResourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | 188E14621D1246BE00EBA390 /* tupain1.png in Resources */, 338 | 18574C071D158594006E8E5E /* meinv1.png in Resources */, 339 | 188E142F1D12468B00EBA390 /* LaunchScreen.storyboard in Resources */, 340 | 18697A771D13D2F500B1DDB0 /* QQphone2.png in Resources */, 341 | 187C95421D12846B000B5964 /* QQ_main.png in Resources */, 342 | 188E14601D1246BE00EBA390 /* button.png in Resources */, 343 | 188E14611D1246BE00EBA390 /* fengjin.png in Resources */, 344 | 18574C051D158589006E8E5E /* meinv2.png in Resources */, 345 | 188E14631D1246BE00EBA390 /* tupain2.png in Resources */, 346 | 187C953E1D12841C000B5964 /* QQPhone@2x.png in Resources */, 347 | 188E142C1D12468B00EBA390 /* Assets.xcassets in Resources */, 348 | 188E142A1D12468B00EBA390 /* Main.storyboard in Resources */, 349 | 187C95401D128443000B5964 /* wechat_main.png in Resources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXResourcesBuildPhase section */ 354 | 355 | /* Begin PBXSourcesBuildPhase section */ 356 | 188E14181D12468B00EBA390 /* Sources */ = { 357 | isa = PBXSourcesBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | 188E14541D1246AB00EBA390 /* LZBPresentDismissTransition.m in Sources */, 361 | 188E14501D1246AB00EBA390 /* LZBCustomModalTransition.m in Sources */, 362 | 187C95391D128323000B5964 /* oneQQPhoneViewController.m in Sources */, 363 | 18697A6F1D138DF200B1DDB0 /* LZBBubbleTransition.m in Sources */, 364 | 188E14511D1246AB00EBA390 /* oneCustomModalViewContoller.m in Sources */, 365 | 18697A751D138E2500B1DDB0 /* twoBubbleViewController.m in Sources */, 366 | 187C953C1D128332000B5964 /* twoQQPhoneViewController.m in Sources */, 367 | 188E14271D12468B00EBA390 /* ViewController.m in Sources */, 368 | 18697A721D138E1200B1DDB0 /* oneBubbleViewController.m in Sources */, 369 | 188E14551D1246AB00EBA390 /* OnePresentViewController.m in Sources */, 370 | 188E14561D1246AB00EBA390 /* TwoPresentViewController.m in Sources */, 371 | 188E14521D1246AB00EBA390 /* twoCustomModalViewContoller.m in Sources */, 372 | 188E145A1D1246AB00EBA390 /* TwoViewController.m in Sources */, 373 | 188E14241D12468B00EBA390 /* AppDelegate.m in Sources */, 374 | 188E14531D1246AB00EBA390 /* LZBBaseTransition.m in Sources */, 375 | 188E14211D12468B00EBA390 /* main.m in Sources */, 376 | 18697A811D13E74600B1DDB0 /* twoPageViewController.m in Sources */, 377 | 187C95361D127B3E000B5964 /* LZBQQPhoneTransition.m in Sources */, 378 | 188E14571D1246AB00EBA390 /* LZBBaseViewController.m in Sources */, 379 | 188E14581D1246AB00EBA390 /* LZBPushPopTransition.m in Sources */, 380 | 188E14591D1246AB00EBA390 /* OneViewController.m in Sources */, 381 | 18697A7E1D13E73800B1DDB0 /* onePageViewController.m in Sources */, 382 | 18697A7B1D13E71300B1DDB0 /* LZBPageTransition.m in Sources */, 383 | ); 384 | runOnlyForDeploymentPostprocessing = 0; 385 | }; 386 | /* End PBXSourcesBuildPhase section */ 387 | 388 | /* Begin PBXVariantGroup section */ 389 | 188E14281D12468B00EBA390 /* Main.storyboard */ = { 390 | isa = PBXVariantGroup; 391 | children = ( 392 | 188E14291D12468B00EBA390 /* Base */, 393 | ); 394 | name = Main.storyboard; 395 | sourceTree = ""; 396 | }; 397 | 188E142D1D12468B00EBA390 /* LaunchScreen.storyboard */ = { 398 | isa = PBXVariantGroup; 399 | children = ( 400 | 188E142E1D12468B00EBA390 /* Base */, 401 | ); 402 | name = LaunchScreen.storyboard; 403 | sourceTree = ""; 404 | }; 405 | /* End PBXVariantGroup section */ 406 | 407 | /* Begin XCBuildConfiguration section */ 408 | 188E14311D12468B00EBA390 /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ALWAYS_SEARCH_USER_PATHS = NO; 412 | CLANG_ANALYZER_NONNULL = YES; 413 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 414 | CLANG_CXX_LIBRARY = "libc++"; 415 | CLANG_ENABLE_MODULES = YES; 416 | CLANG_ENABLE_OBJC_ARC = YES; 417 | CLANG_WARN_BOOL_CONVERSION = YES; 418 | CLANG_WARN_CONSTANT_CONVERSION = YES; 419 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 420 | CLANG_WARN_EMPTY_BODY = YES; 421 | CLANG_WARN_ENUM_CONVERSION = YES; 422 | CLANG_WARN_INT_CONVERSION = YES; 423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 424 | CLANG_WARN_UNREACHABLE_CODE = YES; 425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 427 | COPY_PHASE_STRIP = NO; 428 | DEBUG_INFORMATION_FORMAT = dwarf; 429 | ENABLE_STRICT_OBJC_MSGSEND = YES; 430 | ENABLE_TESTABILITY = YES; 431 | GCC_C_LANGUAGE_STANDARD = gnu99; 432 | GCC_DYNAMIC_NO_PIC = NO; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_OPTIMIZATION_LEVEL = 0; 435 | GCC_PREPROCESSOR_DEFINITIONS = ( 436 | "DEBUG=1", 437 | "$(inherited)", 438 | ); 439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 441 | GCC_WARN_UNDECLARED_SELECTOR = YES; 442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 443 | GCC_WARN_UNUSED_FUNCTION = YES; 444 | GCC_WARN_UNUSED_VARIABLE = YES; 445 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 446 | MTL_ENABLE_DEBUG_INFO = YES; 447 | ONLY_ACTIVE_ARCH = YES; 448 | SDKROOT = iphoneos; 449 | }; 450 | name = Debug; 451 | }; 452 | 188E14321D12468B00EBA390 /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ALWAYS_SEARCH_USER_PATHS = NO; 456 | CLANG_ANALYZER_NONNULL = YES; 457 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 458 | CLANG_CXX_LIBRARY = "libc++"; 459 | CLANG_ENABLE_MODULES = YES; 460 | CLANG_ENABLE_OBJC_ARC = YES; 461 | CLANG_WARN_BOOL_CONVERSION = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_EMPTY_BODY = YES; 465 | CLANG_WARN_ENUM_CONVERSION = YES; 466 | CLANG_WARN_INT_CONVERSION = YES; 467 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 468 | CLANG_WARN_UNREACHABLE_CODE = YES; 469 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 470 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 471 | COPY_PHASE_STRIP = NO; 472 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 473 | ENABLE_NS_ASSERTIONS = NO; 474 | ENABLE_STRICT_OBJC_MSGSEND = YES; 475 | GCC_C_LANGUAGE_STANDARD = gnu99; 476 | GCC_NO_COMMON_BLOCKS = YES; 477 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 478 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 479 | GCC_WARN_UNDECLARED_SELECTOR = YES; 480 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 481 | GCC_WARN_UNUSED_FUNCTION = YES; 482 | GCC_WARN_UNUSED_VARIABLE = YES; 483 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 484 | MTL_ENABLE_DEBUG_INFO = NO; 485 | SDKROOT = iphoneos; 486 | VALIDATE_PRODUCT = YES; 487 | }; 488 | name = Release; 489 | }; 490 | 188E14341D12468B00EBA390 /* Debug */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 494 | CODE_SIGN_IDENTITY = "iPhone Developer"; 495 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 496 | INFOPLIST_FILE = LZBViewControllerTransitionAnimation/Info.plist; 497 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 499 | PRODUCT_BUNDLE_IDENTIFIER = "-23334.LZBViewControllerTransitionAnimation"; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | PROVISIONING_PROFILE = ""; 502 | }; 503 | name = Debug; 504 | }; 505 | 188E14351D12468B00EBA390 /* Release */ = { 506 | isa = XCBuildConfiguration; 507 | buildSettings = { 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 509 | CODE_SIGN_IDENTITY = "iPhone Developer"; 510 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 511 | INFOPLIST_FILE = LZBViewControllerTransitionAnimation/Info.plist; 512 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = "-23334.LZBViewControllerTransitionAnimation"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | PROVISIONING_PROFILE = ""; 517 | }; 518 | name = Release; 519 | }; 520 | /* End XCBuildConfiguration section */ 521 | 522 | /* Begin XCConfigurationList section */ 523 | 188E14171D12468B00EBA390 /* Build configuration list for PBXProject "LZBViewControllerTransitionAnimation" */ = { 524 | isa = XCConfigurationList; 525 | buildConfigurations = ( 526 | 188E14311D12468B00EBA390 /* Debug */, 527 | 188E14321D12468B00EBA390 /* Release */, 528 | ); 529 | defaultConfigurationIsVisible = 0; 530 | defaultConfigurationName = Release; 531 | }; 532 | 188E14331D12468B00EBA390 /* Build configuration list for PBXNativeTarget "LZBViewControllerTransitionAnimation" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 188E14341D12468B00EBA390 /* Debug */, 536 | 188E14351D12468B00EBA390 /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | /* End XCConfigurationList section */ 542 | }; 543 | rootObject = 188E14141D12468B00EBA390 /* Project object */; 544 | } 545 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 15/6/16. 6 | // Copyright © 201年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/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 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/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 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/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 | 40 | 41 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/.DS_Store -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/LZBBubbleTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBubbleTransition.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBBubbleTransition : LZBBaseTransition 12 | 13 | /** 14 | * 设置触发事件的View 15 | */ 16 | @property (nonatomic, strong) UIView *targetView; 17 | 18 | 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/LZBBubbleTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBubbleTransition.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBubbleTransition.h" 10 | 11 | @interface LZBBubbleTransition () 12 | 13 | @property (nonatomic, strong) UIView *transitionView; 14 | 15 | @end 16 | 17 | @implementation LZBBubbleTransition 18 | - (void)animateTransition:(id)transitionContext 19 | { 20 | UIView *containerView = [transitionContext containerView]; 21 | if(containerView == nil) return; 22 | 23 | if(self.transitionType == kLZBBaseTransitionStyle_Present) 24 | { 25 | [self animationPresentTrasition:transitionContext WithContainerView:containerView]; 26 | } 27 | else 28 | { 29 | [self animationDismissTrasition:transitionContext WithContainerView:containerView]; 30 | } 31 | } 32 | 33 | #pragma mark - present动画 34 | - (void)animationPresentTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 35 | { 36 | 37 | UIView *toView = [self toView:transitionContext]; 38 | 39 | //中间过度动画View 40 | CGPoint startPoint = self.targetView.center; 41 | CGPoint toViewCenter = toView.center; 42 | CGSize toViewSize = toView.frame.size; 43 | 44 | //两个View一起动的 - 动画的View(圆形动画) 45 | self.transitionView.backgroundColor = self.targetView.backgroundColor; 46 | self.transitionView.frame = [self computeChangeViewFrame:toViewSize]; 47 | self.transitionView.layer.cornerRadius = self.transitionView.frame.size.height * 0.5; 48 | self.transitionView.transform = CGAffineTransformMakeScale(0.001, 0.001); 49 | self.transitionView.center = startPoint; 50 | [containerView addSubview:self.transitionView]; 51 | 52 | //最终需要的结果 - 正方形动画(只有这个) 53 | toView.transform = CGAffineTransformMakeScale(0.001, 0.001); 54 | toView.center = startPoint; 55 | toView.alpha = 0.0; 56 | [containerView addSubview:toView]; 57 | 58 | __weak typeof(self) weakself = self; 59 | if([self bounceIsEnable]) 60 | { 61 | [UIView animateWithDuration:2.0 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:2 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 62 | weakself.transitionView.transform = CGAffineTransformIdentity; 63 | toView.transform = CGAffineTransformIdentity; 64 | toView.alpha =1.0; 65 | toView.center = toViewCenter; 66 | } completion:^(BOOL finished) { 67 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 68 | }]; 69 | } 70 | else 71 | { 72 | [UIView animateWithDuration:2.0 animations:^{ 73 | weakself.transitionView.transform = CGAffineTransformIdentity; 74 | toView.transform = CGAffineTransformIdentity; 75 | toView.alpha =1.0; 76 | toView.center = toViewCenter; 77 | 78 | } completion:^(BOOL finished) { 79 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 80 | }]; 81 | } 82 | 83 | 84 | 85 | } 86 | #pragma mark - dismiss动画 87 | - (void)animationDismissTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 88 | { 89 | UIView *fromView = [self fromView:transitionContext]; 90 | CGPoint fromViewCenter = fromView.center; 91 | CGSize fromViewSize = fromView.frame.size; 92 | 93 | //动画初始值 94 | self.transitionView.frame = [self computeChangeViewFrame:fromViewSize]; 95 | self.transitionView.center = self.targetView.center; 96 | self.transitionView.layer.cornerRadius = self.transitionView.frame.size.height * 0.5; 97 | __weak typeof(self) weakSelf = self; 98 | if([self bounceIsEnable]) 99 | { 100 | [UIView animateWithDuration:self.duration delay:0.0 usingSpringWithDamping:0.5 initialSpringVelocity:2.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ 101 | weakSelf.transitionView.transform = CGAffineTransformMakeScale(0.001, 0.001); 102 | fromView.transform =CGAffineTransformMakeScale(0.001, 0.001); 103 | fromView.alpha = 0.0; 104 | fromView.center = weakSelf.targetView.center; 105 | } completion:^(BOOL finished) { 106 | fromView.center = fromViewCenter; 107 | [fromView removeFromSuperview]; 108 | [weakSelf.transitionView removeFromSuperview]; 109 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 110 | }]; 111 | } 112 | else 113 | { 114 | [UIView animateWithDuration:self.duration animations:^{ 115 | weakSelf.transitionView.transform = CGAffineTransformMakeScale(0.001, 0.001); 116 | fromView.transform =CGAffineTransformMakeScale(0.001, 0.001); 117 | fromView.alpha = 0.0; 118 | fromView.center = weakSelf.targetView.center; 119 | 120 | } completion:^(BOOL finished) { 121 | 122 | fromView.center = fromViewCenter; 123 | [fromView removeFromSuperview]; 124 | [weakSelf.transitionView removeFromSuperview]; 125 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 126 | 127 | }]; 128 | } 129 | 130 | } 131 | 132 | - (CGRect)computeChangeViewFrame:(CGSize)toSize 133 | { 134 | CGFloat x = fmax(self.targetView.center.x, toSize.width - self.targetView.center.x); 135 | CGFloat y = fmax(self.targetView.center.y, toSize.height - self.targetView.center.y); 136 | CGFloat radius = sqrt(x * x + y * y); 137 | CGFloat diamter = radius * 2; 138 | return CGRectMake(0, 0, diamter, diamter); 139 | } 140 | 141 | - (UIView *)transitionView 142 | { 143 | if(_transitionView == nil) 144 | { 145 | _transitionView = [UIView new]; 146 | } 147 | return _transitionView; 148 | } 149 | @end 150 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/QQphone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/QQphone2.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/oneBubbleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // oneBubbleViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface oneBubbleViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/oneBubbleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // oneBubbleViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "oneBubbleViewController.h" 10 | #import "twoBubbleViewController.h" 11 | #import "LZBBubbleTransition.h" 12 | 13 | @interface oneBubbleViewController () 14 | 15 | @property (nonatomic,strong) LZBBubbleTransition *bubbleTransition; 16 | @property (nonatomic, strong) UIButton *presentButton; 17 | @end 18 | 19 | 20 | @implementation oneBubbleViewController 21 | 22 | - (void)viewDidLoad 23 | { 24 | [super viewDidLoad]; 25 | [self setupAddpresentButton]; 26 | } 27 | - (void)setupAddpresentButton 28 | { 29 | self.presentButton = [UIButton buttonWithType:UIButtonTypeCustom]; 30 | [self.view addSubview:self.presentButton]; 31 | self.presentButton.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height*0.5); 32 | self.presentButton.bounds = CGRectMake(0, 0, 50, 50); 33 | self.presentButton.layer.cornerRadius = 25; 34 | self.presentButton.layer.masksToBounds = YES; 35 | self.presentButton.backgroundColor = [UIColor redColor]; 36 | self.presentButton.titleLabel.font = [UIFont boldSystemFontOfSize:18.0]; 37 | [self.presentButton setTitle:@"+" forState:UIControlStateNormal]; 38 | [self.presentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 39 | [self.presentButton addTarget:self action:@selector(presentButtonClick) forControlEvents:UIControlEventTouchUpInside]; 40 | 41 | } 42 | - (void)presentButtonClick 43 | { 44 | __weak typeof(self) weakSelf = self; 45 | 46 | twoBubbleViewController *two = [[twoBubbleViewController alloc]init]; 47 | two.modalPresentationStyle = UIModalPresentationCustom; 48 | self.bubbleTransition = [[LZBBubbleTransition alloc]initWithPresent:^(UIViewController *presented, UIViewController *presenting, UIViewController *sourceVC, LZBBaseTransition *transition) { 49 | LZBBubbleTransition *bubble = (LZBBubbleTransition *)transition; 50 | //设置动画的View 51 | bubble.targetView = weakSelf.presentButton; 52 | //设置弹簧属性 53 | bubble.bounceIsEnable = YES; 54 | } Dismiss:^(UIViewController *dismissVC, LZBBaseTransition *transition) { 55 | 56 | }]; 57 | two.transitioningDelegate = weakSelf.bubbleTransition; 58 | [self presentViewController:two animated:YES completion:nil]; 59 | } 60 | @end 61 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/twoBubbleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // twoBubbleViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface twoBubbleViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Bubble/twoBubbleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // twoBubbleViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "twoBubbleViewController.h" 10 | 11 | @interface twoBubbleViewController () 12 | 13 | @property (nonatomic, strong) UIButton *backButton; 14 | @end 15 | 16 | @implementation twoBubbleViewController 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor redColor]; 21 | self.backButton = [UIButton buttonWithType:UIButtonTypeCustom]; 22 | self.backButton.center = CGPointMake(self.view.center.x, 100); 23 | self.backButton.bounds = CGRectMake(0, 0, 100, 40); 24 | [self.view addSubview:self.backButton]; 25 | [self.backButton setTitle:@"点我返回哦" forState:UIControlStateNormal]; 26 | [self.backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside]; 27 | 28 | } 29 | 30 | - (void)backButtonClick 31 | { 32 | [self dismissViewControllerAnimated:YES completion:nil]; 33 | } 34 | 35 | 36 | 37 | - (void)dealloc 38 | { 39 | NSLog(@"销毁---twoBubbleViewController"); 40 | } 41 | @end 42 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/LZBCustomModalTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBCustomModalTransition.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBCustomModalTransition : LZBBaseTransition 12 | 13 | /** 14 | * 设置源控制器的放大比例,默认是scale=0.8 15 | */ 16 | @property (nonatomic, assign) CGFloat scale; 17 | 18 | /** 19 | * 截图是否包括导航条,默认是Yes 20 | */ 21 | @property (nonatomic, assign) BOOL screenShotIsIncludeNavigatebar; 22 | 23 | /** 24 | * 设置目的View的高度,默认是toView高度的0.5 25 | */ 26 | @property (nonatomic, assign) CGFloat toViewRequireHeight; 27 | @end 28 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/LZBCustomModalTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBCustomModalTransition.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBCustomModalTransition.h" 10 | 11 | #define default_scale 0.8 12 | 13 | @interface LZBCustomModalTransition() 14 | 15 | @property (nonatomic, weak) UIViewController *fromViewController; 16 | 17 | @end 18 | 19 | @implementation LZBCustomModalTransition 20 | 21 | -(instancetype)initWithPresent:(LZBBaseTransitionPresent)presentCallBack Dismiss:(LZBBaseTransitionDismiss)dismissCallBack 22 | { 23 | if(self = [super initWithPresent:presentCallBack Dismiss:dismissCallBack]) 24 | { 25 | self.scale = default_scale; 26 | self.screenShotIsIncludeNavigatebar = YES; 27 | 28 | } 29 | return self; 30 | } 31 | 32 | - (void)animateTransition:(id)transitionContext 33 | { 34 | UIView *containerView = [transitionContext containerView]; 35 | if(containerView == nil) return; 36 | if(self.transitionType == kLZBBaseTransitionStyle_Present) 37 | { 38 | UIView *toView = [self toView:transitionContext]; 39 | UIView *fromView =[self fromView:transitionContext]; 40 | 41 | 42 | //如果有临时的View,那么FromView就没有什么用 43 | UIView *fromTempView = nil; 44 | if([self screenShotIsIncludeNavigatebar]) 45 | { 46 | fromTempView = [[UIScreen mainScreen] snapshotViewAfterScreenUpdates:NO]; 47 | fromTempView.frame = [UIScreen mainScreen].bounds; 48 | } 49 | else 50 | { 51 | fromTempView = [fromView snapshotViewAfterScreenUpdates:NO]; 52 | fromTempView.frame = fromView.frame; 53 | } 54 | [containerView addSubview:fromTempView]; 55 | fromView.alpha = 0.0; 56 | 57 | //设置目的控制器的View 58 | CGFloat height = 0; 59 | if(self.toViewRequireHeight > 0) 60 | { 61 | height = self.toViewRequireHeight; 62 | } 63 | else 64 | height = toView.frame.size.height * 0.5; 65 | 66 | toView.frame = CGRectMake(toView.frame.origin.x, fromView.frame.size.height, toView.frame.size.width, height); 67 | [containerView addSubview:toView]; 68 | 69 | //增加手势在后面的View上面 70 | self.fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 71 | [fromTempView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(fromTempViewClick)]]; 72 | 73 | //增加动画效果 74 | if(self.bounceIsEnable ==NO) 75 | { 76 | [UIView animateWithDuration:self.duration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 77 | 78 | fromTempView.transform = CGAffineTransformMakeScale(self.scale, self.scale); 79 | 80 | toView.transform = CGAffineTransformMakeTranslation(0, -height); 81 | 82 | } completion:^(BOOL finished) { 83 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 84 | }]; 85 | } 86 | else 87 | { 88 | // damp是弹簧系数,velecity:弹簧速度 89 | [UIView animateWithDuration:self.duration delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 90 | 91 | fromTempView.transform = CGAffineTransformMakeScale(self.scale, self.scale); 92 | toView.transform = CGAffineTransformMakeTranslation(0, -height); 93 | 94 | } completion:^(BOOL finished) { 95 | 96 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 97 | }]; 98 | 99 | } 100 | } 101 | else 102 | { 103 | UIView *toView = [self toView:transitionContext]; //目的View 104 | UIView *fromView = [self fromView:transitionContext]; //源View 105 | UIView *toTempView = [containerView.subviews firstObject]; //目的的过度View 106 | //注意: [containerView.subviews lastObject]就是fromView,也就是外面这个View 107 | // [containerView.subviews firstObject] 就是保存的上一个动画的toView,但是也不是这个直接的toView 108 | if(self.bounceIsEnable == NO) 109 | { 110 | [UIView animateWithDuration:self.duration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 111 | toTempView.transform = CGAffineTransformIdentity; 112 | fromView.transform = CGAffineTransformIdentity; 113 | } completion:^(BOOL finished) { 114 | toView.alpha =1.0; 115 | [toTempView removeFromSuperview]; 116 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 117 | }]; 118 | 119 | } 120 | else 121 | { 122 | // damp是弹簧系数,velecity:弹簧速度 123 | [UIView animateWithDuration:self.duration delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ 124 | 125 | toTempView.transform = CGAffineTransformIdentity; 126 | fromView.transform = CGAffineTransformIdentity; 127 | 128 | } completion:^(BOOL finished) { 129 | toView.alpha =1.0; 130 | [toTempView removeFromSuperview]; 131 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 132 | }]; 133 | 134 | } 135 | 136 | } 137 | 138 | } 139 | 140 | - (void)fromTempViewClick 141 | { 142 | 143 | [self.fromViewController dismissViewControllerAnimated:YES completion:nil]; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/oneCustomModalViewContoller.h: -------------------------------------------------------------------------------- 1 | // 2 | // oneCustomModalViewContoller.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface oneCustomModalViewContoller : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/oneCustomModalViewContoller.m: -------------------------------------------------------------------------------- 1 | // 2 | // oneCustomModalViewContoller.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "oneCustomModalViewContoller.h" 10 | #import "twoCustomModalViewContoller.h" 11 | #import "LZBCustomModalTransition.h" 12 | 13 | @interface oneCustomModalViewContoller () 14 | 15 | @property (nonatomic, strong) LZBCustomModalTransition *customModalTransition; 16 | 17 | @property (nonatomic, strong) UIButton *presentButton; 18 | 19 | @property (nonatomic, strong) UIImageView *imageView; 20 | 21 | @end 22 | 23 | @implementation oneCustomModalViewContoller 24 | 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | 30 | self.imageView = [UIImageView new]; 31 | [self.view addSubview:self.imageView]; 32 | self.imageView.image = [UIImage imageNamed:@"tupain1"]; 33 | self.imageView.frame =CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 64); 34 | self.imageView.userInteractionEnabled = YES; 35 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 36 | 37 | 38 | 39 | self.presentButton = [UIButton buttonWithType:UIButtonTypeCustom]; 40 | [self.view addSubview:self.presentButton]; 41 | self.presentButton.center = CGPointMake(self.view.center.x, self.view.frame.size.height - 50); 42 | self.presentButton.bounds = CGRectMake(0, 0, 100, 100); 43 | self.presentButton.backgroundColor = [UIColor grayColor]; 44 | self.presentButton.layer.cornerRadius = 50; 45 | self.presentButton.layer.masksToBounds = YES; 46 | [self.presentButton setImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal]; 47 | self.view.backgroundColor = [UIColor blueColor]; 48 | [self.presentButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 49 | [self.presentButton addTarget:self action:@selector(presentButtonClick) forControlEvents:UIControlEventTouchUpInside]; 50 | } 51 | - (void)presentButtonClick 52 | { 53 | twoCustomModalViewContoller *twoVC = [[twoCustomModalViewContoller alloc]init]; 54 | self.customModalTransition = [[LZBCustomModalTransition alloc]initWithPresent:^(UIViewController *presented, UIViewController *presenting, UIViewController *sourceVC, LZBBaseTransition *transition) { 55 | LZBCustomModalTransition *modalTransition = (LZBCustomModalTransition *)transition; 56 | modalTransition.scale = 0.9; 57 | modalTransition.bounceIsEnable = YES; 58 | // modalTransition.toViewRequireHeight = 200; 59 | // modalTransition.screenShotIsIncludeNavigatebar = NO; 60 | 61 | } Dismiss:^(UIViewController *dismissVC, LZBBaseTransition *transition) { 62 | 63 | }]; 64 | twoVC.transitioningDelegate = self.customModalTransition; 65 | [self presentViewController:twoVC animated:YES completion:nil]; 66 | } 67 | @end 68 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/twoCustomModalViewContoller.h: -------------------------------------------------------------------------------- 1 | // 2 | // twoCustomModalViewContoller.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface twoCustomModalViewContoller : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/CustomPresentDismiss/twoCustomModalViewContoller.m: -------------------------------------------------------------------------------- 1 | // 2 | // twoCustomModalViewContoller.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/15. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "twoCustomModalViewContoller.h" 10 | 11 | @interface twoCustomModalViewContoller () 12 | 13 | @property (nonatomic, strong) UIImageView *imageView; 14 | @end 15 | 16 | @implementation twoCustomModalViewContoller 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | self.imageView = [UIImageView new]; 22 | [self.view addSubview:self.imageView]; 23 | self.imageView.image = [UIImage imageNamed:@"tupain2"]; 24 | self.imageView.frame = self.view.bounds; 25 | self.imageView.userInteractionEnabled = YES; 26 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 27 | 28 | [self.imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imageViewClick)]]; 29 | } 30 | - (void)imageViewClick 31 | { 32 | [self dismissViewControllerAnimated:YES completion:nil]; 33 | } 34 | 35 | - (void)dealloc 36 | { 37 | NSLog(@"销毁---twoCustomModalViewContoller"); 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/LZBBaseTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBaseTransition.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/13. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class LZBBaseTransition; 13 | 14 | /** 15 | * present弹出控制器 16 | * 17 | * @param presented 即将弹出的控制器 18 | * @param presenting 正在弹出的控制器 19 | * @param sourceVC 源控制器 20 | * @param transition 21 | */ 22 | typedef void(^LZBBaseTransitionPresent)(UIViewController *presented, 23 | UIViewController *presenting, 24 | UIViewController *sourceVC, 25 | LZBBaseTransition *transition); 26 | /** 27 | * dismiss消失 28 | * 29 | * @param dismissVC dismissVC消失控制器 30 | * @param transition 31 | */ 32 | typedef void(^LZBBaseTransitionDismiss)(UIViewController *dismissVC, 33 | LZBBaseTransition *transition); 34 | 35 | /** 36 | * push 37 | * 38 | * @param fromVC 源控制器 39 | * @param toVC 目的控制器 40 | * @param transition 转场类型 41 | */ 42 | typedef void(^LZBBaseTransitionPush)(UIViewController *fromVC, 43 | UIViewController *toVC, 44 | LZBBaseTransition *transition); 45 | 46 | /** 47 | * pop 48 | * 49 | * @param fromVC 源控制器 50 | * @param toVC 目的控制器 51 | * @param transition 转场类型 52 | */ 53 | typedef void(^LZBBaseTransitionPop)(UIViewController *fromVC, 54 | UIViewController *toVC, 55 | LZBBaseTransition *transition); 56 | 57 | typedef NS_ENUM(NSInteger,LZBBaseTransitionStyle){ 58 | kLZBBaseTransitionStyle_Present, //present 59 | kLZBBaseTransitionStyle_Dismiss, //dismiss 60 | kLZBBaseTransitionStyle_Push, //push 61 | kLZBBaseTransitionStyle_Pop, //pop 62 | 63 | }; 64 | 65 | 66 | //遵守动画控制器的协议 67 | @interface LZBBaseTransition : NSObject< 68 | UIViewControllerAnimatedTransitioning, //转场动画协议 69 | UIViewControllerTransitioningDelegate, //转场代理协议- modal 70 | UINavigationControllerDelegate> //导航代理协议- push/Pop 71 | 72 | #pragma mark - 转场动画类型参数 73 | 74 | /** 75 | * 设置转场动画的时间,默认是0.5s 76 | */ 77 | @property (nonatomic, assign) NSTimeInterval duration; 78 | 79 | /** 80 | * 设置转场样式 81 | */ 82 | @property (nonatomic, assign) LZBBaseTransitionStyle transitionType; 83 | 84 | /** 85 | * 设置是否具有弹簧效果,默认是NO 86 | */ 87 | @property (nonatomic, assign) BOOL bounceIsEnable; 88 | 89 | #pragma mark - 方法调用 90 | /** 91 | * 实例化方法 push - pop 92 | * 93 | * @param pushCallBack push回调 94 | * @param popCallBack pop回调 95 | * 96 | * @return 97 | */ 98 | - (instancetype)initWithPush:(LZBBaseTransitionPush)pushCallBack 99 | Pop:(LZBBaseTransitionPop)popCallBack; 100 | 101 | /** 102 | * 实例化 present - dismiss Modal 103 | * 104 | * @param presentCallBack present回调 105 | * @param dismissCallBack dismiss回调 106 | * 107 | * @return 108 | */ 109 | - (instancetype)initWithPresent:(LZBBaseTransitionPresent) presentCallBack 110 | Dismiss:(LZBBaseTransitionDismiss) dismissCallBack; 111 | 112 | /** 113 | * 获得源View - fromView 114 | */ 115 | - (UIView *)fromView:(id )transitionContext; 116 | 117 | /** 118 | * 获得目的View - toView 119 | */ 120 | - (UIView *)toView:(id )transitionContext; 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/LZBBaseTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBaseTransition.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/13. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | //默认动画时间 11 | #define default_Duration 0.5 12 | 13 | @interface LZBBaseTransition () 14 | 15 | /** 16 | * present回调block 17 | */ 18 | @property (nonatomic, copy) LZBBaseTransitionPresent animationPresentCallBack; 19 | 20 | /** 21 | * dismiss回调block 22 | */ 23 | @property (nonatomic, copy) LZBBaseTransitionDismiss animationDismissCallBack; 24 | 25 | /** 26 | * push回调block 27 | */ 28 | @property (nonatomic, copy) LZBBaseTransitionPush animationPushCallBack; 29 | 30 | /** 31 | * pop回调block 32 | */ 33 | @property (nonatomic, copy) LZBBaseTransitionPop animationPopCallBack; 34 | 35 | @end 36 | 37 | @implementation LZBBaseTransition 38 | 39 | #pragma mark - UIViewControllerAnimatedTransitioning 40 | 41 | - (NSTimeInterval)transitionDuration:(id)transitionContext 42 | { 43 | return self.duration; 44 | } 45 | 46 | - (void)animateTransition:(id )transitionContext 47 | { 48 | #ifdef DEBUG 49 | NSLog(@"实现动画必须重写这个方法"); 50 | #endif 51 | } 52 | 53 | - (void)animationEnded:(BOOL)transitionCompleted 54 | { 55 | 56 | } 57 | 58 | #pragma mark -UIViewControllerTransitioningDelegate 59 | 60 | - (nullable id )animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source 61 | { 62 | self.transitionType = kLZBBaseTransitionStyle_Present; 63 | if(self.animationPresentCallBack) 64 | self.animationPresentCallBack(presented,presenting,source,self); 65 | return self; 66 | } 67 | 68 | - (nullable id )animationControllerForDismissedController:(UIViewController *)dismissed 69 | { 70 | self.transitionType = kLZBBaseTransitionStyle_Dismiss; 71 | if(self.animationDismissCallBack) 72 | self.animationDismissCallBack(dismissed,self); 73 | return self; 74 | } 75 | 76 | #pragma mark - UINavigationControllerDelegate 77 | - (nullable id )navigationController: 78 | (UINavigationController *)navigationController 79 | animationControllerForOperation:(UINavigationControllerOperation)operation 80 | fromViewController:(UIViewController *)fromVC 81 | toViewController:(UIViewController *)toVC 82 | { 83 | if(operation == UINavigationControllerOperationPush) 84 | { 85 | self.transitionType = kLZBBaseTransitionStyle_Push; 86 | if(self.animationPushCallBack) 87 | self.animationPushCallBack(fromVC,toVC,self); 88 | } 89 | else if(operation == UINavigationControllerOperationPop) 90 | { 91 | //回来的代理一定要清空 92 | toVC.navigationController.delegate = nil; 93 | self.transitionType = kLZBBaseTransitionStyle_Pop; 94 | if(self.animationPopCallBack) 95 | self.animationPopCallBack(fromVC,toVC,self); 96 | } 97 | 98 | return self; 99 | } 100 | 101 | 102 | 103 | #pragma mark -实例化方法 104 | 105 | -(instancetype)init 106 | { 107 | if(self = [super init]) 108 | { 109 | self.transitionType = kLZBBaseTransitionStyle_Push; 110 | self.duration = default_Duration; 111 | self.bounceIsEnable = NO; 112 | 113 | } 114 | return self; 115 | } 116 | - (instancetype)initWithPush:(LZBBaseTransitionPush)pushCallBack Pop:(LZBBaseTransitionPop)popCallBack 117 | { 118 | if (self = [self init]) 119 | { 120 | self.animationPushCallBack = pushCallBack; 121 | self.animationPopCallBack = popCallBack; 122 | } 123 | return self; 124 | } 125 | 126 | - (instancetype)initWithPresent:(LZBBaseTransitionPresent)presentCallBack Dismiss:(LZBBaseTransitionDismiss)dismissCallBack 127 | { 128 | if(self =[self init]) 129 | { 130 | self.animationPresentCallBack = presentCallBack; 131 | self.animationDismissCallBack = dismissCallBack; 132 | } 133 | return self; 134 | } 135 | 136 | #pragma mark - View的操作 137 | - (UIView *)fromView:(id)transitionContext 138 | { 139 | UIView *fromView = nil; 140 | //源控制器 141 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 142 | if([transitionContext respondsToSelector:@selector(viewForKey:)]) 143 | { 144 | fromView = [transitionContext viewForKey:UITransitionContextFromViewKey]; 145 | } 146 | else 147 | fromView = fromVC.view; 148 | //初始位置的frame 149 | fromView.frame = [transitionContext initialFrameForViewController:fromVC]; 150 | return fromView; 151 | } 152 | 153 | - (UIView *)toView:(id)transitionContext 154 | { 155 | UIView *toView = nil; 156 | //目的控制器 157 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 158 | if([transitionContext respondsToSelector:@selector(viewForKey:)]) 159 | { 160 | toView = [transitionContext viewForKey:UITransitionContextToViewKey]; 161 | } 162 | else 163 | toView = toVC.view; 164 | //动画结束位置的frame 165 | toView.frame = [transitionContext finalFrameForViewController:toVC]; 166 | return toView; 167 | } 168 | @end 169 | 170 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/LZBPageTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPageTransition.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBPageTransition : LZBBaseTransition 12 | 13 | /** 14 | * 截图是否包括导航条,默认是Yes 15 | */ 16 | @property (nonatomic, assign) BOOL screenShotIsIncludeNavigatebar; 17 | 18 | /** 19 | * 翻页是否增加阴影效果,默认是NO 20 | */ 21 | @property (nonatomic, assign) BOOL shadowIsEnable; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/LZBPageTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPageTransition.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBPageTransition.h" 10 | 11 | @interface LZBPageTransition () 12 | 13 | /** 14 | * 过度动画View 15 | */ 16 | @property (nonatomic, strong) UIView *transitonView; 17 | 18 | @property (nonatomic,strong) id transitionContext; 19 | 20 | @end 21 | 22 | @implementation LZBPageTransition 23 | - (instancetype)initWithPush:(LZBBaseTransitionPush)pushCallBack Pop:(LZBBaseTransitionPop)popCallBack 24 | { 25 | if(self = [super initWithPush:pushCallBack Pop:popCallBack]) 26 | { 27 | self.shadowIsEnable = NO; 28 | } 29 | return self; 30 | } 31 | 32 | - (void)animateTransition:(id)transitionContext 33 | { 34 | UIView *containerView = [transitionContext containerView]; 35 | if(containerView == nil) return; 36 | 37 | if(self.transitionType == kLZBBaseTransitionStyle_Push) 38 | { 39 | [self animationPushTrasition:transitionContext WithContainerView:containerView]; 40 | } 41 | else 42 | { 43 | [self animationPopTrasition:transitionContext WithContainerView:containerView]; 44 | } 45 | } 46 | #pragma mark - present动画 47 | - (void)animationPushTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 48 | { 49 | self.transitionContext = transitionContext; 50 | UIView *fromView = [self fromView:transitionContext]; 51 | if([self screenShotIsIncludeNavigatebar]) 52 | { 53 | self.transitonView = [[UIScreen mainScreen] snapshotViewAfterScreenUpdates:NO]; 54 | self.transitonView.frame = [UIScreen mainScreen].bounds; 55 | } 56 | else 57 | { 58 | self.transitonView = [fromView snapshotViewAfterScreenUpdates:NO]; 59 | self.transitonView.frame = fromView.frame; 60 | } 61 | fromView.alpha = 0.0; 62 | [containerView addSubview:self.transitonView]; 63 | 64 | 65 | UIView *toView = [self toView:transitionContext]; 66 | toView.alpha = 0.0; 67 | [containerView addSubview:toView]; 68 | 69 | 70 | [self setAnchorPoint:CGPointMake(0, 0.5) WithView:self.transitonView]; 71 | 72 | //动画效果 用CATransition不能实现动画效果,个人觉得是同样是转场动画,不能执行 73 | // [self transitionWithType:kCATransitionReveal WithSubType:kCATransitionFromRight ToView:self.transitonView]; 74 | 75 | CATransform3D transfrom3d = CATransform3DIdentity; 76 | transfrom3d.m34 = 0.002; //设置z轴参数 77 | containerView.layer.sublayerTransform = transfrom3d; 78 | 79 | //是否增加阴影 80 | if([self shadowIsEnable]) 81 | { 82 | [self addGradientLayerToView:self.transitonView WithAlpha:0.0]; 83 | [self addGradientLayerToView:toView WithAlpha:1.0]; 84 | } 85 | __weak typeof(self) weakSelf = self; 86 | [UIView animateWithDuration:2.0 animations:^{ 87 | weakSelf.transitonView.layer.transform = CATransform3DMakeRotation(M_PI_2, 0, 1, 0); 88 | 89 | if([weakSelf shadowIsEnable]) 90 | { 91 | weakSelf.transitonView.subviews.lastObject.alpha = 1.0; 92 | toView.subviews.lastObject.alpha = 0.0; 93 | } 94 | toView.alpha = 1.0; 95 | } completion:^(BOOL finished) { 96 | 97 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 98 | }]; 99 | } 100 | 101 | - (void)animationPopTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 102 | { 103 | UIView *toView = [self toView:transitionContext]; 104 | [containerView addSubview:toView]; 105 | 106 | __weak typeof(self) weakSelf = self; 107 | [UIView animateWithDuration:self.duration animations:^{ 108 | weakSelf.transitonView.layer.transform = CATransform3DIdentity; 109 | toView.alpha =1.0; 110 | } completion:^(BOOL finished) { 111 | 112 | [weakSelf.transitonView removeFromSuperview]; 113 | weakSelf.transitionContext = nil; 114 | 115 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 116 | 117 | }]; 118 | } 119 | 120 | - (void)setAnchorPoint:(CGPoint)point WithView:(UIView *)view 121 | { 122 | view.frame =CGRectOffset(view.frame, (point.x - view.layer.anchorPoint.x) * view.frame.size.width, (point.y - view.layer.anchorPoint.y) * view.frame.size.height); 123 | view.layer.anchorPoint = point; 124 | } 125 | 126 | /** 127 | * 增加动画效果到View上面 128 | */ 129 | - (void)transitionWithType:(NSString *)type WithSubType:(NSString *)subType ToView:(UIView*)view 130 | { 131 | CATransition *animation = [CATransition animation]; 132 | animation.type = (type == nil)?@"push":type; 133 | animation.subtype = (subType == nil)?@"fromLeft":subType; 134 | animation.duration =3.0; 135 | animation.delegate = self; 136 | //设置动画速度 137 | animation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeInEaseOut"]; 138 | [view.layer addAnimation:animation forKey:@"animation"]; 139 | 140 | } 141 | 142 | /** 143 | * 增加阴影效果在View上面 144 | */ 145 | - (void)addGradientLayerToView:(UIView *)view WithAlpha:(CGFloat)alpha 146 | { 147 | //增加阴影 148 | CAGradientLayer *gradient = [CAGradientLayer layer]; 149 | gradient.frame = view.bounds; 150 | gradient.colors = @[(id)[UIColor blackColor].CGColor, 151 | (id)[UIColor blackColor].CGColor]; 152 | gradient.startPoint = CGPointMake(0.0, 0.5); 153 | gradient.endPoint = CGPointMake(1.0, 0.5); 154 | UIView *shadow = [[UIView alloc]initWithFrame:view.bounds]; 155 | shadow.backgroundColor = [UIColor clearColor]; 156 | [shadow.layer insertSublayer:gradient atIndex:1]; 157 | shadow.alpha = alpha; 158 | [view addSubview:shadow]; 159 | } 160 | @end 161 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/onePageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // onePageViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface onePageViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/onePageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // onePageViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "onePageViewController.h" 10 | #import "twoPageViewController.h" 11 | #import "LZBPageTransition.h" 12 | 13 | @interface onePageViewController () 14 | 15 | @property (nonatomic, strong) UIButton *presentButton; 16 | @property (nonatomic, strong) UIImageView *imageView; 17 | 18 | @property (nonatomic, strong) LZBPageTransition *pageTransition; 19 | 20 | @end 21 | 22 | @implementation onePageViewController 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | [self setupAddBackImageView]; 27 | [self setupAddpresentButton]; 28 | } 29 | 30 | - (void)setupAddBackImageView 31 | { 32 | self.imageView = [UIImageView new]; 33 | [self.view addSubview:self.imageView]; 34 | self.imageView.image = [UIImage imageNamed:@"meinv1"]; 35 | self.imageView.frame =CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 64); 36 | self.imageView.userInteractionEnabled = YES; 37 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 38 | } 39 | 40 | - (void)setupAddpresentButton 41 | { 42 | self.presentButton = [UIButton buttonWithType:UIButtonTypeCustom]; 43 | [self.view addSubview:self.presentButton]; 44 | self.presentButton.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height*0.5); 45 | self.presentButton.bounds = CGRectMake(0, 0, 200, 50); 46 | self.presentButton.titleLabel.font = [UIFont boldSystemFontOfSize:18.0]; 47 | [self.presentButton setTitle:@"点我是下一张哦" forState:UIControlStateNormal]; 48 | self.presentButton.titleLabel.textAlignment = NSTextAlignmentCenter; 49 | [self.presentButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; 50 | [self.presentButton addTarget:self action:@selector(presentButtonClick) forControlEvents:UIControlEventTouchUpInside]; 51 | 52 | } 53 | - (void)presentButtonClick 54 | { 55 | 56 | twoPageViewController *two = [[twoPageViewController alloc]init]; 57 | self.pageTransition = [[LZBPageTransition alloc]initWithPush:^(UIViewController *fromVC, UIViewController *toVC, LZBBaseTransition *transition) { 58 | LZBPageTransition *page = (LZBPageTransition*)transition; 59 | page.screenShotIsIncludeNavigatebar = YES; 60 | 61 | } Pop:^(UIViewController *fromVC, UIViewController *toVC, LZBBaseTransition *transition) { 62 | 63 | }]; 64 | self.navigationController.delegate = self.pageTransition; 65 | [self.navigationController pushViewController:two animated:YES]; 66 | 67 | } 68 | @end 69 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/twoPageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // twoPageViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface twoPageViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Page(翻页转场)/twoPageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // twoPageViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/17. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "twoPageViewController.h" 10 | 11 | @interface twoPageViewController () 12 | @property (nonatomic, strong) UIImageView *imageView; 13 | @end 14 | 15 | @implementation twoPageViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | [self setupAddBackImageView]; 21 | } 22 | - (void)setupAddBackImageView 23 | { 24 | self.imageView = [UIImageView new]; 25 | [self.view addSubview:self.imageView]; 26 | self.imageView.image = [UIImage imageNamed:@"meinv2"]; 27 | self.imageView.frame =CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height ); 28 | self.imageView.userInteractionEnabled = YES; 29 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 30 | [self.imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imageViewClick)]]; 31 | 32 | } 33 | - (void)imageViewClick 34 | { 35 | [self.navigationController popViewControllerAnimated:YES]; 36 | } 37 | 38 | - (void)dealloc 39 | { 40 | NSLog(@"销毁---twoPageViewController"); 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/LZBPresentDismissTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPresentDismissTransition.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBPresentDismissTransition : LZBBaseTransition 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/LZBPresentDismissTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPresentDismissTransition.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBPresentDismissTransition.h" 10 | 11 | @implementation LZBPresentDismissTransition 12 | 13 | - (void)animateTransition:(id)transitionContext 14 | { 15 | UIView *containerView = [transitionContext containerView]; 16 | if(containerView == nil) return; 17 | 18 | if(self.transitionType == kLZBBaseTransitionStyle_Present) 19 | { 20 | UIView *toView = [self toView:transitionContext]; 21 | UIView *fromView = [self fromView:transitionContext]; 22 | [containerView addSubview:toView]; 23 | [containerView addSubview:fromView]; 24 | 25 | toView.alpha = 1.0; 26 | fromView.alpha = 1.0; 27 | 28 | toView.frame = CGRectMake(0,fromView.frame.size.height, toView.frame.size.width, toView.frame.size.height); 29 | 30 | [UIView animateWithDuration:2.0 animations:^{ 31 | toView.frame = CGRectMake(0,0, toView.frame.size.width, toView.frame.size.height); 32 | fromView.alpha = 0.0; 33 | } completion:^(BOOL finished) { 34 | 35 | toView.alpha = 1.0; 36 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 37 | 38 | }]; 39 | 40 | } 41 | else if(self.transitionType == kLZBBaseTransitionStyle_Dismiss) 42 | { 43 | UIView *toView = [self toView:transitionContext]; 44 | UIView *fromView = [self fromView:transitionContext]; 45 | [containerView addSubview:toView]; 46 | [containerView addSubview:fromView]; 47 | 48 | toView.alpha = 1.0; 49 | fromView.alpha = 1.0; 50 | 51 | fromView.frame = CGRectMake(0,0 , fromView.frame.size.width, fromView.frame.size.height); 52 | 53 | [UIView animateWithDuration:2.0 animations:^{ 54 | fromView.frame = CGRectMake(0, toView.frame.size.height, fromView.frame.size.width, fromView.frame.size.height); 55 | 56 | } completion:^(BOOL finished) { 57 | fromView.alpha = 0.0; 58 | toView.alpha = 1.0; 59 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 60 | 61 | }]; 62 | 63 | } 64 | 65 | 66 | } 67 | @end 68 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/OnePresentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OnePresentViewController.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface OnePresentViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/OnePresentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OnePresentViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "OnePresentViewController.h" 10 | #import "LZBPresentDismissTransition.h" 11 | #import "TwoPresentViewController.h" 12 | 13 | @interface OnePresentViewController () 14 | 15 | @property (nonatomic, strong) UILabel *contentLab; 16 | 17 | @property (nonatomic, strong) UIButton *presentButton; 18 | 19 | @property (nonatomic, strong) LZBPresentDismissTransition *presentTransition; 20 | 21 | @end 22 | 23 | @implementation OnePresentViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | 28 | self.contentLab = [UILabel new]; 29 | [self.view addSubview:self.contentLab]; 30 | self.contentLab.text = @"模拟系统的modal---from"; 31 | self.contentLab.frame = CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, 200); 32 | self.contentLab.textAlignment = NSTextAlignmentCenter; 33 | self.contentLab.numberOfLines = 0; 34 | self.contentLab.textColor = [UIColor purpleColor]; 35 | 36 | self.presentButton = [UIButton buttonWithType:UIButtonTypeCustom]; 37 | [self.view addSubview:self.presentButton]; 38 | self.presentButton.center =self.view.center; 39 | self.presentButton.bounds = CGRectMake(0, 0, 200, 40); 40 | self.presentButton.backgroundColor = [UIColor grayColor]; 41 | [self.presentButton setTitle:@"点击present动画" forState:UIControlStateNormal]; 42 | self.view.backgroundColor = [UIColor blueColor]; 43 | [self.presentButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 44 | [self.presentButton addTarget:self action:@selector(presentButtonClick) forControlEvents:UIControlEventTouchUpInside]; 45 | 46 | } 47 | 48 | - (void)presentButtonClick 49 | { 50 | TwoPresentViewController *two = [[TwoPresentViewController alloc]init]; 51 | self.presentTransition = [[LZBPresentDismissTransition alloc]initWithPresent:^(UIViewController *presented, UIViewController *presenting, UIViewController *sourceVC, LZBBaseTransition *transition) { 52 | 53 | 54 | } Dismiss:^(UIViewController *dismissVC, LZBBaseTransition *transition) { 55 | 56 | }]; 57 | two.transitioningDelegate =self.presentTransition; 58 | [self presentViewController:two animated:YES completion:nil]; 59 | } 60 | 61 | 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/TwoPresentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TwoPresentViewController.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface TwoPresentViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PresentWithDismiss/TwoPresentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TwoPresentViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "TwoPresentViewController.h" 10 | 11 | @interface TwoPresentViewController () 12 | 13 | @property (nonatomic, strong) UILabel *centerLab; 14 | 15 | @end 16 | 17 | @implementation TwoPresentViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.title = @"modal控制器"; 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | self.centerLab = [UILabel new]; 24 | [self.view addSubview:self.centerLab]; 25 | self.centerLab.center = self.view.center; 26 | self.centerLab.bounds = CGRectMake(0, 0, 200, 40); 27 | self.centerLab.text = @"modal出来的控制器---to"; 28 | self.centerLab.textColor = [UIColor blueColor]; 29 | self.centerLab.textAlignment = NSTextAlignmentCenter; 30 | } 31 | 32 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 33 | { 34 | [self dismissViewControllerAnimated:YES completion:nil]; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/LZBBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBaseViewController.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LZBBaseViewController : UIViewController 12 | 13 | - (instancetype)initWithTitle:(NSString *)title; 14 | @end 15 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/LZBBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBBaseViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface LZBBaseViewController () 12 | 13 | @end 14 | 15 | @implementation LZBBaseViewController 16 | - (instancetype)initWithTitle:(NSString *)title 17 | { 18 | if(self =[super init]) 19 | { 20 | self.title = title; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | self.view.backgroundColor = [UIColor whiteColor]; 28 | } 29 | 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/LZBPushPopTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPushPopTransition.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/13. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBPushPopTransition : LZBBaseTransition 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/LZBPushPopTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBPushPopTransition.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/13. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBPushPopTransition.h" 10 | 11 | @implementation LZBPushPopTransition 12 | - (void)animateTransition:(id)transitionContext 13 | { 14 | //1.获得容器的View 15 | UIView *containerView = [transitionContext containerView]; 16 | if(containerView == nil) return; 17 | 18 | //PUSH的情况 19 | if(self.transitionType == kLZBBaseTransitionStyle_Push) 20 | { 21 | //2.获得源View 和toView 22 | UIView *toView = [self toView:transitionContext]; 23 | UIView *fromView = [self fromView:transitionContext]; 24 | 25 | //3.设置View的frame 并增加到容器中 26 | [containerView addSubview:toView]; 27 | [containerView addSubview:fromView]; 28 | 29 | //4.设置基本参数,设置目的控制器在源控制器的左边 30 | toView.frame = CGRectMake(fromView.frame.size.width, 0, toView.frame.size.width, toView.frame.size.height); 31 | //5.动画效果 32 | [UIView animateWithDuration:3.0 animations:^{ 33 | //源控制器推出窗口 34 | fromView.frame = CGRectMake(-fromView.frame.size.width, 0, fromView.frame.size.width, fromView.frame.size.height); 35 | toView.frame = CGRectMake(0, 0, toView.frame.size.width, toView.frame.size.height); 36 | } completion:^(BOOL finished) { 37 | toView.alpha =1.0; 38 | fromView.alpha = 0.0; 39 | //结束动画 40 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 41 | }]; 42 | 43 | } 44 | else if(self.transitionType == kLZBBaseTransitionStyle_Pop) 45 | { 46 | UIView *toView = [self toView:transitionContext]; 47 | UIView *fromView = [self fromView:transitionContext]; 48 | 49 | [containerView addSubview:toView]; 50 | [containerView addSubview:fromView]; 51 | 52 | toView.alpha = 1.0; 53 | fromView.alpha = 1.0; 54 | 55 | toView.frame = CGRectMake(-toView.frame.size.width, 0, toView.frame.size.width, toView.frame.size.height); 56 | //实现动画 - 动画时间可以设置 57 | [UIView animateWithDuration:3.0 animations:^{ 58 | 59 | fromView.frame =CGRectMake(toView.frame.size.width, 0, fromView.frame.size.width, fromView.frame.size.height); 60 | toView.frame = CGRectMake(0, 0, toView.frame.size.width, toView.frame.size.height); 61 | 62 | } completion:^(BOOL finished) { 63 | 64 | toView.alpha = 1.0; 65 | fromView.alpha = 0.0; 66 | [fromView removeFromSuperview]; 67 | //结束动画 68 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 69 | }]; 70 | 71 | } 72 | } 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/OneViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OneViewController.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LZBBaseViewController.h" 11 | 12 | @interface OneViewController : LZBBaseViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/OneViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OneViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "OneViewController.h" 10 | #import "TwoViewController.h" 11 | #import "LZBPushPopTransition.h" 12 | 13 | @interface OneViewController () 14 | 15 | @property (nonatomic, strong) UIButton *oneButton; 16 | 17 | @property (nonatomic, strong) LZBPushPopTransition *pushPopTransition; 18 | 19 | @property (nonatomic, strong) UILabel *contentLab; 20 | 21 | @end 22 | 23 | @implementation OneViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | self.contentLab = [UILabel new]; 28 | [self.view addSubview:self.contentLab]; 29 | self.contentLab.text = @"为了区别系统的push和pop功能,所以我故意把动画时间设置为3.0s,您也可以自行设置时间"; 30 | self.contentLab.frame = CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, 200); 31 | self.contentLab.textAlignment = NSTextAlignmentCenter; 32 | self.contentLab.numberOfLines = 0; 33 | self.contentLab.textColor = [UIColor redColor]; 34 | 35 | 36 | self.oneButton = [UIButton buttonWithType:UIButtonTypeCustom]; 37 | [self.view addSubview:self.oneButton]; 38 | self.oneButton.center =self.view.center; 39 | self.oneButton.bounds = CGRectMake(0, 0, 100, 40); 40 | self.oneButton.backgroundColor = [UIColor grayColor]; 41 | [self.oneButton setTitle:@"点击动画" forState:UIControlStateNormal]; 42 | self.view.backgroundColor = [UIColor yellowColor]; 43 | [self.oneButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; 44 | [self.oneButton addTarget:self action:@selector(onnButtonClick) forControlEvents:UIControlEventTouchUpInside]; 45 | } 46 | 47 | - (void)onnButtonClick 48 | { 49 | TwoViewController *two = [[TwoViewController alloc]init]; 50 | 51 | self.pushPopTransition = [[LZBPushPopTransition alloc]initWithPush:^(UIViewController *fromVC, UIViewController *toVC, LZBBaseTransition *transition) { 52 | 53 | 54 | } Pop:^(UIViewController *fromVC, UIViewController *toVC, LZBBaseTransition *transition) { 55 | 56 | }]; 57 | 58 | self.navigationController.delegate = self.pushPopTransition; 59 | [self.navigationController pushViewController:two animated:YES]; 60 | NSLog(@"---OneViewController:%@",self.navigationController.delegate); 61 | } 62 | 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/TwoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TwoViewController.h 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TwoViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/PushWithPop/TwoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TwoViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/14. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "TwoViewController.h" 10 | #import "LZBPushPopTransition.h" 11 | 12 | @interface TwoViewController () 13 | 14 | @property (nonatomic, strong) UILabel *centerLab; 15 | @end 16 | 17 | @implementation TwoViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.title = @"第二个控制器"; 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | self.centerLab = [UILabel new]; 24 | [self.view addSubview:self.centerLab]; 25 | self.centerLab.center = self.view.center; 26 | self.centerLab.bounds = CGRectMake(0, 0, 200, 40); 27 | self.centerLab.text = @"第二个控制器"; 28 | self.centerLab.textColor = [UIColor blueColor]; 29 | self.centerLab.textAlignment = NSTextAlignmentCenter; 30 | } 31 | 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/LZBQQPhoneTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBQQPhoneTransition.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseTransition.h" 10 | 11 | @interface LZBQQPhoneTransition : LZBBaseTransition 12 | 13 | /** 14 | * 设置点击动画的View 15 | */ 16 | @property (nonatomic, strong) UIView *targetView; 17 | 18 | /** 19 | * 设置targetView动画放大的比例,default scale = 3.0 20 | */ 21 | @property (nonatomic, assign) CGFloat scale; 22 | @end 23 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/LZBQQPhoneTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBQQPhoneTransition.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBQQPhoneTransition.h" 10 | 11 | @interface LZBQQPhoneTransition () 12 | 13 | /** 14 | * 保存全局的转场的上下文 15 | */ 16 | @property (nonatomic, strong) idtransitionContext; 17 | 18 | @end 19 | 20 | @implementation LZBQQPhoneTransition 21 | 22 | -(instancetype)initWithPresent:(LZBBaseTransitionPresent)presentCallBack Dismiss:(LZBBaseTransitionDismiss)dismissCallBack 23 | { 24 | if(self = [super initWithPresent:presentCallBack Dismiss:dismissCallBack]) 25 | { 26 | self.scale = 3.0; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)animateTransition:(id)transitionContext 32 | { 33 | UIView *containerView = [transitionContext containerView]; 34 | if(containerView == nil) return; 35 | self.transitionContext = transitionContext; 36 | 37 | if(self.transitionType == kLZBBaseTransitionStyle_Present) 38 | { 39 | [self animationPresentTrasition:transitionContext WithContainerView:containerView]; 40 | } 41 | else 42 | { 43 | [self animationDismissTrasition:transitionContext WithContainerView:containerView]; 44 | } 45 | } 46 | 47 | //监听动画结束 48 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag 49 | { 50 | if(self.transitionType == kLZBBaseTransitionStyle_Present) 51 | { 52 | //有两段动画,监听到第一段动画路径 + 放大的动画结束 53 | [self animationPresentTrasitionDidStop:anim finished:flag]; 54 | } 55 | else 56 | { //有两段动画,监听到第一缩小到圆 + 回到放大的动画结束 57 | [self animationDismissTrasitionDidStop:anim finished:flag]; 58 | } 59 | } 60 | 61 | #pragma mark - present动画 62 | - (void)animationPresentTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 63 | { 64 | UIView *toView = [self toView:transitionContext]; 65 | toView.alpha = 0.0; 66 | [containerView addSubview:toView]; 67 | 68 | //画移动曲线 69 | CGPoint startPoint = self.targetView.center; 70 | CGPoint endPoint = toView.center; 71 | CGPoint controlPoint = CGPointMake(self.targetView.center.x, [UIScreen mainScreen].bounds.size.height * 0.5); 72 | UIBezierPath *animationPath = [[UIBezierPath alloc]init]; 73 | [animationPath moveToPoint:startPoint]; 74 | [animationPath addQuadCurveToPoint:endPoint controlPoint:controlPoint]; 75 | 76 | 77 | //增加动画 78 | CAAnimationGroup *group = [self groupAnimationWithBezierPath:animationPath durationTime:1.0 transform:CATransform3DMakeScale(self.scale, self.scale, 1)]; 79 | group.removedOnCompletion = NO; 80 | group.fillMode = kCAFillModeForwards; 81 | //用于后面找到这组动画 82 | [group setValue:@"onePresentGroup" forKey:@"groupAnimation"]; 83 | [self.targetView.layer addAnimation:group forKey:@"keyAniamition"]; 84 | 85 | 86 | } 87 | /** 88 | * 监听present第一组动画 89 | */ 90 | - (void)animationPresentTrasitionDidStop:(CAAnimation *)anim finished:(BOOL)flag 91 | { 92 | UIViewController *toVC = [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 93 | 94 | if([[anim valueForKey:@"groupAnimation"] isEqualToString:@"onePresentGroup"]) 95 | { 96 | [self.targetView.layer removeAllAnimations]; 97 | 98 | UIView *containerView = [self.transitionContext containerView]; 99 | 100 | //用曲线画两个圆 -开始圆 + 结束圆 101 | //求出半径 102 | CGFloat radius = sqrtf(containerView.frame.size.height *containerView.frame.size.height + containerView.frame.size.width *containerView.frame.size.width)*0.5; 103 | //根据半径画 - 结束圆 104 | UIBezierPath *endCircle = [UIBezierPath bezierPathWithArcCenter:containerView.center radius:radius startAngle:0 endAngle:2*M_PI clockwise:YES]; 105 | 106 | //QQPhone动画开始圆 107 | UIBezierPath *startCicle = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(([UIScreen mainScreen].bounds.size.width - self.targetView.frame.size.width * self.scale)*0.5, ([UIScreen mainScreen].bounds.size.height - self.targetView.frame.size.height * self.scale)*0.5 , self.targetView.frame.size.width*self.scale, self.targetView.frame.size.height*self.scale)]; 108 | 109 | 110 | //创建动画的形状层 111 | CAShapeLayer *maskLayer = [CAShapeLayer layer]; 112 | maskLayer.path = endCircle.CGPath; 113 | toVC.view.layer.mask = maskLayer; 114 | 115 | 116 | //创建过度路径动画 117 | CABasicAnimation *laryerAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 118 | laryerAnimation.fromValue =(__bridge id )startCicle.CGPath; 119 | laryerAnimation.toValue =(__bridge id )endCircle.CGPath; 120 | laryerAnimation.duration = 1.0; 121 | laryerAnimation.delegate = self; 122 | [maskLayer addAnimation:laryerAnimation forKey:@"path"]; 123 | self.targetView.hidden = YES; 124 | toVC.view.alpha = 1.0; 125 | } 126 | else 127 | { 128 | // present第二次动画来到这里 代理回调再次执行到这里结束动画 129 | [self.transitionContext completeTransition:![self.transitionContext transitionWasCancelled]]; 130 | toVC.view.layer.mask = nil; 131 | 132 | 133 | } 134 | } 135 | 136 | #pragma mark - dismiss动画 137 | - (void)animationDismissTrasition:(id)transitionContext WithContainerView:(UIView *)containerView 138 | { 139 | 140 | //先画两个动画圆 141 | //求出半径 142 | CGFloat radius = sqrtf(containerView.frame.size.height *containerView.frame.size.height + containerView.frame.size.width *containerView.frame.size.width)*0.5; 143 | //根据半径画 - 开始圆 144 | UIBezierPath *startCicle = [UIBezierPath bezierPathWithArcCenter:containerView.center radius:radius startAngle:0 endAngle:2*M_PI clockwise:YES]; 145 | 146 | //QQPhone动画-结束圆 147 | UIBezierPath *endCircle = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(([UIScreen mainScreen].bounds.size.width - self.targetView.frame.size.width * self.scale)*0.5, ([UIScreen mainScreen].bounds.size.height - self.targetView.frame.size.height * self.scale)*0.5 , self.targetView.frame.size.width*self.scale, self.targetView.frame.size.height*self.scale)]; 148 | 149 | UIView *fromView = [self fromView:transitionContext]; 150 | 151 | 152 | //创建变化的形状层 153 | CAShapeLayer *shapeMaskLayer = [CAShapeLayer layer]; 154 | shapeMaskLayer.path = endCircle.CGPath; 155 | fromView.layer.mask = shapeMaskLayer; 156 | 157 | //创建路径动画 158 | CABasicAnimation *keyPathAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 159 | keyPathAnimation.fromValue = (__bridge id) startCicle.CGPath; 160 | keyPathAnimation.toValue = (__bridge id ) endCircle.CGPath; 161 | keyPathAnimation.duration = 1.0; 162 | keyPathAnimation.delegate =self; 163 | 164 | [keyPathAnimation setValue:@"dismissOneAnimation" forKey:@"animation"]; 165 | [shapeMaskLayer addAnimation:keyPathAnimation forKey:@"pathAnimation"]; 166 | 167 | 168 | } 169 | - (void)animationDismissTrasitionDidStop:(CAAnimation *)anim finished:(BOOL)flag 170 | { 171 | if([[anim valueForKey:@"animation"] isEqualToString:@"dismissOneAnimation"]) 172 | { 173 | UIView *fromView = [self fromView:self.transitionContext]; 174 | [fromView.layer.mask removeAllAnimations]; 175 | fromView.layer.mask = nil; 176 | [fromView removeFromSuperview]; 177 | //取消fromView的形状层动画 178 | [self.transitionContext completeTransition:![self.transitionContext transitionWasCancelled]]; 179 | 180 | 181 | //增加动画路径 182 | CGPoint startPoint = CGPointMake([UIScreen mainScreen].bounds.size.width * 0.5, [UIScreen mainScreen].bounds.size.height * 0.5); 183 | CGPoint endPoint = self.targetView.center; 184 | CGPoint controlPoint = CGPointMake(self.targetView.center.x, [UIScreen mainScreen].bounds.size.height * 0.5); 185 | UIBezierPath *animationPath = [[UIBezierPath alloc]init]; 186 | [animationPath moveToPoint:startPoint]; 187 | [animationPath addQuadCurveToPoint:endPoint controlPoint:controlPoint]; 188 | 189 | self.targetView.layer.transform = CATransform3DMakeScale(self.scale, self.scale, 1); 190 | CAAnimationGroup *group = [self groupAnimationWithBezierPath:animationPath durationTime:1.0 transform:CATransform3DMakeScale(1.0, 1.0, 1)]; 191 | group.removedOnCompletion = NO; 192 | group.fillMode = kCAFillModeRemoved; 193 | //用于后面找到这组动画 194 | [group setValue:@"twoDismissGroup" forKey:@"groupAnimation"]; 195 | [self.targetView.layer addAnimation:group forKey:@"keyAniamition"]; 196 | self.targetView.hidden = NO; 197 | 198 | } 199 | else 200 | { 201 | [self.targetView.layer removeAllAnimations]; 202 | self.targetView.layer.transform = CATransform3DMakeScale(1.0, 1.0, 1); 203 | self.transitionContext = nil; //必须把上下文=nil,不让控制器不会销毁 204 | 205 | } 206 | 207 | } 208 | 209 | 210 | 211 | 212 | #pragma mark - 动画组 213 | - (CAAnimationGroup *)groupAnimationWithBezierPath:(UIBezierPath *)bezierPath durationTime:(NSTimeInterval)duration transform:(CATransform3D)transform3D 214 | { 215 | //路径动画 216 | CAKeyframeAnimation *keyAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 217 | keyAnimation.path = bezierPath.CGPath; 218 | 219 | //尺寸变化 220 | CABasicAnimation *baseAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 221 | baseAnimation.toValue = [NSValue valueWithCATransform3D:transform3D]; 222 | 223 | //动画组 224 | CAAnimationGroup *group = [CAAnimationGroup animation]; 225 | group.animations = @[keyAnimation,baseAnimation]; 226 | group.duration = duration; 227 | group.delegate = self; 228 | 229 | return group; 230 | } 231 | 232 | @end 233 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/oneQQPhoneViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // oneQQPhoneViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface oneQQPhoneViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/oneQQPhoneViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // oneQQPhoneViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "oneQQPhoneViewController.h" 10 | #import "LZBQQPhoneTransition.h" 11 | #import "twoQQPhoneViewController.h" 12 | 13 | @interface oneQQPhoneViewController() 14 | 15 | @property (nonatomic, strong) LZBQQPhoneTransition *QQPhoneTransition; 16 | 17 | @property (nonatomic, strong) UIButton *presentButton; 18 | 19 | @property (nonatomic, strong) UIImageView *imageView; 20 | @end 21 | 22 | @implementation oneQQPhoneViewController 23 | 24 | - (void)viewDidLoad 25 | { 26 | [super viewDidLoad]; 27 | [self setupAddBackImageView]; 28 | [self setupAddpresentButton]; 29 | } 30 | 31 | - (void)setupAddBackImageView 32 | { 33 | self.imageView = [UIImageView new]; 34 | [self.view addSubview:self.imageView]; 35 | self.imageView.image = [UIImage imageNamed:@"QQ_main"]; 36 | self.imageView.frame =CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 64); 37 | self.imageView.userInteractionEnabled = YES; 38 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 39 | } 40 | 41 | - (void)setupAddpresentButton 42 | { 43 | self.presentButton = [UIButton buttonWithType:UIButtonTypeCustom]; 44 | [self.view addSubview:self.presentButton]; 45 | self.presentButton.center = CGPointMake(self.view.frame.size.width - 50, self.view.frame.size.height - 50); 46 | self.presentButton.bounds = CGRectMake(0, 0, 50, 50); 47 | self.presentButton.layer.cornerRadius = 25; 48 | self.presentButton.layer.masksToBounds = YES; 49 | [self.presentButton setImage:[UIImage imageNamed:@"QQPhone"] forState:UIControlStateNormal]; 50 | self.view.backgroundColor = [UIColor blueColor]; 51 | [self.presentButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 52 | [self.presentButton addTarget:self action:@selector(presentButtonClick) forControlEvents:UIControlEventTouchUpInside]; 53 | 54 | } 55 | - (void)presentButtonClick 56 | { 57 | twoQQPhoneViewController *twoVC = [[twoQQPhoneViewController alloc]init]; 58 | twoVC.modalPresentationStyle = UIModalPresentationCustom; 59 | __weak typeof(self) weakSelf = self; 60 | self.QQPhoneTransition = [[LZBQQPhoneTransition alloc]initWithPresent:^(UIViewController *presented, UIViewController *presenting, UIViewController *sourceVC, LZBBaseTransition *transition) { 61 | LZBQQPhoneTransition *modalQQ = (LZBQQPhoneTransition*)transition; 62 | modalQQ.targetView = weakSelf.presentButton; 63 | 64 | } Dismiss:^(UIViewController *dismissVC, LZBBaseTransition *transition) { 65 | 66 | }]; 67 | 68 | twoVC.transitioningDelegate = self.QQPhoneTransition; 69 | [self presentViewController:twoVC animated:YES completion:nil]; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/twoQQPhoneViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // twoQQPhoneViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "LZBBaseViewController.h" 10 | 11 | @interface twoQQPhoneViewController : LZBBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/QQPhone/twoQQPhoneViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // twoQQPhoneViewController.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "twoQQPhoneViewController.h" 10 | 11 | @interface twoQQPhoneViewController () 12 | 13 | @property (nonatomic, strong) UIImageView *imageView; 14 | 15 | @end 16 | 17 | @implementation twoQQPhoneViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | [self setupAddBackImageView]; 23 | } 24 | - (void)setupAddBackImageView 25 | { 26 | self.imageView = [UIImageView new]; 27 | [self.view addSubview:self.imageView]; 28 | self.imageView.image = [UIImage imageNamed:@"wechat_main"]; 29 | self.imageView.frame =CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height ); 30 | self.imageView.userInteractionEnabled = YES; 31 | self.imageView.contentMode = UIViewContentModeScaleAspectFill; 32 | [self.imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imageViewClick)]]; 33 | 34 | } 35 | - (void)imageViewClick 36 | { 37 | [self dismissViewControllerAnimated:YES completion:nil]; 38 | } 39 | 40 | - (void)dealloc 41 | { 42 | NSLog(@"销毁---twoQQPhoneViewController"); 43 | } 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/QQPhone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/QQPhone@2x.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/QQ_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/QQ_main.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/button.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/fengjin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/fengjin.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/meinv1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/meinv1.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/meinv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/meinv2.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/tupain1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/tupain1.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/tupain2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/tupain2.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/wechat_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBViewControllerTransitionAnimation/57a40ae753e11ae239048ef30e8442141af2dd55/LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/LZBCustomTransition/Resource/wechat_main.png -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // 转场动画 4 | // 5 | // Created by apple on 16/6/13. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "OnePresentViewController.h" 11 | #import "OneViewController.h" 12 | #import "oneCustomModalViewContoller.h" 13 | #import "oneQQPhoneViewController.h" 14 | #import "oneBubbleViewController.h" 15 | #import "onePageViewController.h" 16 | 17 | @interface ViewController (); 18 | 19 | @property (nonatomic, strong) UITableView *tableView; 20 | 21 | @property (nonatomic, strong) NSArray *animationTypeVC; 22 | 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | self.title = @"选择转场动画效果"; 30 | self.tableView.backgroundColor =[UIColor whiteColor]; 31 | self.animationTypeVC = @[[[OnePresentViewController alloc]initWithTitle:@"模仿系统modal模态转场动画"],[[OneViewController alloc] initWithTitle:@"模仿系统push导航转场动画"],[[oneCustomModalViewContoller alloc]initWithTitle:@"自定义modal"],[[oneQQPhoneViewController alloc]initWithTitle:@"高仿QQ电话启动"],[[oneBubbleViewController alloc]initWithTitle:@"气泡转场效果"],[[onePageViewController alloc]initWithTitle:@"翻页转场效果"]]; 32 | } 33 | 34 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 35 | { 36 | return self.animationTypeVC.count; 37 | } 38 | 39 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 40 | { 41 | static NSString *tableViewCellID = @"UITableViewCellID"; 42 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:tableViewCellID]; 43 | if(cell == nil) 44 | { 45 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:tableViewCellID]; 46 | } 47 | UIViewController *vc = self.animationTypeVC[indexPath.row]; 48 | cell.textLabel.text = vc.title; 49 | 50 | return cell; 51 | } 52 | 53 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 54 | { 55 | [self.navigationController pushViewController:self.animationTypeVC[indexPath.row] animated:YES]; 56 | } 57 | 58 | 59 | 60 | - (UITableView *)tableView 61 | { 62 | if(_tableView == nil) 63 | { 64 | _tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain]; 65 | [self.view addSubview:_tableView]; 66 | _tableView.delegate =self; 67 | _tableView.dataSource = self; 68 | } 69 | return _tableView; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /LZBViewControllerTransitionAnimation/LZBViewControllerTransitionAnimation/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LZBViewControllerTransitionAnimation 4 | // 5 | // Created by apple on 16/6/16. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LZBViewControllerTransitionAnimation(各种自定义转场动画组件) 2 | 模仿系统的push/pop动画和modal模态控制器动画,以及自定义各种转场动画 3 | 4 | #整体结构 5 | 封装一个基本转场动画的公共父LZBBaseTransition.h,用于实现一些基本共同的操作 6 | 以及封装block回调,子类继承LZBBaseTransition,重写- (void)animateTransition:(id)transitionContext实现动画效果 7 | 8 | LZBPageTransition.h 翻页效果 9 | 10 | LZBBubbleTransition.h 气泡效果 11 | 12 | LZBQQPhoneTransition.h 模拟QQ电话 13 | 14 | LZBCustomModalTransition.h 自定义模态动画 15 | 16 | LZBPresentDismissTransition.h 模拟系统的模态动画 17 | 18 | LZBPushPopTransition.h 模拟系统的导航切换动画 19 | 20 | #使用方法 21 | 需要使用什么动画可以直接导入头文件并创建转场动画 22 | 23 | 比如:要使用QQ电话的转场,使用步骤 24 | 25 | 1.#import "LZBQQPhoneTransition.h" 26 | 27 | 2.创建转场动画对象 28 | self.QQPhoneTransition = [[LZBQQPhoneTransition alloc]initWithPresent:^(UIViewController *presented, UIViewController *presenting, UIViewController *sourceVC, LZBBaseTransition *transition) { 29 | LZBQQPhoneTransition *modalQQ = (LZBQQPhoneTransition*)transition; 30 | modalQQ.targetView = weakSelf.presentButton; //设置点击View 31 | //可以设置参数,改变present动画 32 | } Dismiss:^(UIViewController *dismissVC, LZBBaseTransition *transition) { 33 | //可以设置dismiss动画 34 | }]; 35 | 36 | 3.设置需要modal控制的目的控制器的转场delegate 为 我们自定义的转场代理 37 | twoVC.transitioningDelegate = self.QQPhoneTransition; 38 | 39 | 4.开始动画 40 | [self presentViewController:twoVC animated:YES completion:nil]; 41 | 42 | 其他动画使用大体相同,如需详情可以直接下载代码查看 43 | 44 | #基本参数设置 45 | duration : 设置转场动画的时间,默认是0.5s 46 | 47 | transitionType : 设置转场样式 48 | typedef NS_ENUM(NSInteger,LZBBaseTransitionStyle){ 49 | kLZBBaseTransitionStyle_Present, //present 50 | kLZBBaseTransitionStyle_Dismiss, //dismiss 51 | kLZBBaseTransitionStyle_Push, //push 52 | kLZBBaseTransitionStyle_Pop, //pop 53 | 54 | }; 55 | 56 | bounceIsEnable:设置是否具有弹簧效果,默认是NO 57 | 58 | #基本方法 59 | /** 60 | * 实例化方法 push - pop 61 | * 62 | * @param pushCallBack push回调 63 | * @param popCallBack pop回调 64 | * 65 | * @return 66 | */ 67 | - (instancetype)initWithPush:(LZBBaseTransitionPush)pushCallBack 68 | Pop:(LZBBaseTransitionPop)popCallBack; 69 | 70 | /** 71 | * 实例化 present - dismiss Modal 72 | * 73 | * @param presentCallBack present回调 74 | * @param dismissCallBack dismiss回调 75 | * 76 | * @return 77 | */ 78 | - (instancetype)initWithPresent:(LZBBaseTransitionPresent) presentCallBack 79 | Dismiss:(LZBBaseTransitionDismiss) dismissCallBack; 80 | 81 | /** 82 | * 获得源View - fromView 83 | */ 84 | - (UIView *)fromView:(id )transitionContext; 85 | 86 | /** 87 | * 获得目的View - toView 88 | */ 89 | - (UIView *)toView:(id )transitionContext; 90 | 91 | #备注 92 | 本demo适合本人的项目,如果您和我有同样的需求您可以下载代码,并随心更改。本demo也支持个人自定义转场动画,方法非常简单,可参照本demo实现 93 | 94 | --------------------------------------------------------------------------------