How can I import Swift code to Objective-C?

前端 未结 15 2415
南方客
南方客 2020-11-22 02:52

I have written a library in Swift and I wasn\'t able to import it to my current project, written in Objective-C.

Are there any ways to import it?

#i         


        
15条回答
  •  不思量自难忘°
    2020-11-22 03:30

    Checkout the pre-release notes about Swift and Objective C in the same project

    https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_75

    You should be importing

    #import "SCLAlertView-Swift.h"
    

提交回复
热议问题