{"id":1376,"date":"2017-02-10T18:18:46","date_gmt":"2017-02-10T09:18:46","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1376"},"modified":"2017-02-13T14:21:00","modified_gmt":"2017-02-13T05:21:00","slug":"trailing-closures","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1376","title":{"rendered":"Trailing Closures"},"content":{"rendered":"<p>\u5f15\u6570\u306e\u6700\u5f8c\u306b\u304a\u3044\u305f\u30af\u30ed\u30fc\u30b8\u30e3\u5f0f\u306f\u7279\u5225\u306a\u8a18\u6cd5\u3067\u8a18\u8ff0\u3067\u304d\u308b\u3002\u63a5\u5c3e\u30af\u30ed\u30fc\u30b8\u30e3\u3001\u5f8c\u7f6e\u30af\u30ed\u30fc\u30b8\u30e3\u3002<\/p>\n<h2>\u7701\u7565\u3092\u4e00\u5207\u3057\u306a\u3044\u4e00\u822c\u7684\u306a\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n<pre class=\"lang:swift decode:true \" >func someFunctionThatTakesAClosure(closure: () -&gt; Void) {\r\n    \/\/ function body goes here\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2>Closure\u306e\u5f15\u6570\u30ea\u30b9\u30c8\u3068\u623b\u308a\u5024\u3092\u7701\u7565\u3057\u305f\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n<pre class=\"lang:swift decode:true \" >someFunctionThatTakesAClosure(closure: {\r\n    \/\/ closure's body goes here\r\n})<\/pre>\n<p>&nbsp;<\/p>\n<h2>someFunctionThatTakesAClosure\u306e\u5f15\u6570\u3092Trailing Closure\u306b\u7f6e\u304d\u63db\u3048\u305f\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n<pre class=\"lang:swift decode:true \" >someFunctionThatTakesAClosure() {\r\n    \/\/ trailing closure's body goes here\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u3055\u3089\u306b\u7a7a\u306e\u62ec\u5f27\u3092\u7701\u7565\u3057\u305f\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n<pre class=\"lang:swift decode:true \" >someFunctionThatTakesAClosure {\r\n    \/\/ trailing closure's body goes here\r\n}<\/pre>\n<p><!--more--><br \/>\n&nbsp;<\/p>\n<hr>\n<h2>\u8907\u6570\u306e\u5f15\u6570\u304c\u3042\u308b\u3068\u304d\u306eTrailing Closure\u306e\u8a18\u6cd5<\/h2>\n<pre class=\"lang:swift decode:true \" >someFunctionThatTakesAClosure(1, 2) {\r\n    \/\/ trailing closure's body goes here\r\n}<\/pre>\n<p>\u6700\u521d\u306e\uff12\u3064\u306e\u5f15\u6570\u306f () \u306e\u4e2d\u306b\u8a18\u8ff0\u3059\u308b\u3002\u4e00\u65b9\u3067 \u6700\u5f8c\u306e&quot;\u5f15\u6570&quot;\u3067\u3042\u308bClosure\u306f () \u306e\u5916\uff08\u5f8c\u308d\uff09\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<br \/>\nTrailing Closure\u306f\u8907\u6570\u4e26\u3079\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\uff08\u305f\u3060\u4e00\u3064\u3060\u3051\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1>The Swift programming language : Closure<\/h1>\n<p><a href=\"https:\/\/developer.apple.com\/library\/prerelease\/content\/documentation\/Swift\/Conceptual\/Swift_Programming_Language\/Closures.html\">https:\/\/developer.apple.com\/library\/prerelease\/content\/documentation\/Swift\/Conceptual\/Swift_Programming_Language\/Closures.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u6570\u306e\u6700\u5f8c\u306b\u304a\u3044\u305f\u30af\u30ed\u30fc\u30b8\u30e3\u5f0f\u306f\u7279\u5225\u306a\u8a18\u6cd5\u3067\u8a18\u8ff0\u3067\u304d\u308b\u3002\u63a5\u5c3e\u30af\u30ed\u30fc\u30b8\u30e3\u3001\u5f8c\u7f6e\u30af\u30ed\u30fc\u30b8\u30e3\u3002 \u7701\u7565\u3092\u4e00\u5207\u3057\u306a\u3044\u4e00\u822c\u7684\u306a\u8a18\u8ff0\u65b9\u6cd5 func someFunctionThatTakesAClosure(closure: () &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[22],"class_list":["post-1376","post","type-post","status-publish","format-standard","hentry","category-memo","tag-swift"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=1376"}],"version-history":[{"count":11,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1376\/revisions"}],"predecessor-version":[{"id":1387,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1376\/revisions\/1387"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}