The RealmSwift library allows you to easily persist your data model.
pod repo update pod initopen Podfile# Pods for [Your_App]
pod 'RealmSwift'post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
endpod install.xcworkspace file (Once you add Cocoapods, you will always use the .xcworkspace file instead of .xcodeproj)cmd + shift + k and build cmd + b your project. This is nessesary to get your project to "see" any pods you have added. import RealmSwift
// If you get a "no module 'RealmSwift'" error, erase the import line and clean and build your project.