進度條

[Swift] 使用Objective C 檔案

更新日期:

Objective c to swift
1a. 加入混合資料(Objective-C 檔案)的時候會問你要不要加入 UnitTest-Bridging-Header.h 之類的檔案
   選要

1b. 檢查 project target -> build settings -> search搜尋 "Objective-C Bridging Header"
   自行填入 folder/xxxxx.h。如果選a1的方法,Xcode會幫你自動填入 "UnitTest/UnitTest-Bridging-Header.h"

 

2. 在 UnitTest-Bridging-Header.h 或 xxxxx.h 填入Objective-C import

#import "YourClass.h"
這樣就可以了