<div dir="ltr">Would love for this to be possible. It becomes an issue in mixed code: if you include conformance to a <foo>Kit protocol in one of your Swift classes, then you have to include the corresponding headers in every Objective C file that includes the bridging .h file. The <foo>Kit classes are added to the bridging header, but not the protocols. There are workarounds (such as using an instance of a conforming nested class as a proxy- nested classes are not emitted in the bridging header), but it's so much cleaner to be able conform to the protocol privately. (Either that, or fix the utility that builds the bridging header so it exposes the protocol as well.)<div><br></div><div><br><div> </div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="color:rgb(36,72,108)"><span style="font-size:18px">Paul Schmidt | Smartsheet</span></span><br><span style="font-size:14px"><span style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(98,99,102)">Senior iOS Software Development Engineer</span></span><br><span style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(98,99,102)">E:</span> <span style="color:rgb(71,132,171)">paul.schmidt@Smartsheet.com</span></span></span><div>C: 425.283.9576<br><br><span style="font-size:14px"><span style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(7,55,99)">Work <em><strong>Better</strong></em></span></span><span style="color:rgb(7,55,99)">™</span></span><br><span style="color:rgb(98,99,102)"><span style="font-size:14px">Learn More →</span></span><font color="#4784ab"><span style="font-size:14px"> </span></font><span style="font-size:14px"><a href="https://www.smartsheet.com/?utm_source=email&utm_medium=signature&utm_campaign=emailsignaturelink" rel="nofollow" style="color:rgb(17,85,204);text-decoration:none" target="_blank"><span style="color:rgb(71,132,171)">smartsheet.com</span></a></span><br></div></div></div></div>
<br><div class="gmail_quote">On Mon, Feb 13, 2017 at 8:28 AM, Alejandro Martinez via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I found myself writting some method that parsed an API response and<br>
wanted to use Decodable to map the response into a struct declared<br>
elsewhere.<br>
My idea was that each api response handler file (I use completely<br>
different APIs that map into the same model) could add it's own<br>
fileprivate conformance to decodable into the model struct so each api<br>
response handler would use a different decoding function. But I found<br>
the compiler telling me that is not possible.<br>
<br>
I can easily change my design, is not an issue but I'm super curious.<br>
Why fileprivate extensions can't add protocol conformance? Is there a<br>
technical reason behind? or a conscience design?<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Alejandro Martinez<br>
<a href="http://alejandromp.com" rel="noreferrer" target="_blank">http://alejandromp.com</a><br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
</font></span></blockquote></div><br></div>