{"id":741,"date":"2016-01-24T11:37:19","date_gmt":"2016-01-24T11:37:19","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=741"},"modified":"2016-01-24T11:37:40","modified_gmt":"2016-01-24T11:37:40","slug":"swift-vererbung-ueber-delegierte","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/swift-vererbung-ueber-delegierte\/","title":{"rendered":"swift Vererbung \u00fcber Delegierte"},"content":{"rendered":"<p><strong>Zwei Dateien<\/strong><br \/>\nProj_Bauteil_Funktion.swift<br \/>\nProj_Bauteil_Funktion<strong>Delegate<\/strong>.swift<\/p>\n<p><strong>Inhalt DateiDelegate.swift<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">import Bibliothek\r\n\r\n<strong>protocol<\/strong> <strong>Proj_Bauteil_FunktionDelegate<\/strong> {\r\n.    func name(&lt;var&gt;:&lt;Type&gt;<strong>!<\/strong>)\r\n}<\/pre>\n<p>\u00c4hnlich zum Header gibt sie das an, was importiert wird.<\/p>\n<p><strong>Bezug auf Vererbung in der Hauptdatei<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">class xy {\r\n.          \/\/ Deklarationen\r\n.         var <strong>delegate: Proj_Bauteil_FunktionDelegate?<\/strong>\r\n.\r\n.        \/\/ Funktionen\r\n.       func tcpSocket( &lt;argument&gt;) {\r\n.                \/\/ Code\r\n.                <strong>delegate?<\/strong>.receiveAck(data)\r\n}   \r\n<\/pre>\n<p>Die vererbte Variable wird mit einem <span class=\"lang:sh decode:true crayon-inline \">?\u00a0 <\/span>definiert und immer mit einem <span class=\"lang:sh decode:true crayon-inline \">?<\/span>\u00a0 aufgerufen.<br \/>\n<strong>Was bedeutet das<\/strong><span class=\"lang:sh decode:true crayon-inline \"> !<\/span>\u00a0 ?<br \/>\nVermutung: Die Eltern erhalten dieses Zeichen.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zwei Dateien Proj_Bauteil_Funktion.swift Proj_Bauteil_FunktionDelegate.swift Inhalt DateiDelegate.swift import Bibliothek protocol Proj_Bauteil_FunktionDelegate { . func name(&lt;var&gt;:&lt;Type&gt;!) } \u00c4hnlich zum Header gibt sie das an, was importiert wird. Bezug auf Vererbung in der Hauptdatei class xy { . \/\/ Deklarationen . var delegate: Proj_Bauteil_FunktionDelegate? . . \/\/ Funktionen . func tcpSocket( &lt;argument&gt;) { . \/\/ Code . delegate?.receiveAck(data) &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/swift-vererbung-ueber-delegierte\/\" class=\"more-link\"><span class=\"screen-reader-text\">swift Vererbung \u00fcber Delegierte<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/741"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":2,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/741\/revisions"}],"predecessor-version":[{"id":1176,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/741\/revisions\/1176"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}