2017-07-18 31 views
0

好吧,讓我們從基礎開始,因爲我不能受詛咒得到這個工作(見Xcode Workspace - Not finding imports from framework project pod)...的Xcode工作區與多個項目和可口可樂吊艙安裝

我希望創建一個有兩個項目的Xcode的工作區:

  1. 可可觸摸框架斯威夫特項目
  2. 的框架

上午十時正斯威夫特示範應用項目。 2還應該包含一個UI測試目標。

然後我想使用Cocoapods提供整個工作區(兩個項目!)作爲一個窗格,並且我想將框架項目「鏈接」到演示應用程序項目中,以便它可以在那裏使用。

有人可以指導我通過這個incl。 pod文件如何查找此內容?

回答

1

您需要定義吊艙,這將是共同所有的項目第一

# Uncomment this line to define a global platform for your project 
platform :ios, '8.2' 
# Uncomment this line if you're using Swift 
use_frameworks! 

# Define main pods. 
def main_pods 

    #your main pods 
    pod 'AwesomeCache', '~> 5.0' 
    pod 'DZNEmptyDataSet', '1.8.1' 


end 

# Your FirstProjectName. 
target 'FirstProyectName' do 

    main_pods 
    #here you can add any other for this specific project 
    pod 'Branch' 

end 

# Your SecondProjectName. 
target 'SecondProjectName' do 

    main_pods 
    #here you can add any other for this specific project 
    pod 'Alamofire' 
    pod 'Fabric' 
    pod 'Crashlitycs' 

end 

target 'FirstProjectTestName' do 

end 

target 'FirstProjectTestUIName' do 

end 

post_install do |installer| 
     puts("Update debug pod settings to speed up build time") 
     Dir.glob(File.join("Pods", "**", "Pods*{debug,Private}.xcconfig")).each do |file| 
      File.open(file, 'a') { |f| f.puts "\nDEBUG_INFORMATION_FORMAT = dwarf" } 
     end 
    end 
end 

希望這有助於

+0

到目前爲止好,但我的框架使用XCTest。我在我的podspec文件中添加了's.framework =「XCTest」'。現在演示應用程序編譯,但它崩潰的錯誤:'dyld:Library未加載:@ rpath/XCTest.framework/XCTest'。任何想法爲什麼發生這種情況 – BadmintonCat

+0

我不知道,我有一個自定義吊艙與這個吊艙計劃工作沒有問題的項目... –

+0

@BadmintonCat終於我的答案以任何方式解決您的問題? –