main navigation

Products

Support

Language

Tutorial: Build iOS App from Scratch

If you prefer to watch a video walkthrough of this tutorial you can do that below. Otherwise, scroll down for the step-by-step text instructions.

Building Your First Realm Platform iOS App

First, install the Realm Object Server if you haven’t yet and follow the instructions about installing and testing RealmTasks. This will get you set up with the Realm Platform, a running server, and get you started using the RealmTasks app.

In this tutorial we will guide you through writing an iOS app using Realm Swift, which is a simpler version of RealmTasks, which can connect to Realm Object Server and synchronize data with the full RealmTasks app.

Unzip the downloaded file, navigate to the ios/swift-4.0 sub-folder, and drag Realm.framework and RealmSwift.framework into the “Embedded Binaries” section of your RealmTasksTutorial target’s “General” tab.

A confirmation dialog will appear, check “Copy Items if Needed” and then click “Finish”.

Next, add the following at the top of ViewController.swift (adding the new import statement and code right under the existing import UIKit):

In the code above, enter the same values for the username and password variables as you used when registering a user through the RealmTasks app in the “Getting Started” steps. (Link at the top of this article.)

Then insert the following at the end of the setupRealm() function (inside the function body):