<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I didn’t get you 100%.&nbsp;<div class="">But If you are saying that the programmer is providing the API then yes.<div class=""><br class=""></div><div class="">João</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 17 Feb 2016, at 23:00, David Waite &lt;<a href="mailto:david@alkaline-solutions.com" class="">david@alkaline-solutions.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">So if I understand, the goal is to restrict safe/functional behavior when it doesn’t align with the intentions of how an API was intended to be used?</div><div class=""><br class=""></div><div class="">-DW<br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 17, 2016, at 12:37 PM, João Nunes via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">The code is for a delegate. Thus it needs a protocol not a class.&nbsp;</div><div class=""><br class=""></div><div class="">If you use a class and not a protocol, your delegate wont be able to subclass any other class to implement the "protocol" because it is a class.</div><div class=""><br class=""></div><div class="">The same applies if the uitableview delegate was declared as a class. You couldn't subclass a viewcontroller and still conform to the tableview delegate protocol.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Joao</div><div class=""><br class="">Sent from my iPhone</div><div class=""><br class="">On 17 Feb 2016, at 21:12, Sune Foldager &lt;<a href="mailto:cyano@me.com" class="">cyano@me.com</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 17 Feb 2016, at 18:59, João Nunes via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">In the example given. How would you restrict the generic type to a protocol without the use of AnyProtocol ?</span></div></div></blockquote><div class=""><br class=""></div>But what would you gain from restricting to just protocols? What could go wrong if someone passed in a class?</div><div class=""><br class=""></div><div class="">-Sune</div><div class=""><br class=""></div></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></body></html>