{"id":309,"date":"2021-09-17T15:23:21","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=309"},"modified":"2021-09-17T15:23:21","modified_gmt":"1970-01-01T00:00:00","slug":"post-309","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=309","title":{"rendered":"Swift\u3067\u69cb\u9020\u4f53\u3092\u914d\u5217\u3067\u6271\u3046\u65b9\u6cd5"},"content":{"rendered":"<p>Swift\u3067\u306f\u914d\u5217\u306b\u69cb\u9020\u4f53\u3092\u3076\u3061\u3053\u3080\u3053\u3068\u3082\u3067\u304d\u308b\u3088\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Swift\u3067\u69cb\u9020\u4f53\u3092\u914d\u5217\u306b\u3057\u3066\u307f\u308b<\/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\nvar countries = [Japan]()\r\ncountries.append(Japan(name: \"Tokyo\", region: \"Kanto\"))\r\ncountries.append(Japan(name: \"Osaka\", region: \"Kansai\"))\r\n\r\nprint(countries)\r\n\r\nfor country in countries {\r\n    print(country.region + \":\" + country.name)\r\n    \/\/ Kanto:Tokyo\r\n    \/\/ Kansai:Osaka\r\n}<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067Japan\u69cb\u9020\u4f53\u306e\u914d\u5217\u3092\u4f5c\u3063\u3066\u3042\u3052\u3066\u8ffd\u52a0\u3057\u305f\u3052\u308b\u3002<\/p>\n<p>\u30d7\u30ed\u30d1\u30c6\u30a3\u306ffor\u6587\u306e\u4e2d\u307f\u305f\u3044\u306b\u3084\u308c\u3070\u666e\u901a\u306b\u53d6\u5f97\u3067\u304d\u308b\u3088\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Swift\u3067\u306f\u914d\u5217\u306b\u69cb\u9020\u4f53\u3092\u3076\u3061\u3053\u3080\u3053\u3068\u3082\u3067\u304d\u308b\u3088\u3002 &nbsp; Swift\u3067\u69cb\u9020\u4f53\u3092\u914d\u5217\u306b\u3057\u3066\u307f\u308b struct Japan { var name: String var region: String init(na&#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\/309"}],"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=309"}],"version-history":[{"count":1,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":310,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/310"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}