<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=""><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><blockquote type="cite" class=""><div class="">On Feb 17, 2016, at 12:37 PM, João Nunes via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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. </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 <<a href="mailto:cyano@me.com" class="">cyano@me.com</a>> 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 <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>