我嘗試在本地 SPM 包中安裝 ViewController,但我總是收到錯誤“找不到情節提要”。
let myViewController = UIStoryboard(
name: "MyStoryboard",
bundle: Bundle(
url: Bundle.main.url(
forResource: "myModule_myModule",
withExtension: "bundle"
)!
)
).instantiateViewController(withIdentifier: "MyViewController")
此代碼在將其用作遠程包時有效,但在將其拖到 Xcode 并在本地使用時無效。
謝謝伯恩哈德
uj5u.com熱心網友回復:
與 不同Remote Packages的是,添加一個時Local不會Xcode提示您將其添加到target. 因此,您需要在您的Target's General settings, 下手動添加它Frameworks, Libraries, and Embedded Content
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/494329.html
