2017-08-24 92 views
0

我正在嘗試在我的項目中使用SwiftIconFont Framework。我遵循列出的所有方向。我加了pod 'SwiftIconFont', '~> 2.7'然後執行pod install。終端吐出:向Swift項目添加框架

Analyzing dependencies 
Downloading dependencies 
... 
... 
Installing SwiftIconFont (2.7.0) 
... 
... 
Generating Pods project 
Integrating client project 
Sending stats 
Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed. 

從這個終端的消息來看,應該SwiftIconFont已成功安裝在我的項目。但是,當我去我的項目嘗試鏈接SwiftIconFont框架時,添加的目錄顯示爲空。

SwiftIconFont directory is empty

我試圖import SwiftIconFont但Xcode中說,沒有這樣的模塊存在。我該怎麼做才能夠使用這個框架?

我還將github "0x73/SwiftIconFont"添加到我的Cartfile中,然後執行carthage update,即使此步驟可能不必要。爲您解決問題

+0

只需重新啓動您的xcode並重試即可 –

+0

您打開.xcworkspace文件嗎? – Keuha

+0

CocoaPods和Carthage使用不同的方法來處理項目中的依賴關係,因此您必須決定使用哪一個。對於CocoaPods,請確保您使用'.xcworkspace'而不是通常的'.xcodeproj'。 –

回答

1

我不知道爲什麼會這樣,但一個方法是去到您的構建設置和定義框架搜索路徑到包含有問題的框架文件夾。如果框架放置在項目目錄中,只需將框架搜索路徑設置爲$(SRCROOT)並將其設置爲遞歸。