
Copy the following chunk of text and paste it into your Podfile:

Note:If you are not familiar with CocoaPods or need help installing it, check out our very own CocoaPods tutorial.Ĭreate a file called ‘Podfile’ in the root directory of the starter project (To do this in command line simply use the command touch Podfile). Right now your app only contains instances of UITableView and MKMapView to provide the map functionality. MapKit is already set up in your project. Instead, you’ll create a virtual assistant for yourself - an app named “Agents Partner”.ĭownload the starter project for this tutorial here: AgentsPartner_Starter You need an assistant to keep notes and document your findings, but the agency doesn’t have an assistant to spare, nor the budget to hire a new one. Here’s the scenario: you’ve accepted a position as an intern in the National Park Service and your job is to document the species found in the biggest national parks in the United States.
#Realm browser for mac how to
You’ll learn how to link in the Realm framework, create models, perform queries, and update records. This Realm tutorial will introduce you to the basic features of Realm on iOS.
#Realm browser for mac code
Working with Realm results in more concise code - which makes it easier to write and read your code. Let specimens = try Realm().objects(Specimen).filter(predicate).sorted("name", ascending: true) What takes quite a few lines with Core Data can be achieved with far fewer lines in Realm: let predicate = NSPredicate(format: "name BEGINSWITH searchString) Let results = try managedObjectContext?.executeFetchRequest(fetchRequest) Let sortDescriptor = NSSortDescriptor(key: "name", ascending: true)įetchRequest.sortDescriptors = Let predicate = NSPredicate(format: "name BEGINSWITH searchString) Here’s some example Core Data code to fetch a set of records with a predicate and then sort the results: let fetchRequest = NSFetchRequest(entityName: "Specimen") The Realm developers claim that their proprietary data storage solution is even faster than SQLite and Core Data.

Unlike wrappers around Core Data such as MagicalRecord, Realm does not rely on Core Data or even a SQLite backend. Most common functions such as querying the database consist of a single line of code! It’s fast, lightweight, and extremely simple to integrate in your project. Realm is a cross-platform mobile database solution designed specifically for mobile applications. Original tutorial was by team member Bill Kastanakis. Update note: This tutorial was updated for iOS 9 and Swift 2.2 by Bradley Johnson.
