﻿{"id":1086,"date":"2016-06-02T19:19:48","date_gmt":"2016-06-02T11:19:48","guid":{"rendered":"http:\/\/zerobox.org\/notes\/?p=1086"},"modified":"2016-06-02T19:36:01","modified_gmt":"2016-06-02T11:36:01","slug":"ios%e6%8c%87%e7%ba%b9%e8%a7%a3%e9%94%81%e3%80%81%e6%89%8b%e5%8a%bf%e8%a7%a3%e9%94%81-swift%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/1086.html","title":{"rendered":"iOS\u6307\u7eb9\u89e3\u9501\u3001\u624b\u52bf\u89e3\u9501&#8211;Swift\u4ee3\u7801"},"content":{"rendered":"<div id=\"cnblogs_post_body\">\n<p>\u4e00\u3001\u6307\u7eb9\u9a8c\u8bc1<\/p>\n<p>iPhone \u7684Home\u952e \u4e0a\u7684\u91d1\u5c5e\u73af \u80fd\u611f\u5e94\u624b\u6307\uff0c\u901a\u77e5Touch ID \u8bfb\u53d6\u6307\u7eb9\uff0cTouch ID \u4f20\u611f\u5668 \u53ef\u4ee5\u62cd\u6444 \u76ae\u80a4 \u76ae\u4e0b\u5c42\u6307\u7eb9\u3002<\/p>\n<p>\u6bcf\u6b21\u4f7f\u7528\u6307\u7eb9\uff0cTouch ID \u4f1a\u6301\u7eed\u7684\u6dfb\u52a0\u65b0\u7684\u6307\u7eb9\u7279\u6027\uff0c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u51c6\u786e\u3001\u5b89\u5168\u6027\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/zerobox.org\/notes\/wp-content\/uploads\/2016\/06\/e2c3d76c3bbbe959e86b6caa5df4182e.png\" alt=\"\" width=\"292\" height=\"249\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Touch ID \u4e0d\u4f1a\u50a8\u5b58\u6307\u7eb9\u7684\u56fe\u50cf\u3002\u5b83\u53ea\u5b58\u50a8\u6307\u7eb9\u7684\u6570\u5b66\u8868\u8fbe\u5f0f\u3002\u8bbe\u5907\u4e2d\u7684\u82af\u7247\u8fd8\u5305\u542b\u79f0\u4e3a\u201cSecure Enclave\u201d\u7684\u9ad8\u7ea7\u5b89\u5168\u67b6\u6784\uff0c\u4e13\u95e8\u7528\u4e8e\u4fdd\u62a4\u5bc6\u7801\u548c\u6307\u7eb9\u6570\u636e\u3002\u6307\u7eb9\u6570\u636e\u901a\u8fc7 Secure Enclave \u7684\u4e13\u7528\u5bc6\u94a5\u5f97\u5230\u52a0\u5bc6\u548c\u4fdd\u62a4\u3002iOS \u548c\u5176\u4ed6 app \u7edd\u4e0d\u4f1a\u8bbf\u95ee\u60a8\u7684\u6307\u7eb9\u6570\u636e\uff0c\u6307\u7eb9\u6570\u636e\u7edd\u4e0d\u4f1a\u5b58\u50a8\u5230 Apple \u670d\u52a1\u5668\u3001 iCloud \u6216\u5176\u4ed6\u5730\u65b9\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>1\u3001 \u00a0import LocalAuthentication<\/p>\n<p>&nbsp;<\/p>\n<p>2\u3001\u7528\u00a0LAContext \u7c7b\u7684 \u00a0canEvaluatePolicy \u65b9\u6cd5 \u5224\u65ad\u8bbe\u5907\u662f\u5426\u652f\u6301\u6307\u7eb9\uff0c\u7136\u540e\u7528\u00a0evaluatePolicy \u65b9\u6cd5 \u6765\u8fdb\u884c\u6307\u7eb9\u9a8c\u8bc1\u3002<\/p>\n<p>\u6267\u884cevaluatePolicy\u65b9\u6cd5\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5f39\u51fa \u9a8c\u8bc1\u6307\u7eb9\u7684\u63d0\u793a\u6846\uff0c\u63d0\u793a\u526f\u6807\u9898\u53ef\u4ee5\u81ea\u5df1\u8bbe\u5b9a\u3002<\/p>\n<p>\u5982\u679c\u8f93\u5165\u9519\u8bef\u540e\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u8fdb\u5165\u201c\u518d\u8bd5\u4e00\u6b21\u201d\u7684\u63d0\u793a\u6846\uff0c\u70b9\u51fb\u53f3\u8fb9\u7684 \u201c\u8f93\u5165\u5bc6\u7801\u201d\u9009\u9879\uff0c\u8981\u81ea\u5df1\u5199\u4ee3\u7801\u5b9e\u73b0 \u8f93\u5165\u5bc6\u7801\u7684\u5f39\u6846\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/zerobox.org\/notes\/wp-content\/uploads\/2016\/06\/04705845c934e3965695b7229e04f823.png\" alt=\"\" width=\"265\" height=\"180\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"cnblogs_code\"><span class=\"cnblogs_code_collapse\">Swift Touch ID \u4ee3\u7801<\/span><\/div>\n<\/div>\n<div class=\"cnblogs_code\">let laContext = LAContext()<br \/>\nvar error:NSError?<br \/>\nif laContext.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &amp;error) {<br \/>\nlaContext.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics,<br \/>\nlocalizedReason: &#8220;\u8bf7\u9a8c\u8bc1\u5df2\u6709\u7684\u6307\u7eb9&#8221;,<br \/>\nreply: {(success: Bool, error: NSError?) in<br \/>\n\/\/\u8fd9\u91cc\u4e0d\u662f\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u6267\u884c\u7684\uff0c\u662f\u591a\u7ebf\u7a0b\u3002<br \/>\nif success {<br \/>\nprint(&#8220;\u9a8c\u8bc1\u6307\u7eb9\u6210\u529f&#8221;)<br \/>\nNSOperationQueue.mainQueue().addOperationWithBlock({ () -&gt; Void in<br \/>\n\/\/\u4e3b\u7ebf\u7a0b\u5237\u65b0View<br \/>\n})<br \/>\n} else {<br \/>\nprint(error)<br \/>\nswitch error?.code {<br \/>\ncase LAError.AuthenticationFailed.rawValue?:<br \/>\nprint(&#8220;\u6388\u6743\u5931\u8d25&#8221;)<br \/>\ncase LAError.UserCancel.rawValue?:<br \/>\nprint(&#8220;\u7528\u6237\u53d6\u6d88\u9a8c\u8bc1Touch ID&#8221;)<br \/>\ncase LAError.UserFallback.rawValue?:<br \/>\nprint(&#8220;\u7528\u6237\u70b9\u51fb \u8f93\u5165\u5bc6\u7801\uff0c\u5207\u6362\u4e3b\u7ebf\u7a0b\u5904\u7406&#8221;)<br \/>\nNSOperationQueue.mainQueue().addOperationWithBlock({ () -&gt; Void in<br \/>\nself.showPasswordAlert()<br \/>\n})<br \/>\ncase LAError.SystemCancel.rawValue?:<br \/>\nprint(&#8220;\u5207\u6362\u5230\u5176\u4ed6APP\uff0c\u7cfb\u7edf\u53d6\u6d88\u9a8c\u8bc1Touch ID&#8221;)<br \/>\ncase LAError.PasscodeNotSet.rawValue?:<br \/>\nprint(&#8220;\u7cfb\u7edf\u672a\u8bbe\u7f6e\u5bc6\u7801&#8221;)<br \/>\ncase LAError.TouchIDNotAvailable.rawValue?:<br \/>\nprint(&#8220;\u8bbe\u5907Touch ID\u4e0d\u53ef\u7528\uff0c\u4f8b\u5982\u672a\u6253\u5f00&#8221;)<br \/>\ncase LAError.TouchIDNotEnrolled.rawValue?:<br \/>\nprint(&#8220;\u8bbe\u5907Touch ID\u4e0d\u53ef\u7528\uff0c\u7528\u6237\u672a\u5f55\u5165&#8221;)<br \/>\ncase LAError.TouchIDLockout.rawValue?:<br \/>\nprint(&#8220;Touch ID\u8f93\u5165\u9519\u8bef\u591a\u6b21\uff0c\u5df2\u88ab\u9501&#8221;)<br \/>\ncase LAError.AppCancel.rawValue?:<br \/>\nprint(&#8220;\u7528\u6237\u9664\u5916\u7684APP\u6302\u8d77\uff0c\u5982\u7535\u8bdd\u63a5\u5165\u7b49\u5207\u6362\u5230\u4e86\u5176\u4ed6APP&#8221;)<br \/>\ndefault:<br \/>\nprint(&#8220;\u5176\u4ed6\u60c5\u51b5&#8221;)<br \/>\nNSOperationQueue.mainQueue().addOperationWithBlock({ () -&gt; Void in<br \/>\nself.showPasswordAlert()<br \/>\n})<br \/>\n}<br \/>\n}<br \/>\n})} else {<br \/>\nprint(error)<br \/>\n}<\/div>\n<div class=\"cnblogs_code\"><\/div>\n<p>&nbsp;<\/p>\n<div id=\"cnblogs_post_body\">\n<p>\u4e8c\u3001\u624b\u52bf\u5bc6\u7801<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/zerobox.org\/notes\/wp-content\/uploads\/2016\/06\/173ce4558aca043c9d9deb6da7bcf357.jpg\" alt=\"\" width=\"261\" height=\"464\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>1\u3001\u7528UIButton\u7ec4\u6210\u624b\u52bf\u7684\u8282\u70b9\u3002<\/p>\n<p>\u5f53\u624b\u6307\u63a5\u89e6\u5c4f\u5e55\u65f6\uff0c\u8c03\u7528\u91cd\u5199\u7684\u00a0touchesBegan:withEvent\u65b9\u6cd5\uff08\u5728touchesBegan\u91cc\u6761\u7528setNeedsDisplay\uff0c\u8fd9\u6837\u5c31\u4f1a\u81ea\u52a8\u8c03\u7528drawRect\u65b9\u6cd5\uff09\u3002<\/p>\n<p>\u5f53\u624b\u6307\u5728\u5c4f\u5e55\u4e0a\u6ed1\u52a8\u65f6\uff0c\u8c03\u7528\u91cd\u5199\u7684touchesEnded:withEvent\u65b9\u6cd5\u3002<\/p>\n<p>\u8fd9\u4e24\u4e2a\u65b9\u6cd5\u6267\u884c\u7684\u64cd\u4f5c\u662f\u4e00\u6837\u7684\uff1a\u901a\u8fc7locationInView\u83b7\u53d6 \u89e6\u6478\u7684\u5750\u6807\uff0c\u7136\u540e\u7528\u00a0CGRectContainsPoint \u624b\u6307\u662f\u5426\u7ecf\u8fc7UIButton\uff0c\u5982\u679c\u7ecf\u8fc7\u6309\u94ae\uff0c\u5c31\u66f4\u6362\u6309\u94ae\u7684\u56fe\u7247\uff0c\u540c\u65f6 \u4fdd\u5b58\u5212\u8fc7\u6309\u94ae\u7684tag\u3002<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b \u8df3\u8dc3\u8fde\u7ebf\u7b2c1\u4e2a\u548c\u7b2c3\u4e2a\u8282\u70b9\uff0c\u4e2d\u95f4\u7684\u7b2c2\u4e2a\u8282\u70b9 \u4f1a\u88ab\u5ffd\u7565\uff0c\u6240\u4ee5\u8981\u5355\u72ec\u8fdb\u884c\u5904\u7406\u3002\u6839\u636e\u8fde\u7ebf \u6700\u540e2\u4e2aUIButton\u7684\u5750\u6807 \u8ba1\u7b97\u51fa\u7b2c1\u4e2a\u548c\u7b2c3\u4e2a\u8282\u70b9\u00a0\u4e2d\u95f4\u7684\u5750\u6807\uff0c\u5224\u65ad\u8be5\u5750\u6807\u662f\u5426\u5b58\u5728UIButton\uff0c\u5982\u679c\u5b58\u5728\u5c31\u52a0\u5165\u8bbe\u7f6e\u9009\u4e2d\uff0c\u5e76\u52a0\u5165\u9009\u4e2d\u6570\u7ec4\u3002<\/p>\n<p>\u5230\u8fd9\u91cc \u5c31\u5df2\u7ecf\u5b9e\u73b0\u4e86 \u624b\u6307\u6ed1\u8fc7 \u8282\u70b9\u7684\u65f6\u5019 \u8282\u70b9\u88ab\u9009\u4e2d\u7684\u6548\u679c\uff1a<\/p>\n<p>\/\/ MARK: &#8211; Override<br \/>\n\/\/ \u5f53\u624b\u6307\u63a5\u89e6\u5c4f\u5e55\u65f6\uff0c\u5c31\u4f1a\u8c03\u7528touchesBegan:withEvent\u65b9\u6cd5\uff1b<br \/>\noverride func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {<br \/>\nprint(&#8220;\u6267\u884ctouchesBegan&#8221;)<br \/>\nselectBtnTagArray.removeAll()<br \/>\ntouchesChange(touches)<br \/>\n}<\/p>\n<p>\/\/\u5f53\u624b\u6307\u5728\u5c4f\u5e55\u4e0a\u79fb\u52a8\u65f6\uff0c\u8c03\u7528touchesMoved:withEvent\u65b9\u6cd5\uff1b<br \/>\noverride func touchesMoved(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {<br \/>\ntouchesChange(touches)<br \/>\n}<\/p>\n<p>\/\/\u5f53\u89e6\u6478\u88ab\u53d6\u6d88\uff08\u6bd4\u5982\u89e6\u6478\u8fc7\u7a0b\u4e2d\u88ab\u6765\u7535\u6253\u65ad\uff09\uff0c\u5c31\u4f1a\u8c03\u7528touchesCancelled:withEvent\u65b9\u6cd5\u3002<br \/>\noverride func touchesCancelled(touches: Set&lt;UITouch&gt;?, withEvent event: UIEvent?) {<\/p>\n<p>}<br \/>\n\/\/\u5f53\u624b\u6307\u79bb\u5f00\u5c4f\u5e55\u65f6\uff0c\u5c31\u4f1a\u8c03\u7528touchesEnded:withEvent\u65b9\u6cd5\uff1b<br \/>\noverride func touchesEnded(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {<br \/>\nprint(&#8220;\u6267\u884ctouchesEnded&#8221;)<br \/>\nvar alertTitle = &#8220;\u8bf7\u8bbe\u7f6e\u6b63\u786e\u7684\u624b\u52bf&#8221;<br \/>\nvar alertMessage = &#8220;\u624b\u52bf\u5bc6\u7801\u4e0d\u80fd\u5c11\u4e8e4\u4e2a&#8221;<br \/>\nvar isSuccess = false<\/p>\n<p>if selectBtnTagArray.count &gt;= 4 {<br \/>\nalertTitle = &#8220;\u624b\u52bf\u5bc6\u7801\u8bbe\u7f6e\u6210\u529f&#8221;<br \/>\nisSuccess = true<br \/>\nalertMessage = &#8220;\u5bc6\u7801\u4e3a\uff1a\\(selectBtnTagArray)&#8221;<br \/>\n}<\/p>\n<p>gestureLockDelegate!.gestureLockSuccess(isSuccess, title: alertTitle, message: alertMessage)<\/p>\n<p>gesturePoint = CGPointZero;<br \/>\nself.setNeedsDisplay()<br \/>\n}<\/p>\n<p>\/\/ MARK: &#8211; PrivateMethod<br \/>\nprivate func initButtons() {<br \/>\nfor i in 0&#8230;8 {<br \/>\n\/\/\u7b2c\u51e0\u884c<br \/>\nlet row = i \/ 3<br \/>\nlet loc = i % 3<\/p>\n<p>\/\/\u4e24\u4e2abutton\u7684\u95f4\u8ddd<br \/>\nlet btnSpace = (screenWidth &#8211; 3*btnWH)\/4<br \/>\nlet btnX = btnSpace + (btnWH + btnSpace) * CGFloat(loc)<br \/>\nlet btnY = 70 + btnSpace + (btnWH + btnSpace) * CGFloat(row)<\/p>\n<p>let gestureNodeBtn = UIButton(frame:CGRectMake(btnX, btnY, btnWH, btnWH))<br \/>\ngestureNodeBtn.tag = i<br \/>\ngestureNodeBtn.userInteractionEnabled = false \/\/\u4e0d\u54cd\u5e94\u7528\u6237\u7684\u4ea4\u4e92\u3002\u4e00\u5b9a\u8981\u52a0\u4e0a\u8fd9\u53e5<br \/>\ngestureNodeBtn.setImage(UIImage(named: btnImgNormal), forState: .Normal)<br \/>\nself.addSubview(gestureNodeBtn)<br \/>\nbtnArray.append(gestureNodeBtn)<br \/>\n}<br \/>\n}<\/p>\n<p>private func touchesChange(touches: Set&lt;UITouch&gt;) {<br \/>\n\/\/\u83b7\u53d6 \u89e6\u6478\u5bf9\u8c61 ,\u89e6\u6478\u5bf9\u8c61\u7684\u4f4d\u7f6e\u5750\u6807\u6765\u5b9e\u73b0<br \/>\ngesturePoint = touches.first!.locationInView(self)<\/p>\n<p>for btn in btnArray {<br \/>\n\/\/\u5224\u65ad \u624b\u6307\u7684\u5750\u6807 \u662f\u5426\u5728 button\u7684\u5750\u6807\u91cc<br \/>\nif !selectBtnTagArray.contains(btn.tag) &amp;&amp; CGRectContainsPoint(btn.frame, gesturePoint) {<br \/>\n\/\/\u5904\u7406\u8df3\u8dc3\u8fde\u7ebf<br \/>\nvar lineCenterPoint:CGPoint = CGPoint()<\/p>\n<p>if selectBtnTagArray.count &gt; 0 {<br \/>\nlineCenterPoint = centerPoint(btn.frame.origin, endPoint: btnArray[selectBtnTagArray.last!].frame.origin)<br \/>\n}<\/p>\n<p>\/\/\u4fdd\u5b58\u4e2d\u95f4\u8df3\u8dc3 \u8fc7\u7684\u8282\u70b9<br \/>\nfor btn in btnArray {<br \/>\nif !selectBtnTagArray.contains(btn.tag) &amp;&amp; CGRectContainsPoint(btn.frame, lineCenterPoint) {<br \/>\nbtn.setImage(UIImage(named: btnImgSelected), forState: .Normal)<br \/>\nselectBtnTagArray.append(btn.tag)<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/\u4fdd\u5b58\u5212\u8fc7\u7684\u6309\u94ae\u7684tag<br \/>\nselectBtnTagArray.append(btn.tag)<br \/>\nbtn.setImage(UIImage(named: btnImgSelected), forState: .Normal)<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/setNeedsDisplay\u4f1a\u81ea\u52a8\u8c03\u7528drawRect\u65b9\u6cd5 \u8fdb\u884c\u753b\u7ebf<br \/>\nself.setNeedsDisplay()<br \/>\n}<\/p>\n<p>\/\/\u8ba1\u7b972\u4e2a\u8282\u70b9\u4e2d\u5fc3\u7684\u5750\u6807<br \/>\nprivate func centerPoint(startPoint: CGPoint, endPoint:CGPoint) -&gt; CGPoint {<br \/>\nlet rightPoint = startPoint.x &gt; endPoint.x ? startPoint.x : endPoint.x<br \/>\nlet leftPoint = startPoint.x &lt; endPoint.x ? startPoint.x : endPoint.x<\/p>\n<p>let topPoint = startPoint.y &gt; endPoint.y ? startPoint.y : endPoint.y<br \/>\nlet bottomPoint = startPoint.y &lt; endPoint.y ? startPoint.y : endPoint.y<\/p>\n<p>\/\/x\u5750\u6807\uff1a leftPoint +\uff08rightPoint-leftPoint)\/2 = (rightPoint+leftPoint)\/2<br \/>\nreturn CGPointMake((rightPoint + leftPoint)\/2 + btnWH\/2, (topPoint + bottomPoint)\/2 + btnWH\/2);<br \/>\n}<\/p>\n<p>func recoverNodeStatus() {<br \/>\nselectBtnTagArray.removeAll()<br \/>\nfor btn in btnArray {<br \/>\nbtn.setImage(UIImage(named: btnImgNormal), forState: .Normal)<br \/>\n}<br \/>\nself.setNeedsDisplay()<br \/>\n}<\/p>\n<div class=\"cnblogs_code\"><\/div>\n<p>&nbsp;<\/p>\n<p>2\u3001\u753b\u7ebf\uff1a\u5728drawRect\u65b9\u6cd5\u4e2d\u8fdb\u884c\u753b\u7ebf\u3002<\/p>\n<p>override func drawRect(rect: CGRect) {<br \/>\nprint(&#8220;\u6267\u884cdrawRect&#8221;)<br \/>\nlet context = UIGraphicsGetCurrentContext() \/\/\u83b7\u53d6\u753b\u7b14\u4e0a\u4e0b\u6587<\/p>\n<p>var i = 0<br \/>\nfor tag in selectBtnTagArray {<br \/>\nif (0 == i) {<br \/>\n\/\/\u5f00\u59cb\u753b\u7ebf,\u8bbe\u7f6e\u76f4\u7ebf\u7684\u8d77\u70b9\u5750\u6807<br \/>\nCGContextMoveToPoint(context, btnArray[tag].center.x, btnArray[tag].center.y)<br \/>\n} else {<br \/>\n\/\/\u753b\u76f4\u7ebf,\u8bbe\u7f6e\u76f4\u7ebf\u7684\u7ec8\u70b9\u5750\u6807<br \/>\nCGContextAddLineToPoint(context, btnArray[tag].center.x,btnArray[tag].center.y)<br \/>\n}<br \/>\ni = i+1<br \/>\n}<\/p>\n<p>\/\/\u5982\u679c\u6709\u9009\u4e2d\u7684\u8282\u70b9\uff0c\u5c31\u53d6 \u8ddf\u7740 \u624b\u6307\u7684\u6ed1\u52a8 \u753b\u7ebf<br \/>\nif (selectBtnTagArray.count &gt; 0) {<br \/>\n\/\/ \u79fb\u9664\u6700\u540e\u4e00\u6761\u591a\u4f59\u7684\u7ebf\uff0c<br \/>\nif gesturePoint != CGPointZero {<br \/>\nCGContextAddLineToPoint(context, gesturePoint.x, gesturePoint.y)<br \/>\n}<br \/>\n}<\/p>\n<p>CGContextSetLineWidth(context, 10) \/\/\u8bbe\u7f6e\u753b\u7b14\u5bbd\u5ea6<br \/>\nCGContextSetLineJoin(context, .Round) \/\/\u4e24\u4e2a\u7ebf\u76f8\u4ea4\u70b9 \u5e73\u6ed1\u5904\u7406<br \/>\nCGContextSetLineCap(context, .Round) \/\/\u8bbe\u7f6e\u7ebf\u6761\u4e24\u7aef\u7684\u6837\u5f0f\u4e3a\u5706\u89d2<br \/>\nCGContextSetRGBStrokeColor(context, 227\/255.0, 54\/255.0, 58\/255.0, 1)<br \/>\nCGContextStrokePath(context) \/\/ \/\/\u5bf9\u7ebf\u6761\u8fdb\u884c\u6e32\u67d3<br \/>\n}<\/p>\n<div class=\"cnblogs_code\"><\/div>\n<p>&nbsp;<\/p>\n<p>Demo\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/bugaoshuni\/TouchIDAndGestureLock\">https:\/\/github.com\/bugaoshuni\/TouchIDAndGestureLock<\/a><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div id=\"MySignature\">\u4f5c\u8005\uff1a<a href=\"http:\/\/www.cnblogs.com\/dahe007\/\" target=\"_blank\">\u4e91\u7aef\u4e4b\u5dc5<\/a><br \/>\n\u51fa\u5904\uff1a<a href=\"http:\/\/www.cnblogs.com\/dahe007\/\" target=\"_blank\">http:\/\/www.cnblogs.com\/dahe007\/<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6307\u7eb9\u9a8c\u8bc1 iPhone \u7684Home\u952e \u4e0a\u7684\u91d1\u5c5e\u73af \u80fd\u611f\u5e94\u624b\u6307\uff0c\u901a\u77e5Touch &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/1086.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1087,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[197],"class_list":["post-1086","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-ios"],"views":4021,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=1086"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/1086\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media\/1087"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}