LoginSignup
0
1

More than 5 years have passed since last update.

[備忘録][Swift]Realm導入

Last updated at Posted at 2018-12-10

Realm導入

参考

CocoaPod導入

ターミナルで以下のコマンドを実行(場所はどこでも良い)

sudo gem install cocoapods

インストールが終わったら以下のコマンド

pod setup

CocoaPodをプロジェクトに適用

ターミナルでxcodeprojファイルがある場所へ移動。

下記のコマンドを実行してディレクトリ内に Podfile を作成する。

pod init

Podfileを編集。

vi Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'アプリ名' do
pod 'RealmSwift'
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for アプリ名

最後にpod installを行う。

pod install

処理が完了したら[プロジェクト名].wordkspaceというファイルが作成される。
プロジェクトが開いていたら一旦閉じて[プロジェクト名].wordkspaceを開く。
※CocoaPodsを使用する場合は常にこの[プロジェクト名].wordkspaceで開く。

0
1
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
1