<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><div><span style="background-color: rgba(255, 255, 255, 0);">Cool thanks Kevin and David - I'll give it a try.&nbsp;</span></div></div><div><br>On Feb 22, 2017, at 7:20 PM, Kevin Nattinger &lt;<a href="mailto:swift@nattinger.net">swift@nattinger.net</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii">This seems to work in a playground:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">import</span><span style="font-variant-ligatures: no-common-ligatures" class=""> CoreData</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> SomeProtocol {}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Foo&lt;T: NSManagedObject&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class=""> T: SomeProtocol {}</span></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 22, 2017, at 4:08 PM, Dave Reed via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I suspect this can't be done (at least not right now), but wanted to check.<br class=""><br class="">I'd like to declare a class as a generic that meets a protocol and is also a subclass of some specific type.<br class=""><br class="">Something like class Foo&lt;T:NSManangedObject,SomeProtocol&gt; (i.e., the T must be both a NSManagedObject or subclass of it and conform to SomeProtocol).<br class=""><br class="">Is this possible?<br class=""><br class="">Thanks,<br class="">Dave Reed<br class=""><br class="">_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></body></html>