iOS工程引入ios-charts-master

來源:互聯網
上載者:User

標籤:

前一段時間看到一個非常好的例子ios-charts-master,想在自己的工程中引用,但是一直沒有成功,即使把整個工程原封不動的搬過來仍然,無濟於事。 
經過一次意外研究,終於成功了。 
特記下整合過程。

1、建立一個工程命名為ImportChartDemo,隨便建立一個test.swift檔案,建立橋接檔案。OC 引用swift方法可以參考:

http://blog.csdn.net/zww1984774346/article/details/50506502 
設定如下,Product Module Name為工程名(可以隨意XX,匯入時為XX-Swift.h) 

2、將ios-charts-master中的charts檔案拷貝到ImportChartDemo工程檔案下

 
此為工程目錄檔案(先將Charts拷貝到檔案目錄,在匯入工程中)

在工程中匯入Charts.xcodeproj,選擇工程->右鍵->Add File… 

為了實驗可以將ios-charts-master中的檔案拷貝測試

3、配置工程依賴庫

4、將工程中ChartsDemo-Swift.h替換為ImportChartDemo-Swift.h編譯

注意:ImportChartDemo-Swift.h檔案為系統自定建立,不可自己建立,否則無效。這個標頭檔系統沒有提示,需要手動匯入。 

5. 

注意:若在真機調試中遇到dyld: Library not loaded: @rpath/Charts.framework/Charts這樣的錯誤,需要在工程中配置如下: 

參考來自:http://www.bhyuu.com/custom-framework-not-loaded-dyld-library-not-loaded-rpath-custom-framework/

iOS工程引入ios-charts-master

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.