{"id":282,"date":"2021-09-17T15:23:21","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/swift.tecc0.com\/?p=282"},"modified":"2021-09-17T15:23:21","modified_gmt":"1970-01-01T00:00:00","slug":"post-282","status":"publish","type":"post","link":"https:\/\/swift.tecc0.com\/?p=282","title":{"rendered":"Swift\u3067\u30d7\u30ed\u30c8\u30b3\u30eb(\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9)\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>Swift\u3067\u306f<strong>\u30d7\u30ed\u30c8\u30b3\u30eb<\/strong>(Java\u3067\u3044\u3046<strong>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/strong>)\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u3002<\/p>\n<h3>Swift\u3067\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u5b9a\u7fa9\u3057\u3066\u5229\u7528\u3059\u308b<\/h3>\n<pre class=\"lang:swift decode:true\">protocol CookMethod {\n    func boil()\n    func melt(material1: String, material2: String)\n}\n\nclass Cook: CookMethod {\n    \n    func boil () {\n        print(\"Boiled!!\")\n    }\n    \n    func melt(material1: String, material2: String) {\n        print(material1 + \"&amp;\" + material2 + \" were melted!!\")\n    }\n    \n}\n\nlet cook = Cook()\ncook.boil() \/\/ \"Boiled!!\"\ncook.melt(material1: \"Water\", material2: \"Flour\") \/\/ \"Water&amp;Flour were melted!!\"<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<strong>\u30d7\u30ed\u30c8\u30b3\u30eb<\/strong>\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u4f55\u3092\u5b9f\u88c5\u3059\u308c\u3070\u826f\u3044\u304b\u304c\u660e\u78ba\u306b\u306a\u308b\u3002<\/p>\n<h3>Swift\u3067\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u8907\u6570\u5b9a\u7fa9\u3057\u3066\u5229\u7528\u3059\u308b<\/h3>\n<p>Swift\u3067\u3082\u3001Java\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u540c\u3058\u3088\u3046\u306b<strong>protocol<\/strong>\u3092\u8907\u6570\u5b9a\u7fa9&amp;\u5229\u7528\u3067\u304d\u308b\u3088\u3002<\/p>\n<pre class=\"lang:swift decode:true  \">protocol CookMethod {\n    func boil()\n    func melt(material1: String, material2: String)\n}\n\nprotocol CookMethod2 {\n    func grill()\n}\n\nclass Cook: CookMethod, CookMethod2 {\n    \n    func boil () {\n        print(\"Boiled!!\")\n    }\n    \n    func melt(material1: String, material2: String) {\n        print(material1 + \"&amp;\" + material2 + \" were melted!!\")\n    }\n    \n    func grill() {\n        print(\"Grilled!!\")\n    }\n    \n}\n\nlet cook = Cook()\ncook.boil() \/\/ \"Boiled!!\"\ncook.melt(material1: \"Water\", material2: \"Flour\") \/\/ \"Water&amp;Flour were melted!!\"\ncook.grill() \/\/ \"Grilled!!\"<\/pre>\n<p>\u30af\u30e9\u30b9\u306e\u591a\u91cd\u7d99\u627f\u306f\u3067\u304d\u306a\u3044\u3051\u3069\u3001<strong>protocol<\/strong>\u306a\u3089OK\u3002<\/p>\n<p>\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u3044\u3051\u3070\u3044\u304f\u3064\u3067\u3082\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Swift\u3067\u306f\u30d7\u30ed\u30c8\u30b3\u30eb(Java\u3067\u3044\u3046\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9)\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u3002 Swift\u3067\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u5b9a\u7fa9\u3057\u3066\u5229\u7528\u3059\u308b protocol CookMethod { func boil() func melt(material&#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\/282"}],"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=282"}],"version-history":[{"count":3,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swift.tecc0.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}