Author: admin
-
An iOS 17 SwiftUI Core Data and CloudKit Tutorial
Using the CoreDataDemo project created in the chapter entitled A SwiftUI Core Data Tutorial, this chapter will demonstrate how to add CloudKit support to an Xcode project and migrate from Core Data to CloudKit-based storage. This chapter assumes that you have read the chapter entitled An Introduction to Core Data and SwiftUI. Enabling CloudKit Support…
-
An Overview of SwiftUI Core Data and CloudKit Storage
CloudKit provides a way for apps to store cloud-based databases using iCloud storage so that it is accessible across multiple devices, users, and apps. Although initially provided with a dedicated framework that allows code to be written to directly create, manage and access iCloud-based databases, the recommended approach is now to use CloudKit in conjunction…
-
An iOS 17 SwiftUI Core Data Tutorial
Now that we have explored the concepts of Core Data, it is time to put that knowledge to use by creating an example app project. In this project tutorial, we will create a simple inventory app that uses Core Data to persistently store the names and quantities of products. This will include the ability to…
-
An Introduction to Core Data and SwiftUI
A common requirement when developing iOS apps is to store data in some form of structured database. One option is to directly manage data using an embedded database system such as SQLite. While this is a perfectly good approach for working with SQLite in many cases, it does require knowledge of SQL and can lead…
-
A SwiftUI Grid and GridRow Tutorial
The previous chapter introduced LazyHGrid, LazyVGrid, and GridItem views and explored how they can be used to create scrollable multicolumn layouts. While these views can handle large numbers of rows, they lack flexibility, particularly in grid cell arrangement and positioning. In this chapter, we will work with two grid layout views (Grid and GridRow) that…
-
A SwiftUI NavigationSplitView Tutorial
The previous chapter introduced us to the SwiftUI NavigationSplitView component and described how multicolumn navigation is implemented and configured. This chapter will take what we have learned about NavigationSplitView and use it to create an example iOS app project. About the Project This tutorial will create the three-column split navigation app illustrated in the previous…
-
Multicolumn Navigation in SwiftUI with NavigationSplitView
The NavigationStack and NavigationLink views outlined in the previous chapters are ideal for adding navigation when each destination view needs to fill the entire device screen. While this is generally the preferred navigation paradigm when working on most iOS devices, it doesn’t take advantage of larger display configurations available on the iPad or the iPhone…
-
An Introduction to Swift Actors
Structured concurrency in Swift provides a powerful platform for performing multiple tasks at the same time, greatly increasing app performance and responsiveness. One of the downsides of concurrency is that it can lead to problems when multiple tasks access the same data concurrently, and that access includes a mix of reading and writing operations. This…
-
An Overview of Swift Structured Concurrency
Concurrency can be defined as the ability of software to perform multiple tasks in parallel. Many app development projects will need to make use of concurrent processing at some point and concurrency is essential for providing a good user experience. Concurrency, for example, is what allows the user interface of an app to remain responsive…
-
Understanding Error Handling in Swift
In a perfect world, a running iOS app would never encounter an error. The reality, however, is that it is impossible to guarantee that an error of some form or another will not occur at some point during the execution of the app. It is essential, therefore, to ensure that the code of an app…