[swift-dev] Using Objective C class in Swift (open source, Linux)

Wallacy wallacyf at gmail.com
Mon Feb 1 09:29:57 CST 2016


Objective-C is not avaliable on Linux.

Em seg, 1 de fev de 2016 às 13:09, Труб Илья <swift-dev at swift.org> escreveu:

> I'd like to note some interesting issue. If I try to input
>
> swiftc -c s.swift -Xcc -I<paths to my headers, including path to
> Foundation/NSObject.h> -import-objc-header C.h
>
> then I get a lot of compile errors on ALL ObjectiveC code lines in
> NSObject.h, so, it seems that compiler does not recognize Objective C
> syntax at all.
> But, if I (in another example) use -import-objc-header <pure C header file>
> that all is OK: .swift source file with function invocations from pure C
> .h-file compiled successfully, .o-file is created. What is explanation of
> such phenomena and how it could be overcomed?
>
>
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160201/4d861fab/attachment.html>


More information about the swift-dev mailing list