<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="">The code is for another project. I’m trying to build a (partial) Swift implementation of NetService. See also <a href="https://github.com/Bouke/NetService/tree/linux" class="">https://github.com/Bouke/NetService/tree/linux</a>.</div><div class=""><br class="webkit-block-placeholder"></div><div class="">Apparently that protocol is EOL;</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">// slated for removal, these are the swift-corelibs-only variant of the _ObjectiveCBridgeable<br class="">internal protocol _CFBridgeable {<br class=""> associatedtype CFType<br class=""> var _cfObject: CFType { get }<br class="">}</blockquote></div><div class=""><br class=""></div><div class="">—</div><div class="">Bouke</div><div class=""><br class="">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 21 Sep 2016, at 21:56, Will Stanton <<a href="mailto:willstanton1@yahoo.com" class="">willstanton1@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello Bouke,<br class=""><br class="">Is that code you’re working on within SwiftFoundation or for another project?<br class=""><br class="">I believe _cfObject can bridge String to CFString within SwiftFoundation (but it’s an internal property), for example in NSDateFormatter.swift:<br class="">String -> CFString<br class="">_setFormatterAttribute(formatter, attributeName: kCFDateFormatterAMSymbol, value: _amSymbol?._cfObject)<br class="">CFString -> String<br class="">(CFDateFormatterCopyProperty(_cfObject, kCFDateFormatterAMSymbol) as! NSString)._swiftObject<br class=""><br class=""><br class="">Within SwiftFoundation, it seems CFReadStream+CFWriteStream do not have associated CFTypes. That may be because their implementations just started, but I am not sure what the plan is with those classes and `protocol _CFBridgeable`.<br class=""><br class=""><br class="">Regards,<br class="">Will Stanton<br class=""><br class=""><blockquote type="cite" class="">On Sep 21, 2016, at 12:38 AM, Bouke Haarsma via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:<br class=""><br class="">Hi all,<br class=""><br class="">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).<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></body></html>