4 ms·
He mentioned the desire to drop the "C" from objective-c, but I'm curious what this means for using c/c++ libraries now. Do they need to be wrapped by objective
by seanalltogether 12y ago
He mentioned the desire to drop the "C" from objective-c, but I'm curious what this means for using c/c++ libraries now. Do they need to be wrapped by objective-c before being visible in swift?
- FreezerburnV 12y agoIt seemed like it could interoperate with C just fine based on the slide talking about all three. Also because it uses the Objective-C runtime and compiles to native, it might just see C functions as normal functions. Though what little I've looked at the free book hasn't given me any hints about that yet.
- Udo 12y agoI suspect that as long as it compiles to LLVM, anything goes.
- quonn 12y agoSwift uses a special "bridging header" to expose Objective-C code to Swift. This header will presumably be processed by the Swift compiler. In the other direction, XCode will automatically generate an Objective-C header to expose your Swift code to Objective-C.
- outworlder 12y agoThe ibooks guide references a "Using Swift with Cocoa and Objective-C" document. Is that where you got your information?
- deleted 12y ago[deleted]
- eevilspock 12y agohttps://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html https://developer.apple.com/library/prerelease/ios/documenta... For discussion: https://news.ycombinator.com/item?id=7837468 https://news.ycombinator.com/item?id=7837468
- sv3nss0n 12y ago"You cannot import C++ code directly into Swift. Instead, create an Objective-C or C wrapper for C++ code."
- pjmlp 12y agoI hope so. Another stab on C's back.