{"id":336,"date":"2021-09-17T15:23:07","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=336"},"modified":"2021-09-17T15:23:07","modified_gmt":"1970-01-01T00:00:00","slug":"post-336","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=336","title":{"rendered":"Swift\u3067\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u4f7f\u3046\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5"},"content":{"rendered":"<p>Swift\u3067\u306f<strong>\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306e _ (\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc)<\/strong>\u304c\u4f7f\u3048\u308b\u3002<\/p>\n<p>\u3051\u3063\u3053\u3046\u3044\u308d\u3093\u306a\u4f7f\u3044\u65b9\u304c\u3067\u304d\u308b\u3051\u3069\u3001\u305d\u3093\u306a\u304b\u3067\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n<h3>\u95a2\u6570\u306e\u8fd4\u308a\u5024\u304c\u8981\u3089\u306a\u3044\u306e\u3067\u7834\u68c4\u3059\u308b<\/h3>\n<pre class=\"lang:swift decode:true\">func printAndGetPlus(x: Int, y: Int) -&gt; Int {\n    print(x + y)\n    return x + y\n}\n\n\/\/ \u8fd4\u308a\u5024\u3092\u7834\u68c4\u3059\u308b\n_ = printAndGetPlus(x: 4, y: 13)\n\/\/ \u30a8\u30e9\u30fc\n\/\/ print(_)<\/pre>\n<p>\u305f\u3068\u3048\u3070\u3053\u3093\u306a\u95a2\u6570\u304c\u3042\u3063\u3066\u3001print\u3060\u3051\u5fc5\u8981\u3067get\u304c\u5fc5\u8981\u306a\u304b\u3063\u305f\u3089 _(\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9) \u306b\u4ee3\u5165\u3059\u308c\u3070\u826f\u3044\u3002(print\u3067\u3082\u4f7f\u3048\u306a\u3044<\/p>\n<p>\u305f\u3060\u3057\u3001\u4eca\u306f\u4ee3\u5165\u306a\u3057\u3067\u3082\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\u307d\u3044(\u524d\u304b\u3089\u305d\u3060\u3063\u305f\u3063\u3051\uff1f\u899a\u3048\u3066\u306a\u3044<\/p>\n<h3>for in\u6587\u3067\u30eb\u30fc\u30d7\u5909\u6570\u304c\u8981\u3089\u306a\u3044\u306e\u3067\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306b\u3059\u308b<\/h3>\n<pre class=\"lang:swift decode:true\">for _ in 1...3 {\n    print(\"home\") \/\/ hoge hoge hoge\n}<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u30eb\u30fc\u30d7\u5909\u6570\u3092\u4e2d\u3067\u4f7f\u308f\u306a\u3044\u5834\u5408\u306f\u3053\u3046\u66f8\u3051\u3070\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\u3002<\/p>\n<h3>\u5916\u90e8\u5f15\u6570\u540d\u3092\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306b\u3059\u308b<\/h3>\n<pre class=\"lang:swift decode:true \">func printTwoNumSum(x: Int, y: Int) {\n    print(x + y)\n}\n\nprintTwoNumSum(x: 4, y: 13) \/\/ 17\n\n\/\/ \u4e0a\u306e\u95a2\u6570\u306e\u5916\u90e8\u5f15\u6570\u540d\u3092\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306b\u3059\u308b\nfunc printTwoNumSum(x: Int, _ y: Int) {\n    print(x + y)\n}\n\n\/\/ \u5f15\u6570\u540d\u3092\u7701\u7565\u3067\u304d\u308b\nprintTwoNumSum(x: 4, y: 13) \/\/ 17<\/pre>\n<p>\u540c\u3058\u51e6\u7406\u3092\u3059\u308b2\u3064\u306e\u95a2\u6570\u3060\u3051\u3069\u3001\u5916\u90e8\u5f15\u6570\u540d\u306b\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u547c\u3073\u51fa\u3057\u5074\u306f\u5f15\u6570\u540d\u3092\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u3002<\/p>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306b2\u3064\u306e\u6570\u5b57\u3092\u8db3\u3059\u3060\u3051\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u304b\u3060\u3068\u3053\u3093\u306a\u66f8\u304d\u65b9\u3082\u3067\u304d\u308b\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u3057\u3063\u304b\u308a\u3068\u547d\u540d\u3057\u3066\u3042\u3052\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u307e\u3060\u3044\u308d\u3044\u308d\u3042\u308b\u3093\u3060\u3051\u3069\u3001\u4f7f\u3044\u305d\u3046\u306a\u3068\u3053\u308d\u306f\u3053\u308c\u304f\u3089\u3044\u304b\u306a\u3068\u601d\u3046\u3002<\/p>\n<p>\u3080\u3057\u308d\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306f\u305d\u3053\u307e\u3067\u7a4d\u6975\u7684\u306b\u4f7f\u3063\u3066\u3044\u304f\u3082\u306e\u3067\u306f\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u4f7f\u3044\u30c9\u30b3\u30ed\u306b\u306f\u6ce8\u610f\u3057\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Swift\u3067\u306f\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u306e _ (\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc)\u304c\u4f7f\u3048\u308b\u3002 \u3051\u3063\u3053\u3046\u3044\u308d\u3093\u306a\u4f7f\u3044\u65b9\u304c\u3067\u304d\u308b\u3051\u3069\u3001\u305d\u3093\u306a\u304b\u3067\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3059\u308b\u3002 \u95a2\u6570\u306e\u8fd4\u308a\u5024\u304c\u8981\u3089\u306a\u3044\u306e\u3067\u7834\u68c4\u3059\u308b func printAndGetPlus(x: Int&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/336"}],"collection":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=336"}],"version-history":[{"count":4,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/336\/revisions"}],"predecessor-version":[{"id":845,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/336\/revisions\/845"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}