更新时间:2023-11-09 09:50:46
此过程似乎有效(对于单个应用程序目标):
This procedure seems to work (for single app target):
import TestLibrary
,因为Swift和Objective-C代码都将驻留在同一个应用程序目标中# importTestLibrary / TestLibrary.h
Objective-C Bridging Header:Test / Test-Bridging-Header.h
for Test let test = TestLibrary()
例如在ViewController.swift里面 viewDidLoad
import TestLibrary
, since both the Swift and Objective-C code will reside in the same app target#import "TestLibrary/TestLibrary.h"
Objective-C Bridging Header: Test/Test-Bridging-Header.h
for Testlet test = TestLibrary()
e.g. inside viewDidLoad
in ViewController.swiftVoila ......
Voila ...