From the course: Learning Realm for iOS App Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add your first objects

Add your first objects - iOS Tutorial

From the course: Learning Realm for iOS App Development

Start my 1-month free trial

Add your first objects

- [Voiceover] Now that we have a note data model for note objects, we can continue and create our first note object and add that to our first realm. And we're going to do that in the AppDeletate.swift file in the AppDelegate class, and there you will find a function that is called application didFinishLaunchingWithOptions, and this is a good starting place for us to add some realm code and just to create one object because this function is always called at application launch. And by adding our code here, we just can skip doing something in the UI or adding some code to viewDidLoad or something like this. This is just a good place for our first demo code to learn how to actually add an object to a realm. And before we can add a realm or create a realm, we first of all have to import the proper framework. And so right below the import for UIKit, we are importing RealmSwift so that we can work with all the necessary classes. And as you've already learned, and we are now doing that in the…

Contents