<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="">At the moment you can achieve the same effect using the following construction (at least that’s what I used):</div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(187, 44, 162);">protocol</span><span class="" style="color: rgb(0, 0, 0);">&nbsp;UIViewControllerProtocol {}&nbsp;</span>// Make sure only UIViewController conforms to this protocol</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="color: rgb(187, 44, 162);">extension</span><span class="" style="color: rgb(0, 0, 0);">&nbsp;</span><span class="" style="color: rgb(112, 61, 170);">UIViewController</span><span class="" style="color: rgb(0, 0, 0);">:&nbsp;</span>UIViewControllerProtocol<span class="" style="color: rgb(0, 0, 0);">&nbsp;{}</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">protocol</span>&nbsp;MyProtocol {}</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="color: rgb(187, 44, 162);">let</span><span class="" style="color: rgb(0, 0, 0);">&nbsp;myVar:&nbsp;</span><span class="" style="color: rgb(187, 44, 162);">protocol</span><span class="" style="color: rgb(0, 0, 0);">&lt;</span>UIViewControllerProtocol<span class="" style="color: rgb(0, 0, 0);">,&nbsp;</span>MyProtocol<span class="" style="color: rgb(0, 0, 0);">&gt;</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><span class="" style="color: rgb(0, 0, 0);"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal;">It’s obviously far longer and less obvious but I hope it at least solves your issue for now.</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;">- Alex</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On 09 Feb 2016, at 15:58, Inder Kumar Rathore . 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 dir="ltr" class="">Hi All,<div class="">I used to do this in Obj-C but I'm unable to do this in swift</div><div class=""><br class=""></div><div class=""><b class=""><i class="">UIViewController&lt;MyProtocol&gt; *delegate;</i></b><br class=""></div><div class=""><b class=""><i class=""><br class=""></i></b></div><div class="">I posted this question on dev forums but didn't get the solution and finally I'm reporting here so that It can be added as a features in the coming releases.</div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class="">Rathore</div></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=""></body></html>