├── .gitignore ├── LICENSE ├── README.md ├── WUGestureToUnlock ├── WUGestureToUnlock.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── WUGestureToUnlock │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ ├── WUGestureUnlockView │ │ ├── WUGesturesUnlockIndicator.h │ │ ├── WUGesturesUnlockIndicator.m │ │ ├── WUGesturesUnlockView.h │ │ ├── WUGesturesUnlockView.m │ │ ├── WUGesturesUnlockViewController.h │ │ ├── WUGesturesUnlockViewController.m │ │ ├── WUGesturesUnlockViewController.xib │ │ ├── gesture_headIcon@2x.png │ │ ├── gesture_indicator_normal@2x.png │ │ ├── gesture_indicator_selected@2x.png │ │ ├── gesture_normal@2x.png │ │ └── gesture_selected@2x.png │ └── main.m ├── WUGestureToUnlockTests │ ├── Info.plist │ └── WUGestureToUnlockTests.m └── WUGestureToUnlockUITests │ ├── Info.plist │ └── WUGestureToUnlockUITests.m └── WUGesturesToUnlock.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # 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/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 wuqihan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WUGesturesToUnlock iOS手势解锁(已适配) 2 | ![image](https://github.com/wqhiOS/WUGesturesToUnlock/raw/master/WUGesturesToUnlock.gif) 3 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 576B331C1CAE915C003917A8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B331B1CAE915C003917A8 /* main.m */; }; 11 | 576B331F1CAE915C003917A8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B331E1CAE915C003917A8 /* AppDelegate.m */; }; 12 | 576B33221CAE915C003917A8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B33211CAE915C003917A8 /* ViewController.m */; }; 13 | 576B33251CAE915C003917A8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 576B33231CAE915C003917A8 /* Main.storyboard */; }; 14 | 576B33271CAE915C003917A8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 576B33261CAE915C003917A8 /* Assets.xcassets */; }; 15 | 576B332A1CAE915C003917A8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 576B33281CAE915C003917A8 /* LaunchScreen.storyboard */; }; 16 | 576B33351CAE915C003917A8 /* WUGestureToUnlockTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B33341CAE915C003917A8 /* WUGestureToUnlockTests.m */; }; 17 | 576B33401CAE915C003917A8 /* WUGestureToUnlockUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B333F1CAE915C003917A8 /* WUGestureToUnlockUITests.m */; }; 18 | 576B33551CAE922D003917A8 /* WUGesturesUnlockIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B334F1CAE922D003917A8 /* WUGesturesUnlockIndicator.m */; }; 19 | 576B33561CAE922D003917A8 /* WUGesturesUnlockView.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B33511CAE922D003917A8 /* WUGesturesUnlockView.m */; }; 20 | 576B33571CAE922D003917A8 /* WUGesturesUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 576B33531CAE922D003917A8 /* WUGesturesUnlockViewController.m */; }; 21 | 576B33581CAE922D003917A8 /* WUGesturesUnlockViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 576B33541CAE922D003917A8 /* WUGesturesUnlockViewController.xib */; }; 22 | 576B335B1CAE9260003917A8 /* gesture_headIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 576B335A1CAE9260003917A8 /* gesture_headIcon@2x.png */; }; 23 | 576B335D1CAE926E003917A8 /* gesture_indicator_normal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 576B335C1CAE926E003917A8 /* gesture_indicator_normal@2x.png */; }; 24 | 576B335F1CAE9274003917A8 /* gesture_indicator_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 576B335E1CAE9274003917A8 /* gesture_indicator_selected@2x.png */; }; 25 | 576B33611CAE927A003917A8 /* gesture_normal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 576B33601CAE927A003917A8 /* gesture_normal@2x.png */; }; 26 | 576B33631CAE9282003917A8 /* gesture_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 576B33621CAE9282003917A8 /* gesture_selected@2x.png */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 576B33311CAE915C003917A8 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 576B330F1CAE915C003917A8 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 576B33161CAE915C003917A8; 35 | remoteInfo = WUGestureToUnlock; 36 | }; 37 | 576B333C1CAE915C003917A8 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 576B330F1CAE915C003917A8 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 576B33161CAE915C003917A8; 42 | remoteInfo = WUGestureToUnlock; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 576B33171CAE915C003917A8 /* WUGestureToUnlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WUGestureToUnlock.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 576B331B1CAE915C003917A8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 576B331D1CAE915C003917A8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 576B331E1CAE915C003917A8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | 576B33201CAE915C003917A8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 52 | 576B33211CAE915C003917A8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 53 | 576B33241CAE915C003917A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 576B33261CAE915C003917A8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 576B33291CAE915C003917A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 576B332B1CAE915C003917A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 576B33301CAE915C003917A8 /* WUGestureToUnlockTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WUGestureToUnlockTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 576B33341CAE915C003917A8 /* WUGestureToUnlockTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WUGestureToUnlockTests.m; sourceTree = ""; }; 59 | 576B33361CAE915C003917A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 576B333B1CAE915C003917A8 /* WUGestureToUnlockUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WUGestureToUnlockUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 576B333F1CAE915C003917A8 /* WUGestureToUnlockUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WUGestureToUnlockUITests.m; sourceTree = ""; }; 62 | 576B33411CAE915C003917A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 576B334E1CAE922D003917A8 /* WUGesturesUnlockIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WUGesturesUnlockIndicator.h; sourceTree = ""; }; 64 | 576B334F1CAE922D003917A8 /* WUGesturesUnlockIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WUGesturesUnlockIndicator.m; sourceTree = ""; }; 65 | 576B33501CAE922D003917A8 /* WUGesturesUnlockView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WUGesturesUnlockView.h; sourceTree = ""; }; 66 | 576B33511CAE922D003917A8 /* WUGesturesUnlockView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WUGesturesUnlockView.m; sourceTree = ""; }; 67 | 576B33521CAE922D003917A8 /* WUGesturesUnlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WUGesturesUnlockViewController.h; sourceTree = ""; }; 68 | 576B33531CAE922D003917A8 /* WUGesturesUnlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WUGesturesUnlockViewController.m; sourceTree = ""; }; 69 | 576B33541CAE922D003917A8 /* WUGesturesUnlockViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WUGesturesUnlockViewController.xib; sourceTree = ""; }; 70 | 576B335A1CAE9260003917A8 /* gesture_headIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gesture_headIcon@2x.png"; sourceTree = ""; }; 71 | 576B335C1CAE926E003917A8 /* gesture_indicator_normal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gesture_indicator_normal@2x.png"; sourceTree = ""; }; 72 | 576B335E1CAE9274003917A8 /* gesture_indicator_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gesture_indicator_selected@2x.png"; sourceTree = ""; }; 73 | 576B33601CAE927A003917A8 /* gesture_normal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gesture_normal@2x.png"; sourceTree = ""; }; 74 | 576B33621CAE9282003917A8 /* gesture_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gesture_selected@2x.png"; sourceTree = ""; }; 75 | /* End PBXFileReference section */ 76 | 77 | /* Begin PBXFrameworksBuildPhase section */ 78 | 576B33141CAE915C003917A8 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | 576B332D1CAE915C003917A8 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 576B33381CAE915C003917A8 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | /* End PBXFrameworksBuildPhase section */ 100 | 101 | /* Begin PBXGroup section */ 102 | 576B330E1CAE915C003917A8 = { 103 | isa = PBXGroup; 104 | children = ( 105 | 576B33191CAE915C003917A8 /* WUGestureToUnlock */, 106 | 576B33331CAE915C003917A8 /* WUGestureToUnlockTests */, 107 | 576B333E1CAE915C003917A8 /* WUGestureToUnlockUITests */, 108 | 576B33181CAE915C003917A8 /* Products */, 109 | ); 110 | sourceTree = ""; 111 | }; 112 | 576B33181CAE915C003917A8 /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 576B33171CAE915C003917A8 /* WUGestureToUnlock.app */, 116 | 576B33301CAE915C003917A8 /* WUGestureToUnlockTests.xctest */, 117 | 576B333B1CAE915C003917A8 /* WUGestureToUnlockUITests.xctest */, 118 | ); 119 | name = Products; 120 | sourceTree = ""; 121 | }; 122 | 576B33191CAE915C003917A8 /* WUGestureToUnlock */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 576B334D1CAE921A003917A8 /* WUGestureUnlockView */, 126 | 576B331D1CAE915C003917A8 /* AppDelegate.h */, 127 | 576B331E1CAE915C003917A8 /* AppDelegate.m */, 128 | 576B33201CAE915C003917A8 /* ViewController.h */, 129 | 576B33211CAE915C003917A8 /* ViewController.m */, 130 | 576B33231CAE915C003917A8 /* Main.storyboard */, 131 | 576B33261CAE915C003917A8 /* Assets.xcassets */, 132 | 576B33281CAE915C003917A8 /* LaunchScreen.storyboard */, 133 | 576B332B1CAE915C003917A8 /* Info.plist */, 134 | 576B331A1CAE915C003917A8 /* Supporting Files */, 135 | ); 136 | path = WUGestureToUnlock; 137 | sourceTree = ""; 138 | }; 139 | 576B331A1CAE915C003917A8 /* Supporting Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 576B331B1CAE915C003917A8 /* main.m */, 143 | ); 144 | name = "Supporting Files"; 145 | sourceTree = ""; 146 | }; 147 | 576B33331CAE915C003917A8 /* WUGestureToUnlockTests */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 576B33341CAE915C003917A8 /* WUGestureToUnlockTests.m */, 151 | 576B33361CAE915C003917A8 /* Info.plist */, 152 | ); 153 | path = WUGestureToUnlockTests; 154 | sourceTree = ""; 155 | }; 156 | 576B333E1CAE915C003917A8 /* WUGestureToUnlockUITests */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 576B333F1CAE915C003917A8 /* WUGestureToUnlockUITests.m */, 160 | 576B33411CAE915C003917A8 /* Info.plist */, 161 | ); 162 | path = WUGestureToUnlockUITests; 163 | sourceTree = ""; 164 | }; 165 | 576B334D1CAE921A003917A8 /* WUGestureUnlockView */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 576B33591CAE923F003917A8 /* resources */, 169 | 576B334E1CAE922D003917A8 /* WUGesturesUnlockIndicator.h */, 170 | 576B334F1CAE922D003917A8 /* WUGesturesUnlockIndicator.m */, 171 | 576B33501CAE922D003917A8 /* WUGesturesUnlockView.h */, 172 | 576B33511CAE922D003917A8 /* WUGesturesUnlockView.m */, 173 | 576B33521CAE922D003917A8 /* WUGesturesUnlockViewController.h */, 174 | 576B33531CAE922D003917A8 /* WUGesturesUnlockViewController.m */, 175 | 576B33541CAE922D003917A8 /* WUGesturesUnlockViewController.xib */, 176 | ); 177 | path = WUGestureUnlockView; 178 | sourceTree = ""; 179 | }; 180 | 576B33591CAE923F003917A8 /* resources */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 576B33621CAE9282003917A8 /* gesture_selected@2x.png */, 184 | 576B33601CAE927A003917A8 /* gesture_normal@2x.png */, 185 | 576B335E1CAE9274003917A8 /* gesture_indicator_selected@2x.png */, 186 | 576B335C1CAE926E003917A8 /* gesture_indicator_normal@2x.png */, 187 | 576B335A1CAE9260003917A8 /* gesture_headIcon@2x.png */, 188 | ); 189 | name = resources; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | 576B33161CAE915C003917A8 /* WUGestureToUnlock */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 576B33441CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlock" */; 198 | buildPhases = ( 199 | 576B33131CAE915C003917A8 /* Sources */, 200 | 576B33141CAE915C003917A8 /* Frameworks */, 201 | 576B33151CAE915C003917A8 /* Resources */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | ); 207 | name = WUGestureToUnlock; 208 | productName = WUGestureToUnlock; 209 | productReference = 576B33171CAE915C003917A8 /* WUGestureToUnlock.app */; 210 | productType = "com.apple.product-type.application"; 211 | }; 212 | 576B332F1CAE915C003917A8 /* WUGestureToUnlockTests */ = { 213 | isa = PBXNativeTarget; 214 | buildConfigurationList = 576B33471CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlockTests" */; 215 | buildPhases = ( 216 | 576B332C1CAE915C003917A8 /* Sources */, 217 | 576B332D1CAE915C003917A8 /* Frameworks */, 218 | 576B332E1CAE915C003917A8 /* Resources */, 219 | ); 220 | buildRules = ( 221 | ); 222 | dependencies = ( 223 | 576B33321CAE915C003917A8 /* PBXTargetDependency */, 224 | ); 225 | name = WUGestureToUnlockTests; 226 | productName = WUGestureToUnlockTests; 227 | productReference = 576B33301CAE915C003917A8 /* WUGestureToUnlockTests.xctest */; 228 | productType = "com.apple.product-type.bundle.unit-test"; 229 | }; 230 | 576B333A1CAE915C003917A8 /* WUGestureToUnlockUITests */ = { 231 | isa = PBXNativeTarget; 232 | buildConfigurationList = 576B334A1CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlockUITests" */; 233 | buildPhases = ( 234 | 576B33371CAE915C003917A8 /* Sources */, 235 | 576B33381CAE915C003917A8 /* Frameworks */, 236 | 576B33391CAE915C003917A8 /* Resources */, 237 | ); 238 | buildRules = ( 239 | ); 240 | dependencies = ( 241 | 576B333D1CAE915C003917A8 /* PBXTargetDependency */, 242 | ); 243 | name = WUGestureToUnlockUITests; 244 | productName = WUGestureToUnlockUITests; 245 | productReference = 576B333B1CAE915C003917A8 /* WUGestureToUnlockUITests.xctest */; 246 | productType = "com.apple.product-type.bundle.ui-testing"; 247 | }; 248 | /* End PBXNativeTarget section */ 249 | 250 | /* Begin PBXProject section */ 251 | 576B330F1CAE915C003917A8 /* Project object */ = { 252 | isa = PBXProject; 253 | attributes = { 254 | LastUpgradeCheck = 0730; 255 | ORGANIZATIONNAME = "吴启晗"; 256 | TargetAttributes = { 257 | 576B33161CAE915C003917A8 = { 258 | CreatedOnToolsVersion = 7.3; 259 | }; 260 | 576B332F1CAE915C003917A8 = { 261 | CreatedOnToolsVersion = 7.3; 262 | TestTargetID = 576B33161CAE915C003917A8; 263 | }; 264 | 576B333A1CAE915C003917A8 = { 265 | CreatedOnToolsVersion = 7.3; 266 | TestTargetID = 576B33161CAE915C003917A8; 267 | }; 268 | }; 269 | }; 270 | buildConfigurationList = 576B33121CAE915C003917A8 /* Build configuration list for PBXProject "WUGestureToUnlock" */; 271 | compatibilityVersion = "Xcode 3.2"; 272 | developmentRegion = English; 273 | hasScannedForEncodings = 0; 274 | knownRegions = ( 275 | en, 276 | Base, 277 | ); 278 | mainGroup = 576B330E1CAE915C003917A8; 279 | productRefGroup = 576B33181CAE915C003917A8 /* Products */; 280 | projectDirPath = ""; 281 | projectRoot = ""; 282 | targets = ( 283 | 576B33161CAE915C003917A8 /* WUGestureToUnlock */, 284 | 576B332F1CAE915C003917A8 /* WUGestureToUnlockTests */, 285 | 576B333A1CAE915C003917A8 /* WUGestureToUnlockUITests */, 286 | ); 287 | }; 288 | /* End PBXProject section */ 289 | 290 | /* Begin PBXResourcesBuildPhase section */ 291 | 576B33151CAE915C003917A8 /* Resources */ = { 292 | isa = PBXResourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 576B33631CAE9282003917A8 /* gesture_selected@2x.png in Resources */, 296 | 576B335D1CAE926E003917A8 /* gesture_indicator_normal@2x.png in Resources */, 297 | 576B33581CAE922D003917A8 /* WUGesturesUnlockViewController.xib in Resources */, 298 | 576B332A1CAE915C003917A8 /* LaunchScreen.storyboard in Resources */, 299 | 576B335F1CAE9274003917A8 /* gesture_indicator_selected@2x.png in Resources */, 300 | 576B335B1CAE9260003917A8 /* gesture_headIcon@2x.png in Resources */, 301 | 576B33271CAE915C003917A8 /* Assets.xcassets in Resources */, 302 | 576B33251CAE915C003917A8 /* Main.storyboard in Resources */, 303 | 576B33611CAE927A003917A8 /* gesture_normal@2x.png in Resources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | 576B332E1CAE915C003917A8 /* Resources */ = { 308 | isa = PBXResourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | }; 314 | 576B33391CAE915C003917A8 /* Resources */ = { 315 | isa = PBXResourcesBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXResourcesBuildPhase section */ 322 | 323 | /* Begin PBXSourcesBuildPhase section */ 324 | 576B33131CAE915C003917A8 /* Sources */ = { 325 | isa = PBXSourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | 576B33561CAE922D003917A8 /* WUGesturesUnlockView.m in Sources */, 329 | 576B33221CAE915C003917A8 /* ViewController.m in Sources */, 330 | 576B33551CAE922D003917A8 /* WUGesturesUnlockIndicator.m in Sources */, 331 | 576B331F1CAE915C003917A8 /* AppDelegate.m in Sources */, 332 | 576B33571CAE922D003917A8 /* WUGesturesUnlockViewController.m in Sources */, 333 | 576B331C1CAE915C003917A8 /* main.m in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 576B332C1CAE915C003917A8 /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 576B33351CAE915C003917A8 /* WUGestureToUnlockTests.m in Sources */, 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | }; 345 | 576B33371CAE915C003917A8 /* Sources */ = { 346 | isa = PBXSourcesBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | 576B33401CAE915C003917A8 /* WUGestureToUnlockUITests.m in Sources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXSourcesBuildPhase section */ 354 | 355 | /* Begin PBXTargetDependency section */ 356 | 576B33321CAE915C003917A8 /* PBXTargetDependency */ = { 357 | isa = PBXTargetDependency; 358 | target = 576B33161CAE915C003917A8 /* WUGestureToUnlock */; 359 | targetProxy = 576B33311CAE915C003917A8 /* PBXContainerItemProxy */; 360 | }; 361 | 576B333D1CAE915C003917A8 /* PBXTargetDependency */ = { 362 | isa = PBXTargetDependency; 363 | target = 576B33161CAE915C003917A8 /* WUGestureToUnlock */; 364 | targetProxy = 576B333C1CAE915C003917A8 /* PBXContainerItemProxy */; 365 | }; 366 | /* End PBXTargetDependency section */ 367 | 368 | /* Begin PBXVariantGroup section */ 369 | 576B33231CAE915C003917A8 /* Main.storyboard */ = { 370 | isa = PBXVariantGroup; 371 | children = ( 372 | 576B33241CAE915C003917A8 /* Base */, 373 | ); 374 | name = Main.storyboard; 375 | sourceTree = ""; 376 | }; 377 | 576B33281CAE915C003917A8 /* LaunchScreen.storyboard */ = { 378 | isa = PBXVariantGroup; 379 | children = ( 380 | 576B33291CAE915C003917A8 /* Base */, 381 | ); 382 | name = LaunchScreen.storyboard; 383 | sourceTree = ""; 384 | }; 385 | /* End PBXVariantGroup section */ 386 | 387 | /* Begin XCBuildConfiguration section */ 388 | 576B33421CAE915C003917A8 /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_CONSTANT_CONVERSION = YES; 399 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = dwarf; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | ENABLE_TESTABILITY = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_DYNAMIC_NO_PIC = NO; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_OPTIMIZATION_LEVEL = 0; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 426 | MTL_ENABLE_DEBUG_INFO = YES; 427 | ONLY_ACTIVE_ARCH = YES; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | }; 431 | name = Debug; 432 | }; 433 | 576B33431CAE915C003917A8 /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ALWAYS_SEARCH_USER_PATHS = NO; 437 | CLANG_ANALYZER_NONNULL = YES; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 445 | CLANG_WARN_EMPTY_BODY = YES; 446 | CLANG_WARN_ENUM_CONVERSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = NO; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_NO_COMMON_BLOCKS = YES; 458 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 459 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 460 | GCC_WARN_UNDECLARED_SELECTOR = YES; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 465 | MTL_ENABLE_DEBUG_INFO = NO; 466 | SDKROOT = iphoneos; 467 | TARGETED_DEVICE_FAMILY = "1,2"; 468 | VALIDATE_PRODUCT = YES; 469 | }; 470 | name = Release; 471 | }; 472 | 576B33451CAE915C003917A8 /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 476 | INFOPLIST_FILE = WUGestureToUnlock/Info.plist; 477 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlock; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | }; 482 | name = Debug; 483 | }; 484 | 576B33461CAE915C003917A8 /* Release */ = { 485 | isa = XCBuildConfiguration; 486 | buildSettings = { 487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 488 | INFOPLIST_FILE = WUGestureToUnlock/Info.plist; 489 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 490 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 491 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlock; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | }; 494 | name = Release; 495 | }; 496 | 576B33481CAE915C003917A8 /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | BUNDLE_LOADER = "$(TEST_HOST)"; 500 | INFOPLIST_FILE = WUGestureToUnlockTests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlockTests; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WUGestureToUnlock.app/WUGestureToUnlock"; 505 | }; 506 | name = Debug; 507 | }; 508 | 576B33491CAE915C003917A8 /* Release */ = { 509 | isa = XCBuildConfiguration; 510 | buildSettings = { 511 | BUNDLE_LOADER = "$(TEST_HOST)"; 512 | INFOPLIST_FILE = WUGestureToUnlockTests/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlockTests; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WUGestureToUnlock.app/WUGestureToUnlock"; 517 | }; 518 | name = Release; 519 | }; 520 | 576B334B1CAE915C003917A8 /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | INFOPLIST_FILE = WUGestureToUnlockUITests/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 525 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlockUITests; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | TEST_TARGET_NAME = WUGestureToUnlock; 528 | }; 529 | name = Debug; 530 | }; 531 | 576B334C1CAE915C003917A8 /* Release */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | INFOPLIST_FILE = WUGestureToUnlockUITests/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = com.wuqh.WUGestureToUnlockUITests; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | TEST_TARGET_NAME = WUGestureToUnlock; 539 | }; 540 | name = Release; 541 | }; 542 | /* End XCBuildConfiguration section */ 543 | 544 | /* Begin XCConfigurationList section */ 545 | 576B33121CAE915C003917A8 /* Build configuration list for PBXProject "WUGestureToUnlock" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 576B33421CAE915C003917A8 /* Debug */, 549 | 576B33431CAE915C003917A8 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | 576B33441CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlock" */ = { 555 | isa = XCConfigurationList; 556 | buildConfigurations = ( 557 | 576B33451CAE915C003917A8 /* Debug */, 558 | 576B33461CAE915C003917A8 /* Release */, 559 | ); 560 | defaultConfigurationIsVisible = 0; 561 | defaultConfigurationName = Release; 562 | }; 563 | 576B33471CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlockTests" */ = { 564 | isa = XCConfigurationList; 565 | buildConfigurations = ( 566 | 576B33481CAE915C003917A8 /* Debug */, 567 | 576B33491CAE915C003917A8 /* Release */, 568 | ); 569 | defaultConfigurationIsVisible = 0; 570 | defaultConfigurationName = Release; 571 | }; 572 | 576B334A1CAE915C003917A8 /* Build configuration list for PBXNativeTarget "WUGestureToUnlockUITests" */ = { 573 | isa = XCConfigurationList; 574 | buildConfigurations = ( 575 | 576B334B1CAE915C003917A8 /* Debug */, 576 | 576B334C1CAE915C003917A8 /* Release */, 577 | ); 578 | defaultConfigurationIsVisible = 0; 579 | defaultConfigurationName = Release; 580 | }; 581 | /* End XCConfigurationList section */ 582 | }; 583 | rootObject = 576B330F1CAE915C003917A8 /* Project object */; 584 | } 585 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WUGestureToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. 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 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // WUGestureToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. 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 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/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 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 34 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // WUGestureToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // WUGestureToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "WUGesturesUnlockViewController.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | - (IBAction)create:(id)sender { 29 | WUGesturesUnlockViewController *vc = [[WUGesturesUnlockViewController alloc] initWithUnlockType:WUUnlockTypeCreatePwd]; 30 | [self presentViewController:vc animated:YES completion:nil]; 31 | } 32 | - (IBAction)validate:(id)sender { 33 | if ([WUGesturesUnlockViewController gesturesPassword].length > 0) { 34 | WUGesturesUnlockViewController *vc = [[WUGesturesUnlockViewController alloc] initWithUnlockType:WUUnlockTypeValidatePwd]; 35 | [self presentViewController:vc animated:YES completion:nil]; 36 | }else { 37 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"还没有设置手势密码" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"ok", nil]; 38 | [alertView show]; 39 | } 40 | 41 | } 42 | - (IBAction)delete:(id)sender { 43 | [WUGesturesUnlockViewController deleteGesturesPassword]; 44 | } 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // WUGesturesUnlockIndicator.h 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WUGesturesUnlockIndicator : UIView 12 | 13 | - (void)setGesturesPassword:(NSString *)gesturesPassword; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // WUGesturesUnlockIndicator.m 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import "WUGesturesUnlockIndicator.h" 10 | 11 | @interface WUGesturesUnlockIndicator() 12 | 13 | @property (nonatomic, strong) NSMutableArray *buttons; 14 | 15 | @end 16 | 17 | @implementation WUGesturesUnlockIndicator 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame { 20 | if (self = [super initWithFrame:frame]) { 21 | [self setup]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)awakeFromNib { 27 | [self setup]; 28 | } 29 | 30 | - (void)setup { 31 | //创建9个按钮 32 | for (int i = 0; i < 9; i++) { 33 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 34 | btn.userInteractionEnabled = NO; 35 | [btn setImage:[UIImage imageNamed:@"gesture_indicator_normal"] forState:UIControlStateNormal]; 36 | [btn setImage:[UIImage imageNamed:@"gesture_indicator_selected"] forState:UIControlStateSelected]; 37 | [self addSubview:btn]; 38 | [self.buttons addObject:btn]; 39 | } 40 | } 41 | 42 | - (void)layoutSubviews { 43 | [super layoutSubviews]; 44 | 45 | NSUInteger count = self.subviews.count; 46 | 47 | int cols = 3;//总列数 48 | 49 | CGFloat x = 0,y = 0,w = 9,h = 9;//bounds 50 | CGFloat margin = (self.bounds.size.width - cols * w) / (cols + 1);//间距 51 | 52 | CGFloat col = 0; 53 | CGFloat row = 0; 54 | for (int i = 0; i < count; i++) { 55 | 56 | col = i%cols; 57 | row = i/cols; 58 | 59 | x = margin + (w+margin)*col; 60 | y = margin + (w+margin)*row; 61 | 62 | UIButton *btn = self.subviews[i]; 63 | btn.frame = CGRectMake(x, y, w, h); 64 | } 65 | } 66 | 67 | - (NSMutableArray *)buttons { 68 | if (!_buttons) { 69 | _buttons = @[].mutableCopy; 70 | } 71 | return _buttons ; 72 | } 73 | 74 | #pragma mark - publick 75 | - (void)setGesturesPassword:(NSString *)gesturesPassword { 76 | 77 | if (gesturesPassword.length == 0) { 78 | for (UIButton *button in self.buttons) { 79 | button.selected = NO; 80 | } 81 | return; 82 | } 83 | 84 | for (int i = 0; i < gesturesPassword.length; i++) { 85 | 86 | NSString *s = [gesturesPassword substringWithRange:NSMakeRange(i, 1)]; 87 | 88 | [self.buttons[s.integerValue] setSelected:YES]; 89 | 90 | } 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockView.h: -------------------------------------------------------------------------------- 1 | // 2 | // WUGesturesLockView.h 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import 10 | @class WUGesturesUnlockView; 11 | 12 | #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 13 | #define Screen_Width [UIScreen mainScreen].bounds.size.width 14 | #define Screen_Height [UIScreen mainScreen].bounds.size.height 15 | 16 | @protocol WUGesturesUnlockViewDelegate 17 | 18 | - (void)gesturesUnlockView:(WUGesturesUnlockView *)unlockView drawRectFinished:(NSMutableString *)gesturePassword; 19 | 20 | @end 21 | 22 | @interface WUGesturesUnlockView : UIView 23 | 24 | @property (nonatomic,weak) id delegate; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockView.m: -------------------------------------------------------------------------------- 1 | // 2 | // WUGesturesLockView.m 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import "WUGesturesUnlockView.h" 10 | 11 | 12 | 13 | @interface WUGesturesUnlockView() 14 | 15 | @property (nonatomic, strong) NSMutableArray *selectedBtns; 16 | @property (nonatomic, assign) CGPoint currentPoint; 17 | 18 | @end 19 | 20 | @implementation WUGesturesUnlockView 21 | 22 | //加载完xib的时候调用 23 | - (void)awakeFromNib { 24 | [self setup]; 25 | } 26 | 27 | //为什么要在这个方法中布局子控件,因为只调用这个方法,就表示父控件的尺寸确定 28 | - (void)layoutSubviews { 29 | [super layoutSubviews]; 30 | 31 | NSUInteger count = self.subviews.count; 32 | 33 | int cols = 3;//总列数 34 | 35 | CGFloat x = 0,y = 0,w = 0,h = 0; 36 | 37 | if (Screen_Width == 320) { 38 | w = 50; 39 | h = 50; 40 | }else { 41 | w = 58; 42 | h = 58; 43 | } 44 | 45 | CGFloat margin = (self.bounds.size.width - cols * w) / (cols + 1);//间距 46 | 47 | CGFloat col = 0; 48 | CGFloat row = 0; 49 | for (int i = 0; i < count; i++) { 50 | 51 | col = i%cols; 52 | row = i/cols; 53 | 54 | x = margin + (w+margin)*col; 55 | 56 | y = margin + (w+margin)*row; 57 | if (Screen_Height == 480) { 58 | y = (w+margin)*row; 59 | }else { 60 | y = margin +(w+margin)*row; 61 | } 62 | 63 | UIButton *btn = self.subviews[i]; 64 | btn.frame = CGRectMake(x, y, w, h); 65 | } 66 | } 67 | 68 | //只要调用这个方法就会把之前绘制的东西清空 重新绘制 69 | - (void)drawRect:(CGRect)rect { 70 | if (self.selectedBtns.count == 0) return; 71 | // 把所有选中按钮中心点连线 72 | UIBezierPath *path = [UIBezierPath bezierPath]; 73 | 74 | NSUInteger count = self.selectedBtns.count; 75 | for (int i = 0; i < count; i++) { 76 | UIButton *btn = self.selectedBtns[i]; 77 | if (i == 0) { 78 | //设置起点 79 | [path moveToPoint:btn.center]; 80 | }else { 81 | [path addLineToPoint:btn.center]; 82 | } 83 | } 84 | 85 | [path addLineToPoint:_currentPoint ]; 86 | 87 | [UIColorFromRGB(0xffc8ad) set]; 88 | path.lineJoinStyle = kCGLineJoinRound; 89 | path.lineWidth = 8; 90 | [path stroke]; 91 | } 92 | 93 | #pragma mark - private 94 | - (void)setup { 95 | 96 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)]; 97 | [self addGestureRecognizer:pan]; 98 | 99 | //创建9个按钮 100 | for (int i = 0; i < 9; i++) { 101 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 102 | btn.userInteractionEnabled = NO; 103 | [btn setImage:[UIImage imageNamed:@"gesture_normal"] forState:UIControlStateNormal]; 104 | [btn setImage:[UIImage imageNamed:@"gesture_selected"] forState:UIControlStateSelected]; 105 | btn.tag = 1000+i; 106 | [self addSubview:btn]; 107 | } 108 | } 109 | 110 | #pragma mark - action pan 111 | - (void)pan:(UIPanGestureRecognizer *)pan { 112 | _currentPoint = [pan locationInView:self]; 113 | 114 | [self setNeedsDisplay]; 115 | 116 | for (UIButton *button in self.subviews) { 117 | if (CGRectContainsPoint(button.frame, _currentPoint) && button.selected == NO) { 118 | 119 | button.selected = YES; 120 | [self.selectedBtns addObject:button]; 121 | 122 | } 123 | } 124 | 125 | [self layoutIfNeeded]; 126 | 127 | if (pan.state == UIGestureRecognizerStateEnded) { 128 | 129 | //保存输入密码 130 | NSMutableString *gesturePwd = @"".mutableCopy; 131 | for (UIButton *button in self.selectedBtns) { 132 | [gesturePwd appendFormat:@"%ld",button.tag-1000]; 133 | button.selected = NO; 134 | } 135 | [self.selectedBtns removeAllObjects]; 136 | 137 | //手势密码绘制完成后会掉 138 | if ([self.delegate respondsToSelector:@selector(gesturesUnlockView:drawRectFinished:)]) { 139 | [self.delegate gesturesUnlockView:self drawRectFinished:gesturePwd]; 140 | } 141 | 142 | } 143 | } 144 | 145 | #pragma mark - getter 146 | - (NSMutableArray *)selectedBtns { 147 | if (!_selectedBtns) { 148 | _selectedBtns = @[].mutableCopy; 149 | } 150 | return _selectedBtns; 151 | } 152 | 153 | 154 | @end 155 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WUGestureUnlockViewController.h 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger,WUUnlockType) { 12 | WUUnlockTypeCreatePwd,//创建手势密码 13 | WUUnlockTypeValidatePwd//校验手势密码 14 | }; 15 | 16 | @interface WUGesturesUnlockViewController : UIViewController 17 | 18 | + (void)deleteGesturesPassword;//删除手势密码 19 | + (NSString *)gesturesPassword;//获取手势密码 20 | 21 | - (instancetype)initWithUnlockType:(WUUnlockType)unlockType; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WUGestureUnlockViewController.m 3 | // WUGesturesToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 wuqh. All rights reserved. 7 | // 8 | 9 | #import "WUGesturesUnlockViewController.h" 10 | #import "WUGesturesUnlockView.h" 11 | #import "WUGesturesUnlockIndicator.h" 12 | 13 | #define GesturesPassword @"gesturespassword" 14 | 15 | @interface WUGesturesUnlockViewController () 16 | 17 | @property (weak, nonatomic) IBOutlet WUGesturesUnlockView *gesturesUnlockView; 18 | @property (weak, nonatomic) IBOutlet WUGesturesUnlockIndicator *gesturesUnlockIndicator; 19 | @property (weak, nonatomic) IBOutlet UILabel *statusLabel; 20 | //重新绘制按钮 21 | @property (weak, nonatomic) IBOutlet UIButton *otherAcountLoginButton; 22 | @property (weak, nonatomic) IBOutlet UIButton *forgetGesturesPasswordButton; 23 | @property (weak, nonatomic) IBOutlet UIButton *resetGesturesPasswordButton; 24 | 25 | @property (weak, nonatomic) IBOutlet UILabel *nameLabel; 26 | @property (weak, nonatomic) IBOutlet UIImageView *headIconImageView; 27 | 28 | //约束: 29 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *indicatoerTopConstraint; 30 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *indicatorWidthConstraint; 31 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *headIconTopConstraint; 32 | 33 | 34 | @property (nonatomic) WUUnlockType unlockType; 35 | 36 | //要创建的手势密码 37 | @property (nonatomic, copy) NSString *lastGesturePassword; 38 | 39 | @end 40 | 41 | @implementation WUGesturesUnlockViewController 42 | 43 | #pragma mark - 类方法 44 | 45 | + (void)deleteGesturesPassword { 46 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:GesturesPassword]; 47 | [[NSUserDefaults standardUserDefaults] synchronize]; 48 | } 49 | 50 | + (void)addGesturesPassword:(NSString *)gesturesPassword { 51 | [[NSUserDefaults standardUserDefaults] setObject:gesturesPassword forKey:GesturesPassword]; 52 | [[NSUserDefaults standardUserDefaults] synchronize]; 53 | } 54 | 55 | + (NSString *)gesturesPassword { 56 | return [[NSUserDefaults standardUserDefaults] objectForKey:GesturesPassword]; 57 | } 58 | 59 | #pragma mark - inint 60 | - (instancetype)initWithUnlockType:(WUUnlockType)unlockType { 61 | if (self = [super init]) { 62 | _unlockType = unlockType; 63 | } 64 | return self; 65 | } 66 | 67 | #pragma mark - viewDidLoad 68 | - (void)viewDidLoad { 69 | [super viewDidLoad]; 70 | // Do any additional setup after loading the view from its nib. 71 | 72 | self.gesturesUnlockView.delegate = self; 73 | 74 | self.resetGesturesPasswordButton.hidden = YES; 75 | switch (_unlockType) { 76 | case WUUnlockTypeCreatePwd: 77 | { 78 | self.gesturesUnlockIndicator.hidden = NO; 79 | self.otherAcountLoginButton.hidden = YES; 80 | self.forgetGesturesPasswordButton.hidden = YES; 81 | self.nameLabel.hidden = YES; 82 | self.headIconImageView.hidden = YES; 83 | } 84 | break; 85 | case WUUnlockTypeValidatePwd: 86 | { 87 | self.gesturesUnlockIndicator.hidden = YES; 88 | 89 | } 90 | break; 91 | default: 92 | break; 93 | } 94 | 95 | [self udpateConstraints]; 96 | 97 | } 98 | 99 | #pragma mark - private 100 | //创建手势密码 101 | - (void)createGesturesPassword:(NSMutableString *)gesturesPassword { 102 | 103 | if (self.lastGesturePassword.length == 0) { 104 | 105 | if (gesturesPassword.length <4) { 106 | self.statusLabel.text = @"至少连接四个点,请重新输入"; 107 | [self shakeAnimationForView:self.statusLabel]; 108 | return; 109 | } 110 | 111 | if (self.resetGesturesPasswordButton.hidden == YES) { 112 | self.resetGesturesPasswordButton.hidden = NO; 113 | } 114 | 115 | self.lastGesturePassword = gesturesPassword; 116 | [self.gesturesUnlockIndicator setGesturesPassword:gesturesPassword]; 117 | self.statusLabel.text = @"请再次绘制手势密码"; 118 | return; 119 | } 120 | 121 | if ([self.lastGesturePassword isEqualToString:gesturesPassword]) {//绘制成功 122 | 123 | [self dismissViewControllerAnimated:YES completion:^{ 124 | //保存手势密码 125 | [WUGesturesUnlockViewController addGesturesPassword:gesturesPassword]; 126 | }]; 127 | 128 | }else { 129 | self.statusLabel.text = @"与上一次绘制不一致,请重新绘制"; 130 | [self shakeAnimationForView:self.statusLabel]; 131 | } 132 | 133 | 134 | } 135 | //验证手势密码 136 | - (void)validateGesturesPassword:(NSMutableString *)gesturesPassword { 137 | 138 | static NSInteger errorCount = 5; 139 | 140 | if ([gesturesPassword isEqualToString:[WUGesturesUnlockViewController gesturesPassword]]) { 141 | [self dismissViewControllerAnimated:YES completion:^{ 142 | errorCount = 5; 143 | }]; 144 | }else { 145 | 146 | if (errorCount - 1 == 0) {//你已经输错五次了! 退出登陆! 147 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"手势密码已失效" message:@"请重新登陆" delegate:self cancelButtonTitle:nil otherButtonTitles:@"重新登陆", nil]; 148 | [alertView show]; 149 | errorCount = 5; 150 | return; 151 | } 152 | 153 | self.statusLabel.text = [NSString stringWithFormat:@"密码错误,还可以再输入%ld次",--errorCount]; 154 | [self shakeAnimationForView:self.statusLabel]; 155 | } 156 | } 157 | 158 | //抖动动画 159 | - (void)shakeAnimationForView:(UIView *)view 160 | { 161 | CALayer *viewLayer = view.layer; 162 | CGPoint position = viewLayer.position; 163 | CGPoint left = CGPointMake(position.x - 10, position.y); 164 | CGPoint right = CGPointMake(position.x + 10, position.y); 165 | 166 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; 167 | [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 168 | [animation setFromValue:[NSValue valueWithCGPoint:left]]; 169 | [animation setToValue:[NSValue valueWithCGPoint:right]]; 170 | [animation setAutoreverses:YES]; // 平滑结束 171 | [animation setDuration:0.08]; 172 | [animation setRepeatCount:3]; 173 | 174 | [viewLayer addAnimation:animation forKey:nil]; 175 | } 176 | 177 | //更新约束,进行适配 178 | - (void)udpateConstraints { 179 | if (Screen_Height == 480) {// 适配4寸屏幕 180 | 181 | self.headIconTopConstraint.constant = 30; 182 | self.indicatoerTopConstraint.constant = 64; 183 | 184 | } 185 | 186 | } 187 | 188 | #pragma mark - Action 189 | //点击其他账号登陆按钮 190 | - (IBAction)otherAccountLogin:(id)sender { 191 | NSLog(@"%s",__FUNCTION__); 192 | } 193 | //点击重新绘制按钮 194 | - (IBAction)resetGesturePassword:(id)sender { 195 | NSLog(@"%s",__FUNCTION__); 196 | self.lastGesturePassword = nil; 197 | self.statusLabel.text = @"请绘制手势密码"; 198 | self.resetGesturesPasswordButton.hidden = YES; 199 | [self.gesturesUnlockIndicator setGesturesPassword:@""]; 200 | } 201 | //点击忘记手势密码按钮 202 | - (IBAction)forgetGesturesPassword:(id)sender { 203 | NSLog(@"%s",__FUNCTION__); 204 | } 205 | 206 | 207 | #pragma mark - WUGesturesUnlockViewDelegate 208 | - (void)gesturesUnlockView:(WUGesturesUnlockView *)unlockView drawRectFinished:(NSMutableString *)gesturePassword { 209 | 210 | switch (_unlockType) { 211 | case WUUnlockTypeCreatePwd://创建手势密码 212 | { 213 | [self createGesturesPassword:gesturePassword]; 214 | } 215 | break; 216 | case WUUnlockTypeValidatePwd://校验手势密码 217 | { 218 | [self validateGesturesPassword:gesturePassword]; 219 | } 220 | break; 221 | default: 222 | break; 223 | } 224 | } 225 | 226 | #pragma mark - UIAlertViewDelegate 227 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { 228 | //重新登陆 229 | NSLog(@"重新登陆"); 230 | } 231 | 232 | 233 | 234 | @end 235 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/WUGesturesUnlockViewController.xib: -------------------------------------------------------------------------------- 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 | 39 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 62 | 72 | 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 | 118 | 119 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_headIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_headIcon@2x.png -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_indicator_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_indicator_normal@2x.png -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_indicator_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_indicator_selected@2x.png -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_normal@2x.png -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGestureToUnlock/WUGestureToUnlock/WUGestureUnlockView/gesture_selected@2x.png -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlock/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WUGestureToUnlock 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. 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 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlockTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlockTests/WUGestureToUnlockTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WUGestureToUnlockTests.m 3 | // WUGestureToUnlockTests 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WUGestureToUnlockTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WUGestureToUnlockTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlockUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WUGestureToUnlock/WUGestureToUnlockUITests/WUGestureToUnlockUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WUGestureToUnlockUITests.m 3 | // WUGestureToUnlockUITests 4 | // 5 | // Created by wuqh on 16/4/1. 6 | // Copyright © 2016年 吴启晗. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WUGestureToUnlockUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WUGestureToUnlockUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /WUGesturesToUnlock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuqihan-1993/WUGesturesToUnlock/0738e52ad22a596cc5410a40c23049b9a5eefa38/WUGesturesToUnlock.gif --------------------------------------------------------------------------------