Andrew Morgan

From Zero to Mobile Developer in 45 Minutes With SwiftUI

What if you could build a native, real-time iOS chat app from scratch in under 45 minutes? This tutorial shows you how.

From Zero to Mobile Developer in 45 Minutes With SwiftUI
#1about 2 minutes

Understanding the core concepts of SwiftUI development

SwiftUI applications are built by composing state-driven views using components like VStack, HStack, and ZStack.

#2about 2 minutes

Using Realm for real-time data synchronization

Realm syncs data between the embedded mobile database and MongoDB Atlas, enabling real-time updates across devices.

#3about 4 minutes

Setting up the Xcode project and dependencies

Start by creating a new SwiftUI app in Xcode and then add the Realm SDK as a dependency using the Swift Package Manager.

#4about 2 minutes

Defining the data model for chat messages

Create a Swift class that inherits from Realm's Object to define the schema for chat messages, including properties and a primary key.

#5about 6 minutes

Implementing anonymous user authentication with Realm

Build a login view that uses Realm's anonymous authentication to log a user in and uses a binding to update the parent view's state.

#6about 3 minutes

Building a navigable list of chat rooms

Use a SwiftUI List and NavigationLink to create a view that displays available chat rooms and navigates to a specific chat view on selection.

#7about 6 minutes

Displaying live messages with ObservedResults

Use the @ObservedResults property wrapper to create a live, auto-updating view of chat messages fetched directly from the local Realm database.

#8about 5 minutes

Sending messages and persisting them to Realm

Implement a function to create a new chat message object and append it to the observed results collection, which automatically persists it to Realm and syncs it.

#9about 1 minute

Verifying real-time sync with MongoDB Atlas

See how creating or modifying a document directly in the MongoDB Atlas cloud UI instantly reflects in the running mobile application.

#10about 2 minutes

Configuring a new backend in MongoDB Cloud

Quickly create and deploy a new serverless backend application for Realm Sync through the MongoDB Cloud UI by defining a partition key.

#11about 8 minutes

Answering audience questions about mobile development

The Q&A session covers topics like Realm's scalability, SwiftUI layout patterns, handling background tasks, and alternatives to Storybook.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
DC
Daniel Cranney
Dev Digest 190: GitHub A11Y action, >12s Sora 2 videos and 42 CSS units!
Inside last week’s Dev Digest 190 . 🙅 Developers don’t trust AI, and that’s a good thing 🤖 Why everyone is talking about AI agents 🔓 Autonomous AI hacking and the future of cyber security 😨 Windows 10 support ends, millions of PC’s fall off a securi...
Dev Digest 190: GitHub A11Y action, >12s Sora 2 videos and 42 CSS units!
DC
Daniel Cranney
Dev Digest 193: Vibe Coding Honeymoon, NaN and the End of Interviews
Inside last week’s Dev Digest 193 . 🛰️ A satellite of doom 🤔 Why em-dashes? 😔 Vibe coding Honeymoon is over 🖼️ GenAI image showdown 🔥 Dangers of firewalls and VPNs 👨‍💼 AI broke interviews 🦉 A LinkedIn wisdom generator 🗞️ Join over 150,000 developers...
Dev Digest 193: Vibe Coding Honeymoon, NaN and the End of Interviews
DC
Daniel Cranney
Dev Digest 192: Undead Web, Chart Performance, Free Wifi!
Inside last week’s Dev Digest 192 . 🕸️ The web is dead - again 💻 AI browsers are anti web and a security nightmare 🛰️ Satellites send unencrypted data ⚒️ Building the same app 10 times to compare performance 🕵️ Social media hunting tools 🖥️ One deve...
Dev Digest 192: Undead Web, Chart Performance, Free Wifi!

From learning to earning

Jobs that call for the skills explored in this talk.