{"id":313,"date":"2021-09-17T15:23:21","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=313"},"modified":"2021-09-17T15:23:21","modified_gmt":"1970-01-01T00:00:00","slug":"post-313","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=313","title":{"rendered":"Swift\u3067Struct(\u69cb\u9020\u4f53)\u3092return\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u4e00\u5fdc\u66f8\u304f\u3051\u3069\u3001\u7279\u306b\u96e3\u3057\u3044\u3053\u3068\u306f\u306a\u304f\u7d20\u76f4\u306b\u66f8\u3044\u3066\u3042\u3052\u308c\u3070\u826f\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Swift\u3067Struct\u3092return\u3059\u308b\u30e1\u30bd\u30c3\u30c9<\/h3>\n<pre class=\"lang:swift decode:true\">struct Japan {\r\n    var name: String\r\n    var region: String\r\n\r\n    init(name: String, region: String) {\r\n        self.name = name\r\n        self.region = region\r\n    }\r\n}\r\n\r\nfunc getCountryStruct() -&gt; Japan {\r\n    return Japan(name: \"Tokyo\", region: \"Kanto\")\r\n}\r\n\r\nlet country = getCountryStruct()\r\nprint(country.name + \":\" + country.region) \/\/ \"Tokyo:Kanto\"<\/pre>\n<p><strong>-&gt; \u69cb\u9020\u4f53\u540d<\/strong> \u3092\u66f8\u3044\u3066\u3042\u3052\u308c\u3070<strong>return<\/strong>\u3067\u304d\u308b\u3088\u3002<\/p>\n<p>\u306a\u304b\u306a\u304b\u4fbf\u5229\u306a\u306e\u3067\u3001\u4f7f\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u306f\u601d\u3046\u3051\u3069\u591a\u7528\u3057\u3059\u304e\u308b\u3068\u8352\u308c\u308b\u3088\u3046\u306a\u6c17\u3082\u3057\u306a\u304f\u3082\u306a\u3044\u3002\u4e16\u9593\u7684\u306b\u306f\u3069\u3046\u306a\u3093\u3060\u308d\u3046\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u5fdc\u66f8\u304f\u3051\u3069\u3001\u7279\u306b\u96e3\u3057\u3044\u3053\u3068\u306f\u306a\u304f\u7d20\u76f4\u306b\u66f8\u3044\u3066\u3042\u3052\u308c\u3070\u826f\u3044\u3002 &nbsp; Swift\u3067Struct\u3092return\u3059\u308b\u30e1\u30bd\u30c3\u30c9 struct Japan { var name: String var region: St&#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\/313"}],"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=313"}],"version-history":[{"count":1,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions\/314"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}