{"id":533,"date":"2018-02-23T23:39:03","date_gmt":"2018-02-23T15:39:03","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/23\/swift-%e5%87%bd%e6%95%b0\/"},"modified":"2018-02-23T23:39:03","modified_gmt":"2018-02-23T15:39:03","slug":"swift-%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=533","title":{"rendered":"Swift \u51fd\u6570"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>Swift \u51fd\u6570<\/h1>\n<p>Swift \u51fd\u6570\u7528\u6765\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u72ec\u7acb\u7684\u4ee3\u7801\u5757\u3002<\/p>\n<p>Swift\u4f7f\u7528\u4e00\u4e2a\u7edf\u4e00\u7684\u8bed\u6cd5\u6765\u8868\u793a\u7b80\u5355\u7684C\u8bed\u8a00\u98ce\u683c\u7684\u51fd\u6570\u5230\u590d\u6742\u7684Objective-C\u8bed\u8a00\u98ce\u683c\u7684\u65b9\u6cd5\u3002<\/p>\n<ul>\n<li>\n<p> \u51fd\u6570\u58f0\u660e: \u544a\u8bc9\u7f16\u8bd1\u5668\u51fd\u6570\u7684\u540d\u5b57\uff0c\u8fd4\u56de\u7c7b\u578b\u53ca\u53c2\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\t\u51fd\u6570\u5b9a\u4e49: \u63d0\u4f9b\u4e86\u51fd\u6570\u7684\u5b9e\u4f53\u3002<\/p>\n<\/li>\n<\/ul>\n<p>Swift \u51fd\u6570\u5305\u542b\u4e86\u53c2\u6570\u7c7b\u578b\u53ca\u8fd4\u56de\u503c\u7c7b\u578b\uff1a<\/p>\n<hr>\n<h2>\u51fd\u6570\u5b9a\u4e49<\/h2>\n<p>Swift \u5b9a\u4e49\u51fd\u6570\u4f7f\u7528\u5173\u952e\u5b57 <b>func<\/b>\u3002<\/p>\n<p>\u5b9a\u4e49\u51fd\u6570\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u6216\u591a\u4e2a\u8f93\u5165\u53c2\u6570\u548c\u4e00\u4e2a\u8fd4\u56de\u503c\u7c7b\u578b\u3002<\/p>\n<p>\u6bcf\u4e2a\u51fd\u6570\u90fd\u6709\u4e00\u4e2a\u51fd\u6570\u540d\u6765\u63cf\u8ff0\u5b83\u7684\u529f\u80fd\u3002\u901a\u8fc7\u51fd\u6570\u540d\u4ee5\u53ca\u5bf9\u5e94\u7c7b\u578b\u7684\u53c2\u6570\u503c\u6765\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\u3002\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u53c2\u6570\u5217\u8868\u76f8\u540c\u3002<\/p>\n<p>\u51fd\u6570\u7684\u5b9e\u53c2\u4f20\u9012\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u5f62\u53c2\u5217\u8868\u76f8\u540c\uff0c<b>-&gt;<\/b> \u540e\u5b9a\u4e49\u51fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b\u3002<\/p>\n<h3>\u8bed\u6cd5<\/h3>\n<pre>\nfunc funcname(\u5f62\u53c2) -&gt; returntype\n{\n   Statement1\n   Statement2\n   \u2026\u2026\n   Statement N\n   return parameters\n}\n<\/pre>\n<h3>\u5b9e\u4f8b<\/h3>\n<p>\u4ee5\u4e0b\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u51fd\u6570\u540d\u4e3a runoob \u7684\u51fd\u6570\uff0c\u5f62\u53c2\u7684\u6570\u636e\u7c7b\u578b\u4e3a String\uff0c\u8fd4\u56de\u503c\u4e5f\u4e3a String\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc runoob(site: String) -&gt; String {\n    return (site)\n}\nprint(runoob(site: \"www.runoob.com\"))\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\nwww.runoob.com\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u8c03\u7528<\/h2>\n<p>\n\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u51fd\u6570\u540d\u4ee5\u53ca\u5bf9\u5e94\u7c7b\u578b\u7684\u53c2\u6570\u503c\u6765\u8c03\u7528\u51fd\u6570\uff0c\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u53c2\u6570\u5217\u8868\u76f8\u540c\u3002<\/p>\n<p>\u4ee5\u4e0b\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u51fd\u6570\u540d\u4e3a runoob \u7684\u51fd\u6570\uff0c\u5f62\u53c2 site \u7684\u6570\u636e\u7c7b\u578b\u4e3a String\uff0c\u4e4b\u540e\u6211\u4eec\u8c03\u7528\u51fd\u6570\u4f20\u9012\u7684\u5b9e\u53c2\u4e5f\u5fc5\u987b String \u7c7b\u578b\uff0c\u5b9e\u53c2\u4f20\u5165\u51fd\u6570\u4f53\u540e\uff0c\u5c06\u76f4\u63a5\u8fd4\u56de\uff0c\u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b\u4e3a String\u3002<\/p>\n<pre>\nimport Cocoa\n\nfunc runoob(site: String) -&gt; String {\n    return (site)\n}\nprint(runoob(site: \"www.runoob.com\"))\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\nwww.runoob.com\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u53c2\u6570<\/h2>\n<p>\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u88ab\u5305\u542b\u5728\u51fd\u6570\u7684\u62ec\u53f7\u4e4b\u4e2d\uff0c\u4ee5\u9017\u53f7\u5206\u9694\u3002<\/p>\n<p>\u4ee5\u4e0b\u5b9e\u4f8b\u5411\u51fd\u6570 runoob \u4f20\u9012\u7ad9\u70b9\u540d name \u548c\u7ad9\u70b9\u5730\u5740 site\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc runoob(name: String, site: String) -&gt; String {\n    return name + site\n}\nprint(runoob(name: \"\u83dc\u9e1f\u6559\u7a0b\uff1a\", site: \"www.runoob.com\"))\nprint(runoob(name: \"Google\uff1a\", site: \"www.google.com\"))\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u83dc\u9e1f\u6559\u7a0b\uff1awww.runoob.com\nGoogle\uff1awww.google.com\n<\/pre>\n<hr>\n<h2>\u4e0d\u5e26\u53c2\u6570\u51fd\u6570<\/h2>\n<p>\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e0d\u5e26\u53c2\u6570\u7684\u51fd\u6570\u3002<\/p>\n<h3>\u8bed\u6cd5\uff1a<\/h3>\n<pre>\nfunc funcname() -&gt; datatype {\n   return datatype\n}\n<\/pre>\n<h3>\u5b9e\u4f8b<\/h3>\n<pre>\nimport Cocoa\n\nfunc sitename() -&gt; String {\n    return \"\u83dc\u9e1f\u6559\u7a0b\"\n}\nprint(sitename())\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u83dc\u9e1f\u6559\u7a0b\n<\/pre>\n<hr>\n<h2>\u5143\u7ec4\u4f5c\u4e3a\u51fd\u6570\u8fd4\u56de\u503c<\/h2>\n<p>\u51fd\u6570\u8fd4\u56de\u503c\u7c7b\u578b\u53ef\u4ee5\u662f\u5b57\u7b26\u4e32\uff0c\u6574\u578b\uff0c\u6d6e\u70b9\u578b\u7b49\u3002<\/p>\n<p>\u5143\u7ec4\u4e0e\u6570\u7ec4\u7c7b\u4f3c\uff0c\u4e0d\u540c\u7684\u662f\uff0c\u5143\u7ec4\u4e2d\u7684\u5143\u7d20\u53ef\u4ee5\u662f\u4efb\u610f\u7c7b\u578b\uff0c\u4f7f\u7528\u7684\u662f\u5706\u62ec\u53f7\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u7528\u5143\u7ec4\uff08tuple\uff09\u7c7b\u578b\u8ba9\u591a\u4e2a\u503c\u4f5c\u4e3a\u4e00\u4e2a\u590d\u5408\u503c\u4ece\u51fd\u6570\u4e2d\u8fd4\u56de\u3002<\/p>\n<p>\u4e0b\u9762\u7684\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2a\u540d\u4e3aminMax(_:)\u7684\u51fd\u6570\uff0c\u4f5c\u7528\u662f\u5728\u4e00\u4e2aInt\u6570\u7ec4\u4e2d\u627e\u51fa\u6700\u5c0f\u503c\u4e0e\u6700\u5927\u503c\u3002<\/p>\n<pre>\nimport Cocoa\n\nfunc minMax(array: [Int]) -&gt; (min: Int, max: Int) {\n    var currentMin = array[0]\n    var currentMax = array[0]\n    for value in array[1..&lt;array.count] {\n        if value &lt; currentMin {\n            currentMin = value\n        } else if value &gt; currentMax {\n            currentMax = value\n        }\n    }\n    return (currentMin, currentMax)\n}\n\nlet bounds = minMax(array: [8, -6, 2, 109, 3, 71])\nprint(\"\u6700\u5c0f\u503c\u4e3a \\(bounds.min) \uff0c\u6700\u5927\u503c\u4e3a \\(bounds.max)\")\n<\/pre>\n<p>minMax(_:)\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u4e24\u4e2aInt\u503c\u7684\u5143\u7ec4\uff0c\u8fd9\u4e9b\u503c\u88ab\u6807\u8bb0\u4e3amin\u548cmax\uff0c\u4ee5\u4fbf\u67e5\u8be2\u51fd\u6570\u7684\u8fd4\u56de\u503c\u65f6\u53ef\u4ee5\u901a\u8fc7\u540d\u5b57\u8bbf\u95ee\u5b83\u4eec\u3002<\/p>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u6700\u5c0f\u503c\u4e3a -6 \uff0c\u6700\u5927\u503c\u4e3a 109\n<\/pre>\n<p>\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u8fd4\u56de\u7684\u5143\u7ec4\u4e00\u5b9a\u4e0d\u4e3anil\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a\u53ef\u9009\u7684\u5143\u7ec4\u7c7b\u578b\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728\u5143\u7ec4\u7c7b\u578b\u7684\u53f3\u62ec\u53f7\u540e\u653e\u7f6e\u4e00\u4e2a\u95ee\u53f7\u6765\u5b9a\u4e49\u4e00\u4e2a\u53ef\u9009\u5143\u7ec4\uff0c\u4f8b\u5982(Int, Int)?\u6216(String, Int, Bool)?<\/p>\n<blockquote>\n<p>\u6ce8\u610f<br \/>\n\u53ef\u9009\u5143\u7ec4\u7c7b\u578b\u5982<code>(Int, Int)?<\/code>\u4e0e\u5143\u7ec4\u5305\u542b\u53ef\u9009\u7c7b\u578b\u5982<code>(Int?, Int?)<\/code>\u662f\u4e0d\u540c\u7684.\u53ef\u9009\u7684\u5143\u7ec4\u7c7b\u578b\uff0c\u6574\u4e2a\u5143\u7ec4\u662f\u53ef\u9009\u7684\uff0c\u800c\u4e0d\u53ea\u662f\u5143\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u503c\u3002<\/p>\n<\/blockquote>\n<p>\u524d\u9762\u7684<code>minMax(_:)<\/code>\u51fd\u6570\u8fd4\u56de\u4e86\u4e00\u4e2a\u5305\u542b\u4e24\u4e2a<code>Int<\/code>\u503c\u7684\u5143\u7ec4\u3002\u4f46\u662f\u51fd\u6570\u4e0d\u4f1a\u5bf9\u4f20\u5165\u7684\u6570\u7ec4\u6267\u884c\u4efb\u4f55\u5b89\u5168\u68c0\u67e5\uff0c\u5982\u679c<code>array<\/code>\u53c2\u6570\u662f\u4e00\u4e2a\u7a7a\u6570\u7ec4\uff0c\u5982\u4e0a\u5b9a\u4e49\u7684<code>minMax(_:)<\/code>\u5728\u8bd5\u56fe\u8bbf\u95ee<code>array[0]<\/code>\u65f6\u4f1a\u89e6\u53d1\u4e00\u4e2a\u8fd0\u884c\u65f6\u9519\u8bef\u3002<\/p>\n<p>\u4e3a\u4e86\u5b89\u5168\u5730\u5904\u7406\u8fd9\u4e2a&#8221;\u7a7a\u6570\u7ec4&#8221;\u95ee\u9898\uff0c\u5c06<code>minMax(_:)<\/code>\u51fd\u6570\u6539\u5199\u4e3a\u4f7f\u7528\u53ef\u9009\u5143\u7ec4\u8fd4\u56de\u7c7b\u578b\uff0c\u5e76\u4e14\u5f53\u6570\u7ec4\u4e3a\u7a7a\u65f6\u8fd4\u56de<code>nil<\/code>\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc minMax(array: [Int]) -&gt; (min: Int, max: Int)? {\n    if array.isEmpty { return nil }\n    var currentMin = array[0]\n    var currentMax = array[0]\n    for value in array[1..&lt;array.count] {\n        if value &lt; currentMin {\n            currentMin = value\n        } else if value &gt; currentMax {\n            currentMax = value\n        }\n    }\n    return (currentMin, currentMax)\n}\nif let bounds = minMax(array: [8, -6, 2, 109, 3, 71]) {\n    print(\"\u6700\u5c0f\u503c\u4e3a \\(bounds.min)\uff0c\u7ec4\u5927\u503c\u4e3a \\(bounds.max)\")\n}\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u6700\u5c0f\u503c\u4e3a -6\uff0c\u7ec4\u5927\u503c\u4e3a 109\n<\/pre>\n<hr>\n<h2>\u6ca1\u6709\u8fd4\u56de\u503c\u51fd\u6570<\/h2>\n<p>\u4e0b\u9762\u662f runoob(_:) \u51fd\u6570\u7684\u53e6\u4e00\u4e2a\u7248\u672c\uff0c\u8fd9\u4e2a\u51fd\u6570\u63a5\u6536\u83dc\u9e1f\u6559\u7a0b\u5b98\u7f51\u7f51\u5740\u53c2\u6570\uff0c\u6ca1\u6709\u6307\u5b9a\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5e76\u76f4\u63a5\u8f93\u51fa String \u503c\uff0c\u800c\u4e0d\u662f\u8fd4\u56de\u5b83\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc runoob(site: String) {\n    print(\"\u83dc\u9e1f\u6559\u7a0b\u5b98\u7f51\uff1a\\(site)\")\n}\nrunoob(site: \"http:\/\/www.runoob.com\")\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u83dc\u9e1f\u6559\u7a0b\u5b98\u7f51\uff1ahttp:\/\/www.runoob.com\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u53c2\u6570\u540d\u79f0<\/h2>\n<p>\u51fd\u6570\u53c2\u6570\u90fd\u6709\u4e00\u4e2a\u5916\u90e8\u53c2\u6570\u540d\u548c\u4e00\u4e2a\u5c40\u90e8\u53c2\u6570\u540d\u3002<\/p>\n<h3>\u5c40\u90e8\u53c2\u6570\u540d<\/h3>\n<p>\u5c40\u90e8\u53c2\u6570\u540d\u5728\u51fd\u6570\u7684\u5b9e\u73b0\u5185\u90e8\u4f7f\u7528\u3002<\/p>\n<pre>\nfunc sample(number: Int) {\n   println(number)\n}\n<\/pre>\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u4e2d number \u4e3a\u5c40\u90e8\u53c2\u6570\u540d\uff0c\u53ea\u80fd\u5728\u51fd\u6570\u4f53\u5185\u4f7f\u7528\u3002<\/p>\n<pre>\nimport Cocoa\n\nfunc sample(number: Int) {\n    print(number)\n}\nsample(number: 1)\nsample(number: 2)\nsample(number: 3)\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n1\n2\n3\n<\/pre>\n<h3>\u5916\u90e8\u53c2\u6570\u540d<\/h3>\n<p>\u4f60\u53ef\u4ee5\u5728\u5c40\u90e8\u53c2\u6570\u540d\u524d\u6307\u5b9a\u5916\u90e8\u53c2\u6570\u540d\uff0c\u4e2d\u95f4\u4ee5\u7a7a\u683c\u5206\u9694\uff0c\u5916\u90e8\u53c2\u6570\u540d\u7528\u4e8e\u5728\u51fd\u6570\u8c03\u7528\u65f6\u4f20\u9012\u7ed9\u51fd\u6570\u7684\u53c2\u6570\u3002<\/p>\n<p>\u5982\u4e0b\u4f60\u53ef\u4ee5\u5b9a\u4e49\u4ee5\u4e0b\u4e24\u4e2a\u51fd\u6570\u53c2\u6570\u540d\u5e76\u8c03\u7528\u5b83\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc pow(firstArg a: Int, secondArg b: Int) -&gt; Int {\n   var res = a\n   for _ in 1..&lt;b {\n      res = res * a\n   }\n   print(res)\n   return res\n}\npow(firstArg:5, secondArg:3)\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>125\n<\/pre>\n<blockquote>\n<p>\u6ce8\u610f<br \/>\n\u5982\u679c\u4f60\u63d0\u4f9b\u4e86\u5916\u90e8\u53c2\u6570\u540d\uff0c\u90a3\u4e48\u51fd\u6570\u5728\u88ab\u8c03\u7528\u65f6\uff0c\u5fc5\u987b\u4f7f\u7528\u5916\u90e8\u53c2\u6570\u540d\u3002<\/p>\n<\/blockquote>\n<hr>\n<h2>\u53ef\u53d8\u53c2\u6570<\/h2>\n<p>\u53ef\u53d8\u53c2\u6570\u53ef\u4ee5\u63a5\u53d7\u96f6\u4e2a\u6216\u591a\u4e2a\u503c\u3002\u51fd\u6570\u8c03\u7528\u65f6\uff0c\u4f60\u53ef\u4ee5\u7528\u53ef\u53d8\u53c2\u6570\u6765\u6307\u5b9a\u51fd\u6570\u53c2\u6570\uff0c\u5176\u6570\u91cf\u662f\u4e0d\u786e\u5b9a\u7684\u3002<\/p>\n<p>\u53ef\u53d8\u53c2\u6570\u901a\u8fc7\u5728\u53d8\u91cf\u7c7b\u578b\u540d\u540e\u9762\u52a0\u5165\uff08&#8230;\uff09\u7684\u65b9\u5f0f\u6765\u5b9a\u4e49\u3002<\/p>\n<pre>\nimport Cocoa\n\nfunc vari&lt;N&gt;(members: N...){\n    for i in members {\n        print(i)\n    }\n}\nvari(members: 4,3,5)\nvari(members: 4.5, 3.1, 5.6)\nvari(members: \"Google\", \"Baidu\", \"Runoob\")\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n4\n3\n5\n4.5\n3.1\n5.6\nGoogle\nBaidu\nRunoob\n<\/pre>\n<hr>\n<h2>\u5e38\u91cf\uff0c\u53d8\u91cf\u53ca I\/O \u53c2\u6570<\/h2>\n<p>\n\u4e00\u822c\u9ed8\u8ba4\u5728\u51fd\u6570\u4e2d\u5b9a\u4e49\u7684\u53c2\u6570\u90fd\u662f\u5e38\u91cf\u53c2\u6570\uff0c\u4e5f\u5c31\u662f\u8fd9\u4e2a\u53c2\u6570\u4f60\u53ea\u53ef\u4ee5\u67e5\u8be2\u4f7f\u7528\uff0c\u4e0d\u80fd\u6539\u53d8\u5b83\u7684\u503c\u3002\n<\/p>\n<p>\u5982\u679c\u60f3\u8981\u58f0\u660e\u4e00\u4e2a\u53d8\u91cf\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u53c2\u6570\u5b9a\u4e49\u524d\u52a0 inout \u5173\u952e\u5b57\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e2a\u53c2\u6570\u7684\u503c\u4e86\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>\nfunc  getName(_ name: inout String).........\n<\/pre>\n<p>\u6b64\u65f6\u8fd9\u4e2a name \u503c\u53ef\u4ee5\u5728\u51fd\u6570\u4e2d\u6539\u53d8\u3002<\/p>\n<p>\u4e00\u822c\u9ed8\u8ba4\u7684\u53c2\u6570\u4f20\u9012\u90fd\u662f\u4f20\u503c\u8c03\u7528\u7684\uff0c\u800c\u4e0d\u662f\u4f20\u5f15\u7528\u3002\u6240\u4ee5\u4f20\u5165\u7684\u53c2\u6570\u5728\u51fd\u6570\u5185\u6539\u53d8\uff0c\u5e76\u4e0d\u5f71\u54cd\u539f\u6765\u7684\u90a3\u4e2a\u53c2\u6570\u3002\u4f20\u5165\u7684\u53ea\u662f\u8fd9\u4e2a\u53c2\u6570\u7684\u526f\u672c\u3002<\/p>\n<p>\u5f53\u4f20\u5165\u7684\u53c2\u6570\u4f5c\u4e3a\u8f93\u5165\u8f93\u51fa\u53c2\u6570\u65f6\uff0c\u9700\u8981\u5728\u53c2\u6570\u540d\u524d\u52a0 &amp; \u7b26\uff0c\u8868\u793a\u8fd9\u4e2a\u503c\u53ef\u4ee5\u88ab\u51fd\u6570\u4fee\u6539\u3002<\/p>\n<h3>\u5b9e\u4f8b<\/h3>\n<pre>\nimport Cocoa\n\nfunc swapTwoInts(_ a: inout Int, _ b: inout Int) {\n    let temporaryA = a\n    a = b\n    b = temporaryA\n}\n\n\nvar x = 1\nvar y = 5\nswapTwoInts(&amp;x, &amp;y)\nprint(\"x \u73b0\u5728\u7684\u503c \\(x), y \u73b0\u5728\u7684\u503c \\(y)\")\n<\/pre>\n<p>swapTwoInts(_:_:) \u51fd\u6570\u7b80\u5355\u5730\u4ea4\u6362 a \u4e0e b \u7684\u503c\u3002\u8be5\u51fd\u6570\u5148\u5c06 a \u7684\u503c\u5b58\u5230\u4e00\u4e2a\u4e34\u65f6\u5e38\u91cf temporaryA \u4e2d\uff0c\u7136\u540e\u5c06 b \u7684\u503c\u8d4b\u7ed9 a\uff0c\u6700\u540e\u5c06 temporaryA \u8d4b\u503c\u7ed9 b\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0csomeInt \u548c anotherInt \u5728\u4f20\u5165 swapTwoInts(_:_:) \u51fd\u6570\u524d\uff0c\u90fd\u52a0\u4e86 &amp; \u7684\u524d\u7f00\u3002<\/p>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\nx \u73b0\u5728\u7684\u503c 5, y \u73b0\u5728\u7684\u503c 1\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u7c7b\u578b\u53ca\u4f7f\u7528<\/h2>\n<p>\u6bcf\u4e2a\u51fd\u6570\u90fd\u6709\u79cd\u7279\u5b9a\u7684\u51fd\u6570\u7c7b\u578b\uff0c\u7531\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u548c\u8fd4\u56de\u7c7b\u578b\u7ec4\u6210\u3002<\/p>\n<pre>\nfunc inputs(no1: Int, no2: Int) -&gt; Int {\n   return no1\/no2\n}\n<\/pre>\n<p>inputs \u51fd\u6570\u7c7b\u578b\u6709\u4e24\u4e2a Int \u578b\u7684\u53c2\u6570(no1\u3001no2)\u5e76\u8fd4\u56de\u4e00\u4e2a Int \u578b\u7684\u503c\u3002<\/p>\n<p>\u5b9e\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc inputs(no1: Int, no2: Int) -&gt; Int {\n    return no1\/no2\n}\nprint(inputs(no1: 20, no2: 10))\nprint(inputs(no1: 36, no2: 6))\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n2\n6\n<\/pre>\n<p>\u4ee5\u4e0a\u51fd\u6570\u5b9a\u4e49\u4e86\u4e24\u4e2a Int  \u53c2\u6570\u7c7b\u578b\uff0c\u8fd4\u56de\u503c\u4e5f\u4e3a Int \u7c7b\u578b\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u770b\u4e0b\u5982\u4e0b\u51fd\u6570\uff0c\u51fd\u6570\u5b9a\u4e49\u4e86\u53c2\u6570\u4e3a String \u7c7b\u578b\uff0c\u8fd4\u56de\u503c\u4e3a String \u7c7b\u578b\u3002<\/p>\n<pre>\nfunc inputstr(name: String) -&gt; String {\n   return name\n}\n<\/pre>\n<p>\u51fd\u6570\u4e5f\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u6ca1\u6709\u53c2\u6570\uff0c\u4e5f\u6ca1\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc inputstr() {\n   print(\"\u83dc\u9e1f\u6559\u7a0b\")\n   print(\"www.runoob.com\")\n}\ninputstr()\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u83dc\u9e1f\u6559\u7a0b\nwww.runoob.com\n<\/pre>\n<h3>\u4f7f\u7528\u51fd\u6570\u7c7b\u578b<br \/>\n<\/h3>\n<p>\u5728 Swift \u4e2d\uff0c\u4f7f\u7528\u51fd\u6570\u7c7b\u578b\u5c31\u50cf\u4f7f\u7528\u5176\u4ed6\u7c7b\u578b\u4e00\u6837\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u7c7b\u578b\u4e3a\u51fd\u6570\u7684\u5e38\u91cf\u6216\u53d8\u91cf\uff0c\u5e76\u5c06\u9002\u5f53\u7684\u51fd\u6570\u8d4b\u503c\u7ed9\u5b83\uff1a<\/p>\n<pre>\nvar addition: (Int, Int) -&gt; Int = sum\n<\/pre>\n<p>\u89e3\u6790:<\/p>\n<p>&#8220;\u5b9a\u4e49\u4e00\u4e2a\u53eb\u505a <code>addition<\/code> \u7684\u53d8\u91cf\uff0c\u53c2\u6570\u4e0e\u8fd4\u56de\u503c\u7c7b\u578b\u5747\u662f <code>Int<\/code> \uff0c\u5e76\u8ba9\u8fd9\u4e2a\u65b0\u53d8\u91cf\u6307\u5411 <code>sum<\/code> \u51fd\u6570&#8221;\u3002<\/p>\n<p><code>sum<\/code> \u548c <code>addition<\/code> \u6709\u540c\u6837\u7684\u7c7b\u578b\uff0c\u6240\u4ee5\u4ee5\u4e0a\u64cd\u4f5c\u662f\u5408\u6cd5\u7684\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u7528 addition \u6765\u8c03\u7528\u88ab\u8d4b\u503c\u7684\u51fd\u6570\u4e86\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc sum(a: Int, b: Int) -&gt; Int {\n   return a + b\n}\nvar addition: (Int, Int) -&gt; Int = sum\nprint(\"\u8f93\u51fa\u7ed3\u679c: \\(addition(40, 89))\")\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u8f93\u51fa\u7ed3\u679c: 129\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u7c7b\u578b\u4f5c\u4e3a\u53c2\u6570\u7c7b\u578b\u3001\u51fd\u6570\u7c7b\u578b\u4f5c\u4e3a\u8fd4\u56de\u7c7b\u578b<\/h2>\n<p>\u6211\u4eec\u53ef\u4ee5\u5c06\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u53e6\u5916\u4e00\u4e2a\u53c2\u6570\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc sum(a: Int, b: Int) -&gt; Int {\n    return a + b\n}\nvar addition: (Int, Int) -&gt; Int = sum\nprint(\"\u8f93\u51fa\u7ed3\u679c: \\(addition(40, 89))\")\n\nfunc another(addition: (Int, Int) -&gt; Int, a: Int, b: Int) {\n    print(\"\u8f93\u51fa\u7ed3\u679c: \\(addition(a, b))\")\n}\nanother(addition: sum, a: 10, b: 20)\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n\u8f93\u51fa\u7ed3\u679c: 129\n\u8f93\u51fa\u7ed3\u679c: 30\n<\/pre>\n<hr>\n<h2>\u51fd\u6570\u5d4c\u5957<\/h2>\n<p>\u51fd\u6570\u5d4c\u5957\u6307\u7684\u662f\u51fd\u6570\u5185\u5b9a\u4e49\u4e00\u4e2a\u65b0\u7684\u51fd\u6570\uff0c\u5916\u90e8\u7684\u51fd\u6570\u53ef\u4ee5\u8c03\u7528\u51fd\u6570\u5185\u5b9a\u4e49\u7684\u51fd\u6570\u3002<\/p>\n<p>\u5b9e\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre>\nimport Cocoa\n\nfunc calcDecrement(forDecrement total: Int) -&gt; () -&gt; Int {\n   var overallDecrement = 0\n   func decrementer() -&gt; Int {\n      overallDecrement -= total\n      return overallDecrement\n   }\n   return decrementer\n}\nlet decrem = calcDecrement(forDecrement: 30)\nprint(decrem())\n<\/pre>\n<p>\u4ee5\u4e0a\u7a0b\u5e8f\u6267\u884c\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre>\n-30\n<\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">Swift \u51fd\u6570 Swift \u51fd\u6570\u7528\u6765\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u72ec\u7acb\u7684\u4ee3\u7801\u5757\u3002 Swift\u4f7f\u7528\u4e00\u4e2a\u7edf\u4e00&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=533\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,28],"tags":[74,119],"class_list":["post-533","post","type-post","status-publish","format-standard","hentry","category-mobile","category-swift","tag-ios","tag-swift","zoom-theme-has-thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.puzi7.net\/?p=533\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7\" \/>\n<meta property=\"og:description\" content=\"Swift \u51fd\u6570 Swift \u51fd\u6570\u7528\u6765\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u72ec\u7acb\u7684\u4ee3\u7801\u5757\u3002 Swift\u4f7f\u7528\u4e00\u4e2a\u7edf\u4e00&hellip;Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.puzi7.net\/?p=533\" \/>\n<meta property=\"og:site_name\" content=\"\u8c31\u5b50\u68cb - Puzi7\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-23T15:39:03+00:00\" \/>\n<meta name=\"author\" content=\"\u77f3\u8863\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u77f3\u8863\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533\"},\"author\":{\"name\":\"\u77f3\u8863\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/#\\\/schema\\\/person\\\/87dd4941c8ec260c1350b7f41980a190\"},\"headline\":\"Swift \u51fd\u6570\",\"datePublished\":\"2018-02-23T15:39:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533\"},\"wordCount\":67,\"commentCount\":0,\"keywords\":[\"iOS\",\"Swift\"],\"articleSection\":[\"Mobile\",\"Swift\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.puzi7.net\\\/?p=533#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533\",\"url\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533\",\"name\":\"Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/#website\"},\"datePublished\":\"2018-02-23T15:39:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/#\\\/schema\\\/person\\\/87dd4941c8ec260c1350b7f41980a190\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.puzi7.net\\\/?p=533\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/?p=533#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/www.puzi7.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6280\u672f\",\"item\":\"https:\\\/\\\/www.puzi7.net\\\/?cat=9\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Mobile\",\"item\":\"https:\\\/\\\/www.puzi7.net\\\/?cat=26\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Swift\",\"item\":\"https:\\\/\\\/www.puzi7.net\\\/?cat=28\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Swift \u51fd\u6570\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/#website\",\"url\":\"https:\\\/\\\/www.puzi7.net\\\/\",\"name\":\"\u8c31\u5b50\u68cb - Puzi7\",\"description\":\"\u5206\u4eab\uff0c\u6210\u957f\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.puzi7.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.puzi7.net\\\/#\\\/schema\\\/person\\\/87dd4941c8ec260c1350b7f41980a190\",\"name\":\"\u77f3\u8863\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g\",\"caption\":\"\u77f3\u8863\"},\"sameAs\":[\"https:\\\/\\\/www.puzi7.net\"],\"url\":\"https:\\\/\\\/www.puzi7.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.puzi7.net\/?p=533","og_locale":"zh_CN","og_type":"article","og_title":"Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7","og_description":"Swift \u51fd\u6570 Swift \u51fd\u6570\u7528\u6765\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u72ec\u7acb\u7684\u4ee3\u7801\u5757\u3002 Swift\u4f7f\u7528\u4e00\u4e2a\u7edf\u4e00&hellip;Read More","og_url":"https:\/\/www.puzi7.net\/?p=533","og_site_name":"\u8c31\u5b50\u68cb - Puzi7","article_published_time":"2018-02-23T15:39:03+00:00","author":"\u77f3\u8863","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u77f3\u8863","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.puzi7.net\/?p=533#article","isPartOf":{"@id":"https:\/\/www.puzi7.net\/?p=533"},"author":{"name":"\u77f3\u8863","@id":"https:\/\/www.puzi7.net\/#\/schema\/person\/87dd4941c8ec260c1350b7f41980a190"},"headline":"Swift \u51fd\u6570","datePublished":"2018-02-23T15:39:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.puzi7.net\/?p=533"},"wordCount":67,"commentCount":0,"keywords":["iOS","Swift"],"articleSection":["Mobile","Swift"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.puzi7.net\/?p=533#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.puzi7.net\/?p=533","url":"https:\/\/www.puzi7.net\/?p=533","name":"Swift \u51fd\u6570 - \u8c31\u5b50\u68cb - Puzi7","isPartOf":{"@id":"https:\/\/www.puzi7.net\/#website"},"datePublished":"2018-02-23T15:39:03+00:00","author":{"@id":"https:\/\/www.puzi7.net\/#\/schema\/person\/87dd4941c8ec260c1350b7f41980a190"},"breadcrumb":{"@id":"https:\/\/www.puzi7.net\/?p=533#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.puzi7.net\/?p=533"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.puzi7.net\/?p=533#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.puzi7.net\/"},{"@type":"ListItem","position":2,"name":"\u6280\u672f","item":"https:\/\/www.puzi7.net\/?cat=9"},{"@type":"ListItem","position":3,"name":"Mobile","item":"https:\/\/www.puzi7.net\/?cat=26"},{"@type":"ListItem","position":4,"name":"Swift","item":"https:\/\/www.puzi7.net\/?cat=28"},{"@type":"ListItem","position":5,"name":"Swift \u51fd\u6570"}]},{"@type":"WebSite","@id":"https:\/\/www.puzi7.net\/#website","url":"https:\/\/www.puzi7.net\/","name":"\u8c31\u5b50\u68cb - Puzi7","description":"\u5206\u4eab\uff0c\u6210\u957f","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.puzi7.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.puzi7.net\/#\/schema\/person\/87dd4941c8ec260c1350b7f41980a190","name":"\u77f3\u8863","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/secure.gravatar.com\/avatar\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c52c3a64b447af78e58cfa1c73ddd53952049afcf934cd702d71eee91f9907bd?s=96&d=mm&r=g","caption":"\u77f3\u8863"},"sameAs":["https:\/\/www.puzi7.net"],"url":"https:\/\/www.puzi7.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=533"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/533\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}