0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【個人的備忘】CocoaPodsを使用してRealmSwiftをインポートする

Last updated at Posted at 2021-04-23

1. CocoaPodsインストール

ターミナル起動
sudo gem update —system
※ruby gemアップデート
sudo gem install cocoapods
pod setup

2. プロジェクトにPodfile作成

※Xcode閉じておく
cd プロジェクトのディレクトリ
※例
cd Desktop/xxx
cd Desktop→ls→cd xxx
pod init
※Podfile作成

3. RealmSwiftインストール

vim Podfile
i
※編集モード(insert)
# Pods for XXの下に
pod 'RealmSwift'

※ # platform :ios, '9.0'などは
適宜アンコメントして記載すると警告が出なくて良い。

esc
※編集モード終了
:wq もしくは(Shift+z)×2
※保存して終了
pod install

pod updateはPodfile.lockを無視してアップデートを行うコマンド、pod installはPodfile.lockを参照するため勝手にアップデートはされない、インストールを行うコマンド

4. インポート文

import RealmSwift

5. 備考

下記とほぼ同工程です。
すでにPodfileが存在する場合など、適宜1, 2は省略してください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?