Help us understand the problem. What is going on with this article?

CarthageでChartsを導入してみる

Carthageでグラフ描画ライブラリChartsを導入したときのメモ。
はじめてのCarthageだったので、その導入から。

インストール

$ brew install carthage

Cartfile作成

$ cd path/to/repository
$ code Cartfile
Cartfile
github "danielgindi/Charts" == 3.4.0

ライブラリをビルド

$ carthage update --platform iOS

Carthage/Build/iOS/ にビルド成果物があれば成功。

$ ls ./Carthage/Build/iOS/
059E4A44-BC91-38F6-B36D-D72B91FDE6E5.bcsymbolmap
5A112AED-A5E6-34A0-9C82-74EF7032628F.bcsymbolmap
Charts.framework
Charts.framework.dSYM

Run Scriptを追加

TARGETSの中から、ターゲットを選択
→ Build Phasesタブの + をクリック
New Script Phase を選択
→ 下記のコマンドを記述

/usr/local/bin/carthage copy-frameworks

→ 次にInput Filesに以下を追加

$(SRCROOT)/Carthage/Build/iOS/Charts.framework

そして、Output Filesに以下を追加

$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Charts.framwork

こんな感じになればよい👇
スクリーンショット 2020-03-02 23.03.56.png

ソースコードでimportしてみる

import Charts を記述、ビルドしてエラーが出なければおk

スクリーンショット 2020-02-09 15.19.32.png

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした