
Explore fundamentals and advanced topics of Swift data, including undo/redo, CloudKit, fetch descriptors versus queries, and MVVM usage, while storing gradients and building a mesh gradient editor.
Create a to-do model with a title and date using the add model macro, then display a list of to-do items with a query versus a fetch descriptor.
Add a new todo by validating a two-element title, using the selected date for the new item, inserting with the model context, and saving with error handling, then reset inputs.
Execute delete functionality for todo items using the model context and persistence, applying a destructive swipe action with a trash can label to remove items and save changes.
Mastering swiftdata and swiftui introduces a to-do app with a completed boolean, default false, and a toggle completion button that updates the interface and persists state.
Implement queries, predicates, and filters to display completed to-dos with a toggle that filters by completion and sorts by date or title using sort descriptors.
Learn fetch descriptors as a flexible alternative to queries, implement a seven-day to-do fetch with a date predicate, and sort by date in SwiftUI.
Master how to create a today-focused fetch descriptor for to-dos using SwiftData, filtering by the beginning and end of day, sorting by date, and building a live query.
Implement predefined tag enums with colors, codable conformance, and case iterable in a SwiftUI and SwiftData to-do app, plus a horizontal tag picker with a three-tag limit.
Refactor a SwiftUI to-do app using SwiftData to improve readability and organization by extracting input, date, and tag views, adding bindings and actions, and testing for bugs.
Master CloudKit integration by setting up a developer account, enabling iCloud in Xcode, creating CloudKit containers, and configuring background modes and push notifications.
Design a custom text field in SwiftUI, using binding, focus state, and dynamic border color within helper views to enhance input UX for splash screen workflows.
Create a contact list view with Swift data, leveraging the model context to insert, delete, and update, and implement first name, last name, and phone number queries with sorting.
Create a sort and toggle view to sort contacts by first name, last name, or phone number using a sort order enum and a segmented picker in SwiftUI.
Learn to craft an advanced filter UI in SwiftUI by implementing sort and toggle controls, managing state for sort order and advanced filters in a contact list view.
Learn to build sorted contacts in SwiftUI by configuring a base contacts array, selecting sort keys (first name, last name, phone), and applying optional inverse sorting and filters.
Display the phone and address in a SwiftUI view using phone.fill and house.fill icons in an HStack, conditionally shown when not empty, with blue foreground and a three-line address limit.
Create a reusable avatar view in SwiftUI, rendering image data as a 50 by 50 circle with a gray border and overlaying the first initial in blue.
Build a contact sheet in SwiftUI by tapping a contact to present a sheet, manage current contact, and open an add contact form with a plus button.
Build a SwiftUI contact form view with bindings to a contact and avatar via photos picker, and focused fields plus email validation to control the save button.
Apply the optional section by converting fields to optional phone and address inputs with a phone pad, noting the background color change; next, add an avatar with a photo picker.
Add a toolbar with cancel and save actions in the contact form, wire dismiss and save closures, manage avatar data, and navigation title while disabling save until inputs are valid.
Build an avatar section with a photos picker to select images, including live photos, update the avatar on image change, and display a centered choose avatar label.
implement a load image function with a photo picker item, guard against nil, and update avatar image and avatar data on success, else set image error.
Learn to add contacts in a SwiftUI list by opening a sheet with the plus button and binding to the current contact. Save changes via SwiftData’s model context and autosave.
Enable delete functionality in the contact list by deleting items from the filtered contacts using the index and model context, then save changes with error handling.
Implement a filter picker view as a secondary view with a binding to selected filter, using a segmented picker to filter contacts by domain or phone criteria in contact list.
Toggle show more reveals extra contact details in a SwiftUI list using a leading toolbar button. The lesson covers editing phone numbers and addresses and saving changes.
Add a search filter in SwiftUI to filter contacts by first name, last name, address, or email using localized case-insensitive contains as the user types.
learn to show a content unavailable view when the filtered contacts list is empty and switch to displaying the list otherwise, prompting users to create a new contact in SwiftUI.
Create a SwiftUI splash screen with a resizable system image that scales, shows a welcome to contacts text, and transitions to the contact list view after a short delay.
Master reversing the contacts list by toggling sort order via is sort order inverse, reversing filtered contacts in SwiftUI, and validating changes through an interactive app flow.
Build a simple Track Mate project in SwiftUI with SwiftData, add charts, share the database across views, rename content view to main view, and start with separate models and views.
Create a SwiftData item model class by adding a Swift file, importing SwiftData, and defining name, value, and date properties with an initializer.
Set up a tab view with list, graph, and report tabs, each backed by its own list view, graph view, and report view, organized in separate folders with SwiftUI imports.
Build a SwiftUI list view connected to SwiftData with a model container and @Query, displaying items sorted by date in reverse order, with add/edit item sheet and swipe actions.
Explore implementing swipe actions on a SwiftUI list, enabling trailing-edge full swipe with delete and edit options, plus wiring up delete logic and an edit sheet.
Create an add/edit item form in a SwiftUI and Swift data view, integrating a navigation stack, form sections, a date picker, a stepper, and a toolbar to manage item data.
Create a user-friendly SwiftUI input form featuring favorite items and default suggestions, with a horizontal scroll, text field, date picker, stepper, and save or cancel toolbar actions.
Learn to build a SwiftUI add/edit item view with a save and cancel toolbar. Handle edits versus creating new items and persist changes with input validation.
Refine the list view by wiring add and edit item sheets, using onappear to set item to edit, and updating button tint for a smoother SwiftUI add and edit flow.
Build a scrollable bar chart in SwiftUI using charts and a navigation stack. Sort items by date and limit visible items, while queries use implicit model context.
Build a report view with swift data to compute total value, average value, and top three items, displayed in a navigation stack with scroll view using vertical and horizontal stacks.
Set up a simple iOS translation app project focused on implementing an undo and redo manager, with a model, a view model for undo redo, and a content view integration.
Create a text entry model in SwiftData, defining text, a timestamp, an optional timestamp, and an optional translated string, with an initializer that sets default nil values.
Create a Swift helper named generate initials to derive the first two initials from a text entry, handling one-word inputs by splitting on spaces and uppercasing result for UI use.
Structure the view model using MVVM, enable undo/redo with an undo manager, and manage text entries with add, update, delete, edit, and load from the database.
Build a SwiftUI row view for text entries with an avatar and a translation toggle, showing original and optional translated text plus a timestamp, styled with a pink-purple gradient.
Design the main view with reusable edit and delete buttons, a destructive delete action with animation, wired to a view model, and prepared for model context and undo manager.
Configure a main view with a SwiftData model context and undo manager, implement an undo/redo action with shake gestures, and initialize the view model using a text-entry model container.
Builds the main view with a navigation stack, a leading list of text entries, an add/edit field, and swipe actions, wired to a view model with undo/redo scaffolding.
Implements create, read, update, and delete in the view model by loading entries with a reverse timestamp sort, handling errors, and wiring undo actions for edits, inserts, and deletes.
Learn to implement undo and redo in the view model using an undo manager, register undo/redo closures for inserted and deleted text, and update the model context with action names.
Refine the app's UI with padding, a text field, and a translation workflow from English to multiple languages, and implement undo/redo and shake testing to validate SwiftUI behavior.
Build an undo redo aware modifier in SwiftUI that uses an undo manager. Track shake to undo enabled via UIAccessibility and listen for system notifications to respond to changes.
Create a device shake view modifier in SwiftUI that listens for a shake notification and runs an action when the device shakes, with guards for shake enablement and undo manager.
Add an alert in SwiftUI to confirm undo or redo, with info.title as the alert title, a default primary button and a cancel secondary button, invoking undo or redo.
Extend the view with an undo redo modifier by passing an undo manager, register it, and apply shake to undo and redo to a target view.
Build a book library app to see data in the database, explore lightweight migrations and relations, and create mock data while organizing the project with models and views.
Define persistent book and author models with swift data by converting structs to classes, adding at model, and establishing a cascade delete books relationship, then configure the content model container.
Inject the SwiftUI model context into the preview, configure a forward or reverse sort. Embed the view in a navigation stack, manage sorting state, and display the empty authors view.
Finalize the main view by building a SwiftUI list of authors with a segmented sort picker, disclosure groups for books, and inline update and delete actions using SwiftData.
Build an edit author view in SwiftUI with a form that validates author name and new book titles, lists books, and supports adding and deleting books via a model context.
Debug a SwiftUI sheet workflow by inspecting isPresented, using a captured closure to trigger updates from a selected author, and validating the add flow with test names.
Discover how the database is stored by printing the database url, inspecting the sqlite file with db browser for sqlite, and examining z book and z author tables for debugging.
Explore swift data relationships—1-to-1, 1-to-many, and many-to-many—alongside delete rules like cascades and nullify, with hands-on model setups and behind-the-scenes database insights.
Create a relationship view in SwiftData and SwiftUI, implementing 1 to 1, 1 to many, and many to many relationships with users, profiles, categories, tasks, students, and courses.
Implement add sample data and delete all data in a SwiftData and SwiftUI iOS app, using model context to insert and remove users, categories, students, and courses.
Examine how the unique attribute behaves in a SwiftData model by exploring relationships, delete rules, and inspecting the database behind the scenes to debug and understand data behavior.
Create mock data for SwiftData previews by building a preview data file and configuring an in-memory model container. Insert sample users, categories, tasks, and courses to drive content view previews.
Generalize mock data handling by implementing a reusable add examples function and a flexible preview. Load and display mock models such as users, categories, tasks, and courses in previews.
Explore how lightweight migrations evolve SwiftData models by adding fields, defaults, and constraints. Rename attributes like name to first name and nickname to alias, then verify data persistence.
Build a mesh gradient editor to create new meshes and generate drag-and-drop code for Xcode, using strings for colors and outlining meshify's mac app structure with models and views.
Create a mesh model class using Swift data, with properties for name, colorNames, rows, columns, and points. Implement an initializer and a descriptive string, and annotate the class with @Model.
Learn to convert points and colors into SwiftUI mesh gradient code, building functions for single points and iterating a two dimensional array of points.
Demonstrates building a dynamic SwiftUI code view that switches between a mesh view and a name view based on input, with identifier validation and a string extension for indentation.
Implement isValidIdentifier to enforce non-empty strings that start with a letter or underscore, with remaining characters limited to letters, digits, or underscores, and test various cases.
Rethink mesh gradient model by using an initializer including width, height, points, colors, background, smooth colors, and color space, ensuring points match colors while moving string functions to the model.
Refine the mesh model by adding a color point pair model, a background color field, and a sorted color point list with an explicit mesh relationship.
Add computed properties to the mesh model to access points, color point pairs, color names, and sample mesh previews, with a gradient color space offering device or perceptual options.
Introduce a mesh model code extension and a code type enum to simplify the code view, remove gradient logic, and prepare a reusable Swift file for future app-wide use.
Implement a mesh model code extension in SwiftUI by refining view name logic, handling identifiers, and assembling gradient code with background, smooth colors, and color space.
Refactor the mesh model code extension into a function and switch on code type (extended or simple) to define a computed property for SwiftUI development.
Set up the main view with a swift data context and navigation split view of sorted mesh models. Provide an inspector and a new mesh workflow via sheet and dialog.
Create a SwiftUI mesh configure view with bindings for row, column, and mesh name, including cancel and create flows, sections, pickers, name validation, and keyboard shortcuts.
Integrate the mesh configure view into the main view to create a new mesh with a name, at least two rows and columns, and a random color matrix.
Create a random color matrix in a color extension for SwiftUI, using a color-to-name map, and update the mesh model to initialize with a color array and points.
Extend Cmd2 with a float extension to produce default SIMD2<Float> points as a normalized grid, then reset and set points in the mesh model for display.
Develop a mesh gradient background by extending MeshModel with two mesh gradient methods, implement color name-to-color mapping, and integrate SwiftUI to support dynamic gradients in iOS.
Create a new mesh button in SwiftUI by using a mesh gradient, clip it with a rect corner radius ten, and add a subtle shadow to enhance depth.
Build the mesh list view in SwiftUI, with mesh list row view and icon list row view, supporting mesh models, isSelected, previews, and drag-and-drop between icon and name layouts.
Finalize the mesh list view by implementing CRUD operations with SwiftUI and SwiftData, including delete confirmations, editing names, duplicating entries, drag-and-drop, context menus, and a responsive grid or list layout.
Evaluate the mesh list view with two-column and three-by-three grids, validate crud operations, and note a row-column naming bug; upcoming work covers the icon list row view.
Build a mesh list row view and an icon list row view in SwiftUI, using a dim parameter, gradient backgrounds, selection states, and subtle animations.
Implement the icon list row view with a rounded rectangle, mesh gradient fill, selection-driven border, and text sizing; align a square aspect ratio and explore mesh creation and identifier validation.
Bind the current mesh model and the selected rows and columns in mesh detail view, enable drag gestures to adjust control points, and integrate code view, geometry reader, and inspector.
discover how to add toolbar items in a SwiftUI mesh detail view, including a toggle to show code and a reset points button with a u-turn arrow.
Add a drag gesture to the mesh detail view using geometry reader for width and height, toggle code visibility during drag with onChanged and onEnded.
Update the mesh model's color points via drag, indexing from column and row for five by five mesh. Extend cgfloat, clamp to 0–1, and round.
Implement a checkerboard view with a canvas and a configurable cgfloat size, plus an optional color. Use row and column parity to render gray squares and apply the chosen color.
Construct a SwiftUI properties view form with sections and headers, including text fields for mesh name and control points, a color space picker, and a smooth colors toggle.
Integrate the background popover into the properties view using isPresented binding and bottom edge, and implement color selection and selection views.
Develop a color selection view in SwiftUI with a binding for the selected color, a configurable grid of colors with columns and dimension, and a default palette for future customization.
Adjust the color selection view to set the current mesh model's background color, pass optional colors to the checkerboard, and render with a color-filled or default checkerboard accordingly.
Create a selectable square view in SwiftUI with a rounded rectangle, dynamic line width, fill color, shadow, and scale effect based on selection, then wire it into a selection view.
Bind isPresented with a getter/setter to control the popover, manage selected row and column, and update the mesh model with the new color name via color selection.
Adjust the properties view by switching the color space to segmented picker style, tweaking the background and control points, and renaming or duplicating meshes for preview in sample views.
Explore concurrency with SwiftData and SwiftUI in iOS apps, loading large data sets in a hero and villain example, with sorting, lists, and conditional styling.
Finalize the basic heroes demo in SwiftData and SwiftUI by configuring a model context, inserting sample heroes with random power levels, and saving to the data store.
Explore how increasing hero counts tests concurrency and exposes the limitations of a naive hero loader, and identify the need for a visual loading indicator to track progress.
Demonstrates concurrency by duplicating a hero example, using a model actor to asynchronously populate heroes and compare performance, replacing onappear with a task and testing counts.
Model and persist news articles with swiftdata using @modelactor to manage concurrency. Insert, fetch, delete, and save articles via the model context while showing a progress bar.
Generate and persist dummy news articles using SwiftData in a SwiftUI app, managing the model context and presenting news with a sheet.
Build a dynamic news list UI in SwiftUI by using a scroll view with a lazy vstack, enumerated articles, and a load more button, plus on-appear scrolling and navigation title.
Add scroll to bottom and load more articles to the news list using a scroll proxy, bottom id, and fetch descriptor with timestamp sorting, batch size, and offset.
Explore building a progress bar with an animated mesh gradient background in a separate news articles project, featuring batch loading, real-time progress, and cancelable background tasks.
Create an animated mesh gradient background in SwiftUI by managing state, cycling through center points and colors with a timer and smooth ease-in-out animations.
Explore Swift data model inheritance by modeling ebooks and printed books as subclasses of a book in a library app, using Xcode 26 and iOS 26.
Consult the docs on adopting inheritance in SwiftData, learn when to use or avoid it, and explore ebooks versus published books and business versus personal trips.
Define a SwiftData book model with title, author, and published date, then create ebook and printed book subclasses that inherit properties and a book format enum with epub and pdf.
Configure the book view by importing SwiftData, adding book models, and creating a private environment model context; introduce a segmented picker for all books, e-books, and printed books.
Explore building a book view in SwiftUI, integrating SwiftData queries and a segmented picker to filter books by all, e-book, or printed, with a searchable list and on-tap edit.
Learn to filter books by a segment and search text using SwiftUI and SwiftData, applying a segmented picker, exhaustive switch, and localized case-insensitive matching on title or author.
Build the add book view in SwiftUI, wiring state for title, author, date, file size, and format, with on save and dismiss actions to insert the new book.
learn to build a basic info view in SwiftUI, with text fields for title and author, a date picker, and bindings to the add book view to enable parent communication.
Create a SwiftUI book form section with bindings for format and file size, using a picker for epub, PDF, mobi and a slider to adjust megabytes.
Create a SwiftUI printed book form section with bindings for pages and hardcover, using a stepper and range inside a form, then integrate into the add book view.
Implement a save and cancel workflow in the add book view with a toolbar item in SwiftUI, supporting ebook and printed books.
Create a SwiftUI book row component that accepts a book parameter, displays title and author, differentiates ebooks from printed books, and styles with padding, alignment, and a conditional background color.
Create and wire the edit book view with a model context in swift data, load and update book data on appear, and enable a save button with a dismiss action.
Load the book into the edit view by setting title, author, and publish date, then handle ebook or printed book fields before updating and testing.
Learn to implement delete functionality in a filtered books list with context.delete and context.save to persist removals, and explore inheritance in Swift, SwiftUI, and SwiftData.
Mastering SwiftData for iOS: A Complete Guide to Data Management in Swift & SwiftUI
Unlock the full potential of SwiftData for iOS app development in this comprehensive course. Learn how to seamlessly integrate SwiftData with Swift and SwiftUI to build dynamic, data-driven iOS apps. Whether you're a beginner or an experienced iOS developer, this course will provide you with the essential skills needed to master modern data management techniques using Apple's powerful SwiftData framework.
Course Highlights:
SwiftData Fundamentals: Understand the core concepts of attributes, queries, fetch requests, and relationships to build efficient data models.
CRUD Operations: Learn to execute create, read, update, and delete operations with SwiftData's powerful tools for persistent data handling.
CloudKit Integration: Easily integrate CloudKit for seamless cloud-based storage and synchronization in your iOS apps.
MVVM & SwiftData: Understand the MVVM design pattern and explore its benefits in data-driven SwiftData apps. Discover how MVVM can help scale complex applications.
Queries, Filters, and Sorting: Use predicates, sort descriptors, and powerful fetch requests to filter and organize data efficiently.
Undo/Redo Manager: Implement the Undo/Redo feature and create a “Shake to Undo/Redo” functionality for better user experience.
Store Images with .externalStorage: Learn to manage image storage in apps by utilizing external storage options for better efficiency.
Dynamic SwiftUI Bindings: Bind SwiftData to SwiftUI components, dynamically updating views and managing state changes in real-time.
Performance Optimization: Use asynchronous data fetching and background processing to enhance performance and user experience.
Fun Projects: Build creative apps, such as a Mesh Gradient Editor, complete with code drag-and-drop functionality.
Why Take This Course?
This course offers practical, project-based learning, ensuring that you gain hands-on experience with SwiftData in real-world scenarios. Regularly updated with new projects and techniques, you’ll have the opportunity to stay on top of the latest trends and advancements in iOS development and SwiftUI.
By the end of this course, you'll have the skills and confidence to create data-rich iOS apps using SwiftData, SwiftUI, and CloudKit. Whether you're looking to build apps for personal use or aiming to launch them on the App Store, this course will give you the tools to succeed.
Happy Coding!
Ron