The one that comes with SwiftFoundation 
(https://github.com/apple/swift-corelibs-foundation/tree/master/CoreFoundation 
<https://github.com/apple/swift-corelibs-foundation/tree/master/CoreFoundation>).

I think it should be a bug that CFReadStream cannot be bridged to 
(NS)InputStream, as otherwise there’s no way to intertwine Sockets (CFSockets) 
with SwiftFoundation. As the implementation already uses a CFReadStream 
internally 
(https://github.com/apple/swift-corelibs-foundation/blob/d3872cb094124d5dd189839505ae73e2fa717cfd/Foundation/NSStream.swift#L122
 
<https://github.com/apple/swift-corelibs-foundation/blob/d3872cb094124d5dd189839505ae73e2fa717cfd/Foundation/NSStream.swift#L122>),
 it would be a matter of adding an initializer. However the value is private, 
so adding the initializer cannot be done from an extension.

—
Bouke

> On 21 Sep 2016, at 21:22, Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On Sep 20, 2016, at 9:38 PM, Bouke Haarsma via swift-users 
>> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:
>> 
>> When working with CoreFoundation objects (e.g. CFReadStream, CFWriteStream) 
>> it isn't immediately obvious to me how to bridge them to SwiftFoundation 
>> counterparts (InputStream / OutputStream).
>> 
>> The following works on OSX, but doesn't work on Linux;
> 
> What implementation of CF are you using on Linux? OpenStep?
> 
> The bridging between Swift and Obj-C Foundation classes is only implemented 
> on Apple platforms. It’s not part of the open source release. The plan is to 
> implement classes like InputStream in native Swift as part of the standard 
> library; that work is in progress.
> 
> —Jens

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to