Learn Swift and iOS Development
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Learn Swift and iOS development through comprehensive video guides
Showing 373 to 384 of 420 posts
8:16
To help users manage their notes, it's helpful to allow them to categorize their notes. Earlier in this series, we added the Category entity to the data model. Remember that a note can belong to only one category, but a category can have many notes. In other words, the Note and Category entities have a One-To-Many relationship. The data model editor visualizes this.
in Core Data
6:13
To update the table view, we listened for notifications sent by the managed object context of the Core Data manager. This is a perfectly fine solution. But it can be messy to sift through the managed objects contained in the userInfo dictionary of the notification. In a complex Core Data application, the NSManagedObjectContextObjectsDidChange notification is sent very frequently. It includes every change of every managed object, even the ones we may not be interested in. We need to make sure we only respond to the changes of the managed objects we are interested in.
in Core Data
7:03
The application now supports creating, reading, updating, and deleting notes. And this works fine. But Core Data has another trick up its sleeve.
in Core Data
1:38
The application currently supports creating, reading, and updating notes. But it should also be possible to delete notes. The pieces we need to add the ability to delete notes are already present in the notes view controller. In fact, we only need to implement one additional method of the UITableViewDataSource protocol to add support for deleting notes.
in Core Data
8:32
The application we're building wouldn't be very useful if it didn't include the ability to edit notes. Would it? If the user taps a note in the notes view controller, they should be able to modify the title and contents of the note.
in Core Data
8:22
In this episode, we fetch the user's notes from the persistent store and display them in a table view. The notes view controller is in charge of these tasks.
in Core Data
3:17
You may be wondering why we didn't save the note immediately after creating it. That's a fair question. We could have. But why would we? Why would we push the changes of the managed object context to the persistent store every time something changes in the managed object context? That's a waste of resources and it may even impact performance, depending on the complexity of the operation.
in Core Data
4:00
In the next episodes, we add the ability to create, read, update, and delete notes. Before we start, we need to make some preparations.
in Core Data
3:53
In the previous episode, we used the NSManagedObject class to represent and interact with records stored in the persistent store. This works fine, but the syntax is verbose, we can't take advantage of Xcode's autocompletion, and type safety is also an issue.
in Core Data
8:44
Core Data records are represented by the NSManagedObject class, a key class of the framework. In this episode, you learn how to create a managed object, what classes are involved, and how a managed object is saved to a persistent store.
in Core Data
6:41
Core Data is much more than a database and this becomes clear when you start working with relationships. Relationships in Core Data are powerful because the framework does a lot of the heavy lifting for you.
in Core Data
6:36
Core Data is great at managing relationships. In this episode, we continue our exploration of the data model by taking a close look at relationships.
in Core Data