[swift-evolution] [Pitch] Making some RawRepresentable things bridge to ObjC as their raw value

Brent Royal-Gordon brent at architechies.com
Sun Oct 2 17:19:23 CDT 2016


> On Oct 1, 2016, at 8:45 AM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> I’m up for reviving the ObjectiveCBridgeable proposal :)
> 
> Okay, but IMO the API of that protocol is wrong.  Any public interface
> should look something like _CustomObjectiveCBridgeable per
> https://github.com/apple/swift/commit/87944ed2449ec7314ed8690b8894ce96ad339ebf#diff-9b6ea5442068d139aa4193a59b6e4b91

Do you mind providing some color on this design? It seems to me that the proposal's ObjectiveCBridgeable design was both more idiomatic and permitted more behavior (particularly by allowing lazy collection bridging), whereas this design's only benefit seems to be that it abstracts away the specific "policy" (but that would prevent lazy bridging or other behavior differences between different policies). Why is this one better?

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list