├── .gitignore ├── LICENSE ├── LJWKeyboardHandlerExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── LJWKeyboardHandlerExample.xccheckout │ └── xcuserdata │ │ └── ljw.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ljw.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── LJWKeyboardHandlerExample.xcscheme │ └── xcschememanagement.plist ├── LJWKeyboardHandlerExample ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── LJWKeyboardHandler │ ├── LJWKeyboardHandler.h │ ├── LJWKeyboardHandler.m │ ├── LJWKeyboardHandlerHeaders.h │ ├── LJWKeyboardToolBar.h │ ├── LJWKeyboardToolBar.m │ ├── Resources.bundle │ │ ├── LJWButtonBarArrowLeft@2x.png │ │ ├── LJWButtonBarArrowRight@2x.png │ │ ├── en.lproj │ │ │ └── LJWKeyBoardLocalization.strings │ │ └── zh-Hans.lproj │ │ │ └── LJWKeyBoardLocalization.strings │ ├── UIView+LJWKeyboardHandlerAddtion.h │ ├── UIView+LJWKeyboardHandlerAddtion.m │ ├── UIViewController+LJWKeyboardHandlerHelper.h │ ├── UIViewController+LJWKeyboardHandlerHelper.m │ ├── UIWindow+LJWPresentViewController.h │ └── UIWindow+LJWPresentViewController.m ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── Main.strings ├── main.m └── zh-Hans.lproj │ ├── LaunchScreen.strings │ └── Main.strings ├── LJWKeyboardHandlerExampleTests ├── Info.plist └── LJWKeyboardHandlerExampleTests.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /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 | 203 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 72D2B4261B0A408400AB51F1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D2B4251B0A408400AB51F1 /* main.m */; }; 11 | 72D2B4291B0A408400AB51F1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D2B4281B0A408400AB51F1 /* AppDelegate.m */; }; 12 | 72D2B42C1B0A408400AB51F1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D2B42B1B0A408400AB51F1 /* ViewController.m */; }; 13 | 72D2B42F1B0A408400AB51F1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 72D2B42D1B0A408400AB51F1 /* Main.storyboard */; }; 14 | 72D2B4311B0A408400AB51F1 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 72D2B4301B0A408400AB51F1 /* Images.xcassets */; }; 15 | 72D2B4341B0A408400AB51F1 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 72D2B4321B0A408400AB51F1 /* LaunchScreen.xib */; }; 16 | 72D2B4401B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D2B43F1B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.m */; }; 17 | 72FA20C01B3482BA0045049D /* LJWKeyboardHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 72FA20B51B3482BA0045049D /* LJWKeyboardHandler.m */; }; 18 | 72FA20C11B3482BA0045049D /* LJWKeyboardToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 72FA20B81B3482BA0045049D /* LJWKeyboardToolBar.m */; }; 19 | 72FA20C21B3482BA0045049D /* Resources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 72FA20B91B3482BA0045049D /* Resources.bundle */; }; 20 | 72FA20C31B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.m in Sources */ = {isa = PBXBuildFile; fileRef = 72FA20BB1B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.m */; }; 21 | 72FA20C41B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 72FA20BD1B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.m */; }; 22 | 72FA20C51B3482BA0045049D /* UIWindow+LJWPresentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72FA20BF1B3482BA0045049D /* UIWindow+LJWPresentViewController.m */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | 72D2B43A1B0A408400AB51F1 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = 72D2B4181B0A408400AB51F1 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = 72D2B41F1B0A408400AB51F1; 31 | remoteInfo = LJWKeyboardHandlerExample; 32 | }; 33 | /* End PBXContainerItemProxy section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 72D2B4201B0A408400AB51F1 /* LJWKeyboardHandlerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LJWKeyboardHandlerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 72D2B4241B0A408400AB51F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 72D2B4251B0A408400AB51F1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 72D2B4271B0A408400AB51F1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 72D2B4281B0A408400AB51F1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 72D2B42A1B0A408400AB51F1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 42 | 72D2B42B1B0A408400AB51F1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 43 | 72D2B42E1B0A408400AB51F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 72D2B4301B0A408400AB51F1 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 45 | 72D2B4331B0A408400AB51F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 46 | 72D2B4391B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LJWKeyboardHandlerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 72D2B43E1B0A408400AB51F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 72D2B43F1B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LJWKeyboardHandlerExampleTests.m; sourceTree = ""; }; 49 | 72FA20B41B3482BA0045049D /* LJWKeyboardHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJWKeyboardHandler.h; sourceTree = ""; }; 50 | 72FA20B51B3482BA0045049D /* LJWKeyboardHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJWKeyboardHandler.m; sourceTree = ""; }; 51 | 72FA20B61B3482BA0045049D /* LJWKeyboardHandlerHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJWKeyboardHandlerHeaders.h; sourceTree = ""; }; 52 | 72FA20B71B3482BA0045049D /* LJWKeyboardToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJWKeyboardToolBar.h; sourceTree = ""; }; 53 | 72FA20B81B3482BA0045049D /* LJWKeyboardToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJWKeyboardToolBar.m; sourceTree = ""; }; 54 | 72FA20B91B3482BA0045049D /* Resources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Resources.bundle; sourceTree = ""; }; 55 | 72FA20BA1B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+LJWKeyboardHandlerAddtion.h"; sourceTree = ""; }; 56 | 72FA20BB1B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+LJWKeyboardHandlerAddtion.m"; sourceTree = ""; }; 57 | 72FA20BC1B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+LJWKeyboardHandlerHelper.h"; sourceTree = ""; }; 58 | 72FA20BD1B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LJWKeyboardHandlerHelper.m"; sourceTree = ""; }; 59 | 72FA20BE1B3482BA0045049D /* UIWindow+LJWPresentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+LJWPresentViewController.h"; sourceTree = ""; }; 60 | 72FA20BF1B3482BA0045049D /* UIWindow+LJWPresentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+LJWPresentViewController.m"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 72D2B41D1B0A408400AB51F1 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 72D2B4361B0A408400AB51F1 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 72D2B4171B0A408400AB51F1 = { 82 | isa = PBXGroup; 83 | children = ( 84 | 72D2B4221B0A408400AB51F1 /* LJWKeyboardHandlerExample */, 85 | 72D2B43C1B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests */, 86 | 72D2B4211B0A408400AB51F1 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 72D2B4211B0A408400AB51F1 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 72D2B4201B0A408400AB51F1 /* LJWKeyboardHandlerExample.app */, 94 | 72D2B4391B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 72D2B4221B0A408400AB51F1 /* LJWKeyboardHandlerExample */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 72FA20B31B3482BA0045049D /* LJWKeyboardHandler */, 103 | 72D2B4271B0A408400AB51F1 /* AppDelegate.h */, 104 | 72D2B4281B0A408400AB51F1 /* AppDelegate.m */, 105 | 72D2B42A1B0A408400AB51F1 /* ViewController.h */, 106 | 72D2B42B1B0A408400AB51F1 /* ViewController.m */, 107 | 72D2B42D1B0A408400AB51F1 /* Main.storyboard */, 108 | 72D2B4301B0A408400AB51F1 /* Images.xcassets */, 109 | 72D2B4321B0A408400AB51F1 /* LaunchScreen.xib */, 110 | 72D2B4231B0A408400AB51F1 /* Supporting Files */, 111 | ); 112 | path = LJWKeyboardHandlerExample; 113 | sourceTree = ""; 114 | }; 115 | 72D2B4231B0A408400AB51F1 /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 72D2B4241B0A408400AB51F1 /* Info.plist */, 119 | 72D2B4251B0A408400AB51F1 /* main.m */, 120 | ); 121 | name = "Supporting Files"; 122 | sourceTree = ""; 123 | }; 124 | 72D2B43C1B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 72D2B43F1B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.m */, 128 | 72D2B43D1B0A408400AB51F1 /* Supporting Files */, 129 | ); 130 | path = LJWKeyboardHandlerExampleTests; 131 | sourceTree = ""; 132 | }; 133 | 72D2B43D1B0A408400AB51F1 /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 72D2B43E1B0A408400AB51F1 /* Info.plist */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 72FA20B31B3482BA0045049D /* LJWKeyboardHandler */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 72FA20B41B3482BA0045049D /* LJWKeyboardHandler.h */, 145 | 72FA20B51B3482BA0045049D /* LJWKeyboardHandler.m */, 146 | 72FA20B61B3482BA0045049D /* LJWKeyboardHandlerHeaders.h */, 147 | 72FA20B71B3482BA0045049D /* LJWKeyboardToolBar.h */, 148 | 72FA20B81B3482BA0045049D /* LJWKeyboardToolBar.m */, 149 | 72FA20B91B3482BA0045049D /* Resources.bundle */, 150 | 72FA20BA1B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.h */, 151 | 72FA20BB1B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.m */, 152 | 72FA20BC1B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.h */, 153 | 72FA20BD1B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.m */, 154 | 72FA20BE1B3482BA0045049D /* UIWindow+LJWPresentViewController.h */, 155 | 72FA20BF1B3482BA0045049D /* UIWindow+LJWPresentViewController.m */, 156 | ); 157 | path = LJWKeyboardHandler; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | 72D2B41F1B0A408400AB51F1 /* LJWKeyboardHandlerExample */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 72D2B4431B0A408400AB51F1 /* Build configuration list for PBXNativeTarget "LJWKeyboardHandlerExample" */; 166 | buildPhases = ( 167 | 72D2B41C1B0A408400AB51F1 /* Sources */, 168 | 72D2B41D1B0A408400AB51F1 /* Frameworks */, 169 | 72D2B41E1B0A408400AB51F1 /* Resources */, 170 | ); 171 | buildRules = ( 172 | ); 173 | dependencies = ( 174 | ); 175 | name = LJWKeyboardHandlerExample; 176 | productName = LJWKeyboardHandlerExample; 177 | productReference = 72D2B4201B0A408400AB51F1 /* LJWKeyboardHandlerExample.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | 72D2B4381B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 72D2B4461B0A408400AB51F1 /* Build configuration list for PBXNativeTarget "LJWKeyboardHandlerExampleTests" */; 183 | buildPhases = ( 184 | 72D2B4351B0A408400AB51F1 /* Sources */, 185 | 72D2B4361B0A408400AB51F1 /* Frameworks */, 186 | 72D2B4371B0A408400AB51F1 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | 72D2B43B1B0A408400AB51F1 /* PBXTargetDependency */, 192 | ); 193 | name = LJWKeyboardHandlerExampleTests; 194 | productName = LJWKeyboardHandlerExampleTests; 195 | productReference = 72D2B4391B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | 72D2B4181B0A408400AB51F1 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 0620; 205 | ORGANIZATIONNAME = ljw; 206 | TargetAttributes = { 207 | 72D2B41F1B0A408400AB51F1 = { 208 | CreatedOnToolsVersion = 6.2; 209 | }; 210 | 72D2B4381B0A408400AB51F1 = { 211 | CreatedOnToolsVersion = 6.2; 212 | TestTargetID = 72D2B41F1B0A408400AB51F1; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 72D2B41B1B0A408400AB51F1 /* Build configuration list for PBXProject "LJWKeyboardHandlerExample" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | "zh-Hans", 224 | ); 225 | mainGroup = 72D2B4171B0A408400AB51F1; 226 | productRefGroup = 72D2B4211B0A408400AB51F1 /* Products */; 227 | projectDirPath = ""; 228 | projectRoot = ""; 229 | targets = ( 230 | 72D2B41F1B0A408400AB51F1 /* LJWKeyboardHandlerExample */, 231 | 72D2B4381B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 72D2B41E1B0A408400AB51F1 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 72D2B42F1B0A408400AB51F1 /* Main.storyboard in Resources */, 242 | 72D2B4341B0A408400AB51F1 /* LaunchScreen.xib in Resources */, 243 | 72D2B4311B0A408400AB51F1 /* Images.xcassets in Resources */, 244 | 72FA20C21B3482BA0045049D /* Resources.bundle in Resources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 72D2B4371B0A408400AB51F1 /* Resources */ = { 249 | isa = PBXResourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXResourcesBuildPhase section */ 256 | 257 | /* Begin PBXSourcesBuildPhase section */ 258 | 72D2B41C1B0A408400AB51F1 /* Sources */ = { 259 | isa = PBXSourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 72FA20C31B3482BA0045049D /* UIView+LJWKeyboardHandlerAddtion.m in Sources */, 263 | 72D2B42C1B0A408400AB51F1 /* ViewController.m in Sources */, 264 | 72FA20C41B3482BA0045049D /* UIViewController+LJWKeyboardHandlerHelper.m in Sources */, 265 | 72D2B4291B0A408400AB51F1 /* AppDelegate.m in Sources */, 266 | 72FA20C51B3482BA0045049D /* UIWindow+LJWPresentViewController.m in Sources */, 267 | 72D2B4261B0A408400AB51F1 /* main.m in Sources */, 268 | 72FA20C01B3482BA0045049D /* LJWKeyboardHandler.m in Sources */, 269 | 72FA20C11B3482BA0045049D /* LJWKeyboardToolBar.m in Sources */, 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | 72D2B4351B0A408400AB51F1 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 72D2B4401B0A408400AB51F1 /* LJWKeyboardHandlerExampleTests.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXTargetDependency section */ 284 | 72D2B43B1B0A408400AB51F1 /* PBXTargetDependency */ = { 285 | isa = PBXTargetDependency; 286 | target = 72D2B41F1B0A408400AB51F1 /* LJWKeyboardHandlerExample */; 287 | targetProxy = 72D2B43A1B0A408400AB51F1 /* PBXContainerItemProxy */; 288 | }; 289 | /* End PBXTargetDependency section */ 290 | 291 | /* Begin PBXVariantGroup section */ 292 | 72D2B42D1B0A408400AB51F1 /* Main.storyboard */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 72D2B42E1B0A408400AB51F1 /* Base */, 296 | ); 297 | name = Main.storyboard; 298 | sourceTree = ""; 299 | }; 300 | 72D2B4321B0A408400AB51F1 /* LaunchScreen.xib */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 72D2B4331B0A408400AB51F1 /* Base */, 304 | ); 305 | name = LaunchScreen.xib; 306 | sourceTree = ""; 307 | }; 308 | /* End PBXVariantGroup section */ 309 | 310 | /* Begin XCBuildConfiguration section */ 311 | 72D2B4411B0A408400AB51F1 /* Debug */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_CONSTANT_CONVERSION = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 329 | COPY_PHASE_STRIP = NO; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_DYNAMIC_NO_PIC = NO; 333 | GCC_OPTIMIZATION_LEVEL = 0; 334 | GCC_PREPROCESSOR_DEFINITIONS = ( 335 | "DEBUG=1", 336 | "$(inherited)", 337 | ); 338 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 346 | MTL_ENABLE_DEBUG_INFO = YES; 347 | ONLY_ACTIVE_ARCH = YES; 348 | SDKROOT = iphoneos; 349 | }; 350 | name = Debug; 351 | }; 352 | 72D2B4421B0A408400AB51F1 /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 357 | CLANG_CXX_LIBRARY = "libc++"; 358 | CLANG_ENABLE_MODULES = YES; 359 | CLANG_ENABLE_OBJC_ARC = YES; 360 | CLANG_WARN_BOOL_CONVERSION = YES; 361 | CLANG_WARN_CONSTANT_CONVERSION = YES; 362 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 363 | CLANG_WARN_EMPTY_BODY = YES; 364 | CLANG_WARN_ENUM_CONVERSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN_UNREACHABLE_CODE = YES; 368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 369 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 370 | COPY_PHASE_STRIP = NO; 371 | ENABLE_NS_ASSERTIONS = NO; 372 | ENABLE_STRICT_OBJC_MSGSEND = YES; 373 | GCC_C_LANGUAGE_STANDARD = gnu99; 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 381 | MTL_ENABLE_DEBUG_INFO = NO; 382 | SDKROOT = iphoneos; 383 | VALIDATE_PRODUCT = YES; 384 | }; 385 | name = Release; 386 | }; 387 | 72D2B4441B0A408400AB51F1 /* Debug */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 391 | INFOPLIST_FILE = LJWKeyboardHandlerExample/Info.plist; 392 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | }; 396 | name = Debug; 397 | }; 398 | 72D2B4451B0A408400AB51F1 /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 402 | INFOPLIST_FILE = LJWKeyboardHandlerExample/Info.plist; 403 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | }; 407 | name = Release; 408 | }; 409 | 72D2B4471B0A408400AB51F1 /* Debug */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | FRAMEWORK_SEARCH_PATHS = ( 414 | "$(SDKROOT)/Developer/Library/Frameworks", 415 | "$(inherited)", 416 | ); 417 | GCC_PREPROCESSOR_DEFINITIONS = ( 418 | "DEBUG=1", 419 | "$(inherited)", 420 | ); 421 | INFOPLIST_FILE = LJWKeyboardHandlerExampleTests/Info.plist; 422 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 423 | PRODUCT_NAME = "$(TARGET_NAME)"; 424 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LJWKeyboardHandlerExample.app/LJWKeyboardHandlerExample"; 425 | }; 426 | name = Debug; 427 | }; 428 | 72D2B4481B0A408400AB51F1 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | BUNDLE_LOADER = "$(TEST_HOST)"; 432 | FRAMEWORK_SEARCH_PATHS = ( 433 | "$(SDKROOT)/Developer/Library/Frameworks", 434 | "$(inherited)", 435 | ); 436 | INFOPLIST_FILE = LJWKeyboardHandlerExampleTests/Info.plist; 437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LJWKeyboardHandlerExample.app/LJWKeyboardHandlerExample"; 440 | }; 441 | name = Release; 442 | }; 443 | /* End XCBuildConfiguration section */ 444 | 445 | /* Begin XCConfigurationList section */ 446 | 72D2B41B1B0A408400AB51F1 /* Build configuration list for PBXProject "LJWKeyboardHandlerExample" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 72D2B4411B0A408400AB51F1 /* Debug */, 450 | 72D2B4421B0A408400AB51F1 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | 72D2B4431B0A408400AB51F1 /* Build configuration list for PBXNativeTarget "LJWKeyboardHandlerExample" */ = { 456 | isa = XCConfigurationList; 457 | buildConfigurations = ( 458 | 72D2B4441B0A408400AB51F1 /* Debug */, 459 | 72D2B4451B0A408400AB51F1 /* Release */, 460 | ); 461 | defaultConfigurationIsVisible = 0; 462 | defaultConfigurationName = Release; 463 | }; 464 | 72D2B4461B0A408400AB51F1 /* Build configuration list for PBXNativeTarget "LJWKeyboardHandlerExampleTests" */ = { 465 | isa = XCConfigurationList; 466 | buildConfigurations = ( 467 | 72D2B4471B0A408400AB51F1 /* Debug */, 468 | 72D2B4481B0A408400AB51F1 /* Release */, 469 | ); 470 | defaultConfigurationIsVisible = 0; 471 | defaultConfigurationName = Release; 472 | }; 473 | /* End XCConfigurationList section */ 474 | }; 475 | rootObject = 72D2B4181B0A408400AB51F1 /* Project object */; 476 | } 477 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/project.xcworkspace/xcshareddata/LJWKeyboardHandlerExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 49E320F1-6540-475B-84CC-823908DE47BE 9 | IDESourceControlProjectName 10 | LJWKeyboardHandlerExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 0D59F98F6947C091DA445311DEAE844C79C8B0DA 14 | https://github.com/chinaljw/LJWKeyboardHandler.git 15 | 16 | IDESourceControlProjectPath 17 | LJWKeyboardHandlerExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 0D59F98F6947C091DA445311DEAE844C79C8B0DA 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/chinaljw/LJWKeyboardHandler.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 0D59F98F6947C091DA445311DEAE844C79C8B0DA 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 0D59F98F6947C091DA445311DEAE844C79C8B0DA 36 | IDESourceControlWCCName 37 | LJWKeyboardHandlerExample 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/project.xcworkspace/xcuserdata/ljw.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinaljw/LJWKeyboardHandler/eeea5e56808702399e499f1f02fd2f99657bafff/LJWKeyboardHandlerExample.xcodeproj/project.xcworkspace/xcuserdata/ljw.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/xcuserdata/ljw.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/xcuserdata/ljw.xcuserdatad/xcschemes/LJWKeyboardHandlerExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 90 | 91 | 92 | 98 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample.xcodeproj/xcuserdata/ljw.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LJWKeyboardHandlerExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 72D2B41F1B0A408400AB51F1 16 | 17 | primary 18 | 19 | 20 | 72D2B4381B0A408400AB51F1 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. 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 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. 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 | 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // 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. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | // 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. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | // 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. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/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 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | zh_CN 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.ljw.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/LJWKeyboardHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardHandler.h 3 | // Parking 4 | // 5 | // Created by ljw on 15/5/17. 6 | // Copyright (c) 2015年 Mark. All rights reserved. 7 | // 8 | 9 | /* 10 | * 由于有问题还没解决,目前只支持自动调整vc.view。 11 | * 12 | * 强烈不建议直接使用此类,如果掉坑里了就自己爬出来吧~~~ 13 | * 14 | * 如需直接使用,请在vc里保留,并在viewDidAppear里使用法调用startHandling,在viewWillDisappear里调用stopHandling; 15 | */ 16 | 17 | #import 18 | #import 19 | 20 | @interface LJWKeyboardHandler : NSObject 21 | 22 | /** 23 | * 辅助的高度 24 | */ 25 | @property (nonatomic, assign) CGFloat assistantHeight; 26 | 27 | /** 28 | * 是否显示keyboardToolBar(默认显示) 29 | */ 30 | @property (nonatomic, assign) BOOL shouldShowKeyboardToolBar; 31 | 32 | /** 33 | * 开始处理 34 | */ 35 | - (void)startHandling; 36 | 37 | /** 38 | * 结束处理 39 | */ 40 | - (void)stopHandling; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/LJWKeyboardHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardHandler.m 3 | // Parking 4 | // 5 | // Created by ljw on 15/5/17. 6 | // Copyright (c) 2015年 Mark. All rights reserved. 7 | // 8 | 9 | #import "LJWKeyboardHandler.h" 10 | #import "UIWindow+LJWPresentViewController.h" 11 | #import "LJWKeyboardToolBar.h" 12 | #import "UIView+LJWKeyboardHandlerAddtion.h" 13 | 14 | Class _UIAlertControllerTextField; 15 | 16 | @interface LJWKeyboardHandler () 17 | 18 | /** 19 | * 键盘是否出现 20 | */ 21 | @property (nonatomic, assign) BOOL isKeyboardShowing; 22 | 23 | /** 24 | * 是否是原始位置 25 | */ 26 | @property (nonatomic, assign) BOOL isOrigin; 27 | 28 | /** 29 | * 键盘的frame 30 | */ 31 | @property (nonatomic, assign) CGRect keyboardFrame; 32 | 33 | /** 34 | * 第一响应者 35 | */ 36 | @property (nonatomic, strong) UIView *firstResponder; 37 | 38 | /** 39 | * 需要被调整的视图 40 | * 目前只支持vc.view,所以没有开放设置。 41 | */ 42 | @property (nonatomic, strong) UIView *viewNeedsToBeReset; 43 | 44 | /** 45 | * 键盘的accessoryView 46 | */ 47 | @property (nonatomic, strong) LJWKeyboardToolBar *ljwKeyboardToolBar; 48 | 49 | @end 50 | 51 | @implementation LJWKeyboardHandler 52 | 53 | + (void)initialize 54 | { 55 | _UIAlertControllerTextField = NSClassFromString(@"_UIAlertControllerTextField"); 56 | } 57 | 58 | - (instancetype)init 59 | { 60 | self = [super init]; 61 | if (self) { 62 | 63 | [self startHandling]; 64 | self.assistantHeight = 10.f; 65 | self.shouldShowKeyboardToolBar = YES; 66 | } 67 | return self; 68 | } 69 | 70 | - (UIToolbar *)ljwKeyboardToolBar 71 | { 72 | if (!_ljwKeyboardToolBar) { 73 | _ljwKeyboardToolBar = [[LJWKeyboardToolBar alloc] initWithFrame:CGRectMake(0, 0, [UIApplication sharedApplication].keyWindow.frame.size.width, 44)]; 74 | _ljwKeyboardToolBar.ljwKeyboardDelegate = self; 75 | 76 | //添加当前view里所有会弹键盘的responder 77 | // _ljwKeyboardToolBar.responders = [[UIApplication sharedApplication].keyWindow.presentViewController.view findOutAllSubViewsCanBecomeFirstResponder]; 78 | 79 | } 80 | 81 | return _ljwKeyboardToolBar; 82 | } 83 | 84 | - (void)setFirstResponder:(UIView *)firstResponder 85 | { 86 | 87 | if (_firstResponder == firstResponder || [firstResponder isKindOfClass:[UIWindow class]]) { 88 | return; 89 | } 90 | 91 | _firstResponder = firstResponder; 92 | 93 | if (!_firstResponder.shouldBeFoundOut) { 94 | return; 95 | } 96 | 97 | if (self.shouldShowKeyboardToolBar) { 98 | 99 | if (!_firstResponder.inputAccessoryView) { 100 | 101 | if ([_firstResponder respondsToSelector:@selector(setInputAccessoryView:)]) { 102 | [_firstResponder performSelector:@selector(setInputAccessoryView:) withObject:self.ljwKeyboardToolBar]; 103 | } 104 | 105 | } 106 | 107 | self.ljwKeyboardToolBar.currentResponder = firstResponder; 108 | 109 | } 110 | else 111 | { 112 | if ([_firstResponder respondsToSelector:@selector(setInputAccessoryView:)]) { 113 | [_firstResponder performSelector:@selector(setInputAccessoryView:) withObject:nil]; 114 | } 115 | } 116 | 117 | 118 | } 119 | 120 | - (UIView *)viewNeedsToBeReset 121 | { 122 | if (!_viewNeedsToBeReset) { 123 | _viewNeedsToBeReset = [UIApplication sharedApplication].keyWindow.presentViewController.view; 124 | } 125 | return _viewNeedsToBeReset; 126 | } 127 | 128 | 129 | - (void)startHandling 130 | { 131 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willKeyboardShow:) name:UIKeyboardWillShowNotification object:nil]; 132 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willKeyboardHide:) name:UIKeyboardWillHideNotification object:nil]; 133 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didFirstResponderChanged:) name:kLJWFirstResponderChanged object:nil]; 134 | } 135 | 136 | - (void)stopHandling 137 | { 138 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 139 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; 140 | [[NSNotificationCenter defaultCenter] removeObserver:self name:kLJWFirstResponderChanged object:nil]; 141 | } 142 | 143 | - (void)willKeyboardShow:(NSNotification *)notification 144 | { 145 | 146 | if (!self.firstResponder.shouldBeFoundOut) { 147 | return; 148 | } 149 | 150 | self.isKeyboardShowing = YES; 151 | 152 | self.keyboardFrame = [notification.userInfo[@"UIKeyboardFrameEndUserInfoKey"] CGRectValue]; 153 | 154 | [self resetTheViewNeedsToBeResetAppropraitly]; 155 | 156 | } 157 | 158 | - (void)willKeyboardHide:(NSNotification *)notification 159 | { 160 | self.isKeyboardShowing = NO; 161 | 162 | self.keyboardFrame = [notification.userInfo[@"UIKeyboardFrameEndUserInfoKey"] CGRectValue]; 163 | 164 | [self resetTheViewNeedsToBeResetAppropraitly]; 165 | 166 | } 167 | 168 | - (void)resetTheViewNeedsToBeResetAppropraitly 169 | { 170 | 171 | // NSLog(@"%@", NSStringFromCGRect(self.firstResponder.frame)); 172 | 173 | UIView *tempSuperView = [[UIView alloc] initWithFrame:self.viewNeedsToBeReset.frame]; 174 | UIView *tempSuberView = [[UIView alloc] initWithFrame:self.firstResponder.frame]; 175 | 176 | tempSuberView.frame = [self.firstResponder convertRect:self.firstResponder.bounds toView:self.viewNeedsToBeReset]; 177 | 178 | [tempSuperView addSubview:tempSuberView]; 179 | [self.firstResponder.window addSubview:tempSuperView]; 180 | 181 | CGRect firstResponderFrameInWindow = [tempSuberView convertRect:tempSuberView.bounds toView:self.firstResponder.window]; 182 | 183 | [tempSuperView removeFromSuperview]; 184 | 185 | if (self.firstResponder) { 186 | 187 | if (self.keyboardFrame.origin.y < firstResponderFrameInWindow.origin.y + firstResponderFrameInWindow.size.height + self.assistantHeight + self.firstResponder.assistantHeight) { 188 | 189 | [self addBoundsChangeAnimationFrome:self.viewNeedsToBeReset.bounds to:CGRectMake(0, (firstResponderFrameInWindow.origin.y + firstResponderFrameInWindow.size.height - self.keyboardFrame.origin.y + self.assistantHeight + self.firstResponder.assistantHeight), self.viewNeedsToBeReset.frame.size.width, self.viewNeedsToBeReset.frame.size.height) inView:self.viewNeedsToBeReset]; 190 | 191 | self.isOrigin = NO; 192 | 193 | } 194 | else 195 | { 196 | [self setOrigin]; 197 | } 198 | 199 | } 200 | else 201 | { 202 | [self setOrigin]; 203 | } 204 | 205 | } 206 | 207 | - (void)setOrigin 208 | { 209 | if (self.isOrigin) { 210 | return; 211 | } 212 | 213 | [self addBoundsChangeAnimationFrome:self.viewNeedsToBeReset.bounds to:CGRectMake(0, 0, self.viewNeedsToBeReset.bounds.size.width, self.viewNeedsToBeReset.bounds.size.height) inView:self.viewNeedsToBeReset]; 214 | 215 | self.isOrigin = YES; 216 | } 217 | 218 | - (void)addBoundsChangeAnimationFrome:(CGRect)from to:(CGRect)to inView:(UIView *)view 219 | { 220 | 221 | [UIView animateWithDuration:0.25 animations:^{ 222 | view.bounds = to; 223 | }]; 224 | 225 | } 226 | 227 | - (void)dealloc 228 | { 229 | // NSLog(@"%@ dealloc", self); 230 | [self stopHandling]; 231 | } 232 | 233 | - (void)didFirstResponderChanged:(NSNotification *)notification 234 | { 235 | 236 | if (self.firstResponder == notification.userInfo[@"firstResponder"]) { 237 | return; 238 | } 239 | 240 | self.firstResponder = notification.userInfo[@"firstResponder"]; 241 | 242 | if (self.isKeyboardShowing && self.firstResponder.shouldBeFoundOut && self.firstResponder.class != _UIAlertControllerTextField) { 243 | [self resetTheViewNeedsToBeResetAppropraitly]; 244 | } 245 | 246 | } 247 | 248 | @end 249 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/LJWKeyboardHandlerHeaders.h: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardHandlerHeader.h 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/6/19. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #ifndef LJWKeyboardHandlerExample_LJWKeyboardHandlerHeaders_h 10 | #define LJWKeyboardHandlerExample_LJWKeyboardHandlerHeaders_h 11 | 12 | #import "UIWindow+LJWPresentViewController.h" 13 | #import "LJWKeyboardToolBar.h" 14 | #import "UIView+LJWKeyboardHandlerAddtion.h" 15 | #import "UIViewController+LJWKeyboardHandlerHelper.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/LJWKeyboardToolBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardToolBar.h 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/6/15. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class LJWKeyboardToolBar; 13 | @protocol LJWKeyboardToolBarDelegate 14 | 15 | @optional; 16 | - (void)ljwKeyboardToolBar:(LJWKeyboardToolBar *)toolBar didClickLastItem:(UIBarButtonItem *)item; 17 | 18 | - (void)ljwKeyboardToolBar:(LJWKeyboardToolBar *)toolBar didClickNextItem:(UIBarButtonItem *)item; 19 | 20 | - (void)ljwKeyboardToolBar:(LJWKeyboardToolBar *)toolBar didClickDoneItem:(UIBarButtonItem *)item; 21 | 22 | @end 23 | 24 | @interface LJWKeyboardToolBar : UIToolbar 25 | 26 | @property (nonatomic, weak) id ljwKeyboardDelegate; 27 | 28 | @property (nonatomic, strong) NSMutableArray *responders; 29 | 30 | @property (nonatomic, strong) UIResponder *currentResponder; 31 | 32 | @property (nonatomic, assign) NSInteger currentResponderIndex; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/LJWKeyboardToolBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardToolBar.m 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/6/15. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import "LJWKeyboardToolBar.h" 10 | #import "LJWKeyboardHandlerHeaders.h" 11 | 12 | @interface LJWKeyboardToolBar () 13 | 14 | @property (nonatomic, strong) UIBarButtonItem *lastItem; 15 | 16 | @property (nonatomic, strong) UIBarButtonItem *nextItem; 17 | 18 | @end 19 | 20 | @implementation LJWKeyboardToolBar 21 | 22 | /* 23 | // Only override drawRect: if you perform custom drawing. 24 | // An empty implementation adversely affects performance during animation. 25 | - (void)drawRect:(CGRect)rect { 26 | // Drawing code 27 | } 28 | */ 29 | 30 | - (instancetype)initWithFrame:(CGRect)frame 31 | { 32 | self = [super initWithFrame:frame]; 33 | if (self) { 34 | 35 | NSString *resourcesBundlePath = [[NSBundle mainBundle] pathForResource:@"Resources" ofType:@"bundle"]; 36 | 37 | NSBundle *resourcesBundle = [NSBundle bundleWithPath:resourcesBundlePath]; 38 | 39 | UIImage *lastImage = [UIImage imageWithContentsOfFile:[resourcesBundle pathForResource:@"LJWButtonBarArrowLeft@2x" ofType:@"png"]]; 40 | 41 | UIImage *nextImage = [UIImage imageWithContentsOfFile:[resourcesBundle pathForResource:@"LJWButtonBarArrowRight@2x" ofType:@"png"]]; 42 | 43 | self.lastItem = [[UIBarButtonItem alloc] initWithImage:lastImage style:UIBarButtonItemStylePlain target:self action:@selector(didClickLastItem:)]; 44 | 45 | UIBarButtonItem *fixedItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 46 | fixedItem.width = 20.f; 47 | 48 | self.nextItem = [[UIBarButtonItem alloc] initWithImage:nextImage style:UIBarButtonItemStylePlain target:self action:@selector(didClickNextItem:)]; 49 | 50 | UIBarButtonItem *flexibleItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 51 | 52 | NSString *doneTitle = NSLocalizedStringFromTableInBundle(@"Done", @"LJWKeyBoardLocalization", resourcesBundle, nil); 53 | 54 | UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithTitle:doneTitle style:UIBarButtonItemStyleDone target:self action:@selector(didClickDoneItem:)]; 55 | 56 | [self setItems:@[self.lastItem, fixedItem, self.nextItem, flexibleItem, doneItem]]; 57 | 58 | } 59 | return self; 60 | } 61 | 62 | #pragma mark - ItemClickMethod 63 | - (void)didClickLastItem:(UIBarButtonItem *)item 64 | { 65 | 66 | [self lastOne]; 67 | 68 | if ([self.ljwKeyboardDelegate respondsToSelector:@selector(ljwKeyboardToolBar:didClickLastItem:)]) { 69 | 70 | [self.ljwKeyboardDelegate ljwKeyboardToolBar:self didClickLastItem:item]; 71 | 72 | } 73 | 74 | } 75 | 76 | - (void)didClickNextItem:(UIBarButtonItem *)item 77 | { 78 | 79 | [self nextOne]; 80 | 81 | if ([self.ljwKeyboardDelegate respondsToSelector:@selector(ljwKeyboardToolBar:didClickNextItem:)]) { 82 | 83 | [self.ljwKeyboardDelegate ljwKeyboardToolBar:self didClickNextItem:item]; 84 | 85 | } 86 | 87 | } 88 | 89 | - (void)didClickDoneItem:(UIBarButtonItem *)item 90 | { 91 | 92 | [self.currentResponder resignFirstResponder]; 93 | 94 | if ([self.ljwKeyboardDelegate respondsToSelector:@selector(ljwKeyboardToolBar:didClickDoneItem:)]) { 95 | 96 | [self.ljwKeyboardDelegate ljwKeyboardToolBar:self didClickDoneItem:item]; 97 | 98 | } 99 | 100 | } 101 | 102 | #pragma mark - setterMethod 103 | - (void)setCurrentResponderIndex:(NSInteger)currentResponderIndex 104 | { 105 | _currentResponderIndex = currentResponderIndex; 106 | 107 | if (currentResponderIndex == 0) { 108 | self.lastItem.enabled = NO; 109 | } 110 | else 111 | { 112 | self.lastItem.enabled = YES; 113 | } 114 | if (currentResponderIndex == self.responders.count - 1) { 115 | self.nextItem.enabled = NO; 116 | } 117 | else 118 | { 119 | self.nextItem.enabled = YES; 120 | } 121 | } 122 | 123 | - (void)setCurrentResponder:(UIResponder *)currentResponder 124 | { 125 | 126 | if ([currentResponder isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) { 127 | 128 | _currentResponder = [[(UIView *)currentResponder superview] superview]; 129 | } 130 | else 131 | { 132 | _currentResponder = currentResponder; 133 | } 134 | 135 | self.currentResponderIndex = [self.responders indexOfObject:_currentResponder]; 136 | 137 | [_currentResponder becomeFirstResponder]; 138 | } 139 | 140 | #pragma mark - ControlMethod 141 | - (void)nextOne 142 | { 143 | self.currentResponderIndex ++; 144 | 145 | self.currentResponder = [self.responders objectAtIndex:self.currentResponderIndex]; 146 | 147 | } 148 | 149 | - (void)lastOne 150 | { 151 | self.currentResponderIndex --; 152 | 153 | self.currentResponder = [self.responders objectAtIndex:self.currentResponderIndex]; 154 | } 155 | 156 | - (NSMutableArray *)responders 157 | { 158 | return [[UIApplication sharedApplication].keyWindow.presentViewController.view findOutAllSubViewsCanBecomeFirstResponder]; 159 | } 160 | 161 | @end 162 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/LJWButtonBarArrowLeft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinaljw/LJWKeyboardHandler/eeea5e56808702399e499f1f02fd2f99657bafff/LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/LJWButtonBarArrowLeft@2x.png -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/LJWButtonBarArrowRight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chinaljw/LJWKeyboardHandler/eeea5e56808702399e499f1f02fd2f99657bafff/LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/LJWButtonBarArrowRight@2x.png -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/en.lproj/LJWKeyBoardLocalization.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localization.strings 3 | LJWKeyboardHandlerExample 4 | 5 | Created by ljw on 15/6/15. 6 | Copyright (c) 2015年 ljw. All rights reserved. 7 | */ 8 | "Done" = "Done"; -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/Resources.bundle/zh-Hans.lproj/LJWKeyBoardLocalization.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localization.strings 3 | LJWKeyboardHandlerExample 4 | 5 | Created by ljw on 15/6/15. 6 | Copyright (c) 2015年 ljw. All rights reserved. 7 | */ 8 | "Done" = "完成"; -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIView+LJWKeyboardHandlerAddtion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+LJWKeyboardHandlerAddtion.h 3 | // Pods 4 | // 5 | // Created by ljw on 15/6/19. 6 | // 7 | // 8 | 9 | #import 10 | 11 | static NSString *const kLJWFirstResponderChanged = @"kLJWFirstResponderChanged"; 12 | 13 | @interface UIView (LJWKeyboardHandlerAddtion) 14 | 15 | #pragma mark - FindOutViews 16 | - (NSMutableArray *)findOutViews:(NSArray *)viewClasses; 17 | 18 | - (NSMutableArray *)findOutAllSubViewsCanBecomeFirstResponder; 19 | 20 | #pragma mark - PropertyAddition 21 | /** 22 | * 是否作为响应者,被找出来。 23 | */ 24 | @property (nonatomic, assign) BOOL shouldBeFoundOut; 25 | 26 | /** 27 | * 辅助高度偏移量 28 | */ 29 | @property (nonatomic, assign) CGFloat assistantHeight; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIView+LJWKeyboardHandlerAddtion.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+LJWKeyboardHandlerAddtion.m 3 | // Pods 4 | // 5 | // Created by ljw on 15/6/19. 6 | // 7 | // 8 | 9 | #import "UIView+LJWKeyboardHandlerAddtion.h" 10 | #import 11 | 12 | @implementation UIView (LJWKeyboardHandlerAddtion) 13 | 14 | /* 15 | // Only override drawRect: if you perform custom drawing. 16 | // An empty implementation adversely affects performance during animation. 17 | - (void)drawRect:(CGRect)rect { 18 | // Drawing code 19 | } 20 | */ 21 | 22 | #pragma mark - FindOutViews 23 | - (NSMutableArray *)findOutViews:(NSArray *)viewClasses 24 | { 25 | 26 | NSArray *subviews = self.subviews; 27 | 28 | NSMutableArray *views = [[NSMutableArray alloc] initWithCapacity:subviews.count]; 29 | 30 | for (UIView *view in subviews) { 31 | 32 | BOOL isKindOf = NO; 33 | 34 | for (Class class in viewClasses) { 35 | if ([view isKindOfClass:class]) { 36 | [views addObject:view]; 37 | isKindOf = YES; 38 | } 39 | } 40 | 41 | if (isKindOf) { 42 | continue; 43 | } 44 | 45 | [views addObjectsFromArray:[view findOutViews:viewClasses]]; 46 | 47 | } 48 | 49 | return views; 50 | } 51 | 52 | - (NSMutableArray *)findOutAllSubViewsCanBecomeFirstResponder 53 | { 54 | NSArray *subviews = self.subviews; 55 | 56 | subviews = [subviews sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) { 57 | 58 | if (view1.frame.origin.y < view2.frame.origin.y) { 59 | return NSOrderedAscending; 60 | } 61 | else if (view1.frame.origin.y == view2.frame.origin.y) 62 | { 63 | return NSOrderedSame; 64 | } 65 | else 66 | { 67 | return NSOrderedDescending; 68 | } 69 | 70 | }]; 71 | 72 | NSMutableArray *views = [[NSMutableArray alloc] initWithCapacity:subviews.count]; 73 | 74 | for (UIView *view in subviews) { 75 | 76 | if ([view canBecomeFirstResponder] && view.shouldBeFoundOut) { 77 | 78 | [views addObject:view]; 79 | 80 | } 81 | else 82 | { 83 | [views addObjectsFromArray:[view findOutAllSubViewsCanBecomeFirstResponder]]; 84 | } 85 | 86 | } 87 | 88 | return views; 89 | 90 | } 91 | 92 | #pragma mark - FirstResponderNotification 93 | + (void)load 94 | { 95 | 96 | static dispatch_once_t onceToken; 97 | dispatch_once(&onceToken, ^{ 98 | 99 | SEL originSEL = @selector(becomeFirstResponder); 100 | SEL newSEL = @selector(ljw_becomeFirstResponder); 101 | 102 | Method originMethod = class_getInstanceMethod([self class], originSEL); 103 | Method newMethod = class_getInstanceMethod(self.class, newSEL); 104 | 105 | if (class_addMethod(self.class, originSEL, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { 106 | 107 | class_replaceMethod(self.class, newSEL, method_getImplementation(originMethod), method_getTypeEncoding(originMethod)); 108 | 109 | } 110 | else 111 | { 112 | method_exchangeImplementations(originMethod, newMethod); 113 | } 114 | 115 | }); 116 | } 117 | 118 | - (BOOL)ljw_becomeFirstResponder 119 | { 120 | 121 | // NSLog(@"%@ becomeFirstResponder", self); 122 | [[NSNotificationCenter defaultCenter] postNotificationName:kLJWFirstResponderChanged object:nil userInfo:@{@"firstResponder":self}]; 123 | 124 | return [self ljw_becomeFirstResponder]; 125 | } 126 | 127 | #pragma mark - PropertyAddition 128 | - (void)setShouldBeFoundOut:(BOOL)shouldBeFoundOut 129 | { 130 | objc_setAssociatedObject(self, @selector(shouldBeFoundOut), @(shouldBeFoundOut), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 131 | } 132 | 133 | - (BOOL)shouldBeFoundOut 134 | { 135 | 136 | NSNumber *shouldBeFoundOut = objc_getAssociatedObject(self, @selector(shouldBeFoundOut)); 137 | 138 | if (!shouldBeFoundOut) { 139 | self.shouldBeFoundOut = YES; 140 | return YES; 141 | } 142 | 143 | return [shouldBeFoundOut integerValue]; 144 | } 145 | 146 | - (void)setAssistantHeight:(CGFloat)assistantHeight 147 | { 148 | objc_setAssociatedObject(self, @selector(assistantHeight), @(assistantHeight), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 149 | } 150 | 151 | - (CGFloat)assistantHeight 152 | { 153 | NSNumber *assistantHeight = objc_getAssociatedObject(self, @selector(assistantHeight)); 154 | 155 | if (!assistantHeight) { 156 | self.assistantHeight = 0; 157 | return 0; 158 | } 159 | 160 | return [assistantHeight doubleValue]; 161 | } 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIViewController+LJWKeyboardHandlerHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+LJWKeyboardHandlerHelper.h 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/27. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LJWKeyboardHandler.h" 11 | 12 | @interface UIViewController (LJWKeyboardHandlerHelper) 13 | 14 | @property (nonatomic, strong) LJWKeyboardHandler *ljwKeyboardHandler; 15 | 16 | /** 17 | * 注册LJWKeyboardHandler 18 | * 19 | * @return handler实例 20 | */ 21 | - (LJWKeyboardHandler *)registerLJWKeyboardHandler; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIViewController+LJWKeyboardHandlerHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+LJWKeyboardHandlerHelper.m 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/27. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+LJWKeyboardHandlerHelper.h" 10 | #import 11 | 12 | @implementation UIViewController (LJWKeyboardHandlerHelper) 13 | 14 | @dynamic ljwKeyboardHandler; 15 | 16 | - (void)setLjwKeyboardHandler:(LJWKeyboardHandler *)ljwKeyboardHandler 17 | { 18 | objc_setAssociatedObject(self, @selector(ljwKeyboardHandler), ljwKeyboardHandler, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 19 | } 20 | 21 | - (LJWKeyboardHandler *)ljwKeyboardHandler 22 | { 23 | return objc_getAssociatedObject(self, @selector(ljwKeyboardHandler)); 24 | } 25 | 26 | #pragma mark - MethodSwizzling 27 | + (void)load 28 | { 29 | static dispatch_once_t onceToken; 30 | dispatch_once(&onceToken, ^{ 31 | 32 | [self swizzlingWithObject:self originSEL:@selector(viewDidAppear:) newSEL:@selector(ljw_viewDidAppear:)]; 33 | [self swizzlingWithObject:self originSEL:@selector(viewWillDisappear:) newSEL:@selector(ljw_viewWillDisappear:)]; 34 | 35 | }); 36 | } 37 | 38 | + (void)swizzlingWithObject:(id)object originSEL:(SEL)originSEL newSEL:(SEL)newSEL 39 | { 40 | Method originMethod = class_getInstanceMethod(object, originSEL); 41 | Method newMethod = class_getInstanceMethod(object, newSEL); 42 | 43 | if (class_addMethod(self.class, originSEL, class_getMethodImplementation(self.class, newSEL), method_getTypeEncoding(newMethod))) { 44 | 45 | class_replaceMethod(self.class, newSEL, class_getMethodImplementation(self.class, originSEL), method_getTypeEncoding(originMethod)); 46 | 47 | } 48 | else 49 | { 50 | method_exchangeImplementations(originMethod, newMethod); 51 | } 52 | 53 | 54 | } 55 | 56 | - (void)ljw_viewDidAppear:(BOOL)animated 57 | { 58 | [self ljw_viewDidAppear:animated]; 59 | 60 | [self.ljwKeyboardHandler startHandling]; 61 | } 62 | 63 | - (void)ljw_viewWillDisappear:(BOOL)animated 64 | { 65 | [self ljw_viewWillDisappear:animated]; 66 | 67 | [self.ljwKeyboardHandler stopHandling]; 68 | } 69 | 70 | /** 71 | * 注册LJWKeyboardHandler 72 | * 73 | * @return handler实例 74 | */ 75 | - (LJWKeyboardHandler *)registerLJWKeyboardHandler 76 | { 77 | self.ljwKeyboardHandler = [[LJWKeyboardHandler alloc] init]; 78 | 79 | return self.ljwKeyboardHandler; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIWindow+LJWPresentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+LJWPresentViewController.h 3 | // Parking 4 | // 5 | // Created by ljw on 15/5/15. 6 | // Copyright (c) 2015年 Mark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWindow (LJWPresentViewController) 12 | 13 | - (UIViewController *)presentViewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/LJWKeyboardHandler/UIWindow+LJWPresentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+LJWPresentViewController.m 3 | // Parking 4 | // 5 | // Created by ljw on 15/5/15. 6 | // Copyright (c) 2015年 Mark. All rights reserved. 7 | // 8 | 9 | #import "UIWindow+LJWPresentViewController.h" 10 | #import 11 | 12 | @implementation UIWindow (LJWPresentViewController) 13 | 14 | - (UIViewController *)presentViewController 15 | { 16 | return [self getPresentViewController:self.rootViewController]; 17 | } 18 | 19 | - (UIViewController *)getPresentViewController:(UIViewController *)currentViewController 20 | { 21 | 22 | if ([currentViewController isKindOfClass:[UINavigationController class]]) { 23 | return [self getPresentViewController:[(UINavigationController *)currentViewController topViewController]]; 24 | } 25 | 26 | if ([currentViewController isKindOfClass:[UITabBarController class]]) { 27 | return [self getPresentViewController:[(UITabBarController *)currentViewController selectedViewController]]; 28 | } 29 | 30 | if ([currentViewController presentedViewController]) { 31 | return [self getPresentViewController:[currentViewController presentedViewController]]; 32 | } 33 | 34 | return currentViewController; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LJWKeyboardHandlerHeaders.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITextField *test; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view, typically from a nib. 23 | 24 | //注册一下就好~ 25 | [self registerLJWKeyboardHandler]; 26 | 27 | self.test.assistantHeight = 50; 28 | 29 | } 30 | 31 | - (void)didReceiveMemoryWarning { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 37 | { 38 | [self.view endEditing:YES]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/en.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIButton"; normalTitle = "Button"; ObjectID = "4jO-Hu-pS6"; */ 3 | "4jO-Hu-pS6.normalTitle" = "Button"; 4 | 5 | /* Class = "UITextView"; text = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; ObjectID = "Pbp-00-2FT"; */ 6 | "Pbp-00-2FT.text" = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; 7 | 8 | /* Class = "UIButton"; normalTitle = "Button"; ObjectID = "qnQ-px-X7P"; */ 9 | "qnQ-px-X7P.normalTitle" = "Button"; 10 | 11 | /* Class = "UITextView"; text = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; ObjectID = "tjB-lk-p8B"; */ 12 | "tjB-lk-p8B.text" = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; 13 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LJWKeyboardHandlerExample 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. 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 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = " Copyright (c) 2015年 ljw. All rights reserved."; ObjectID = "8ie-xW-0ye"; */ 3 | "8ie-xW-0ye.text" = " Copyright (c) 2015年 ljw. All rights reserved."; 4 | 5 | /* Class = "UILabel"; text = "LJWKeyboardHandlerExample"; ObjectID = "kId-c2-rCX"; */ 6 | "kId-c2-rCX.text" = "LJWKeyboardHandlerExample"; 7 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExample/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UIButton"; normalTitle = "Button"; ObjectID = "4jO-Hu-pS6"; */ 3 | "4jO-Hu-pS6.normalTitle" = "Button"; 4 | 5 | /* Class = "UITextView"; text = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; ObjectID = "Pbp-00-2FT"; */ 6 | "Pbp-00-2FT.text" = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; 7 | 8 | /* Class = "UIButton"; normalTitle = "Button"; ObjectID = "qnQ-px-X7P"; */ 9 | "qnQ-px-X7P.normalTitle" = "Button"; 10 | 11 | /* Class = "UITextView"; text = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; ObjectID = "tjB-lk-p8B"; */ 12 | "tjB-lk-p8B.text" = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda."; 13 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.ljw.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LJWKeyboardHandlerExampleTests/LJWKeyboardHandlerExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LJWKeyboardHandlerExampleTests.m 3 | // LJWKeyboardHandlerExampleTests 4 | // 5 | // Created by ljw on 15/5/18. 6 | // Copyright (c) 2015年 ljw. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LJWKeyboardHandlerExampleTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation LJWKeyboardHandlerExampleTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 当文本框在在scrollview里时会有问题,还有其他未知bug。。。请慎用。。 2 | 3 | # LJWKeyboardHandler 4 | 5 | 监听键盘的小助手,帮你的TextField,TextView闪避键盘的攻击,在ViewController里注册下就能用了哟~ 6 | 7 | 非常环保,跟随试图控制器的销毁而销毁~ 8 | 9 | 可以在不同的ViewController里设置不同的辅助移动高度,也可以为每个view设置不同的移动高度,两个高度会叠加~ 10 | 11 | 可以设置单个视图是否需要闪避键盘; 12 | 13 | 添加了Keyboard的ToolBar支持上蹿下跳和收回键盘; 14 | 15 | 支持CocoaPods了哟~~~ 16 | 17 | #CocoaPods 18 | 19 | pod 'LJWKeyboardHandler', '~> 1.0.3' 20 | 21 | #How to use 22 | 23 | Just one line code. 24 | 25 | [self registerLJWKeyboardHandler]; 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | --------------------------------------------------------------------------------