Learn all about how to save your locations on the device using Core Data, the object persistence framework…
iOS & Swift
Chapter in UIKit Apprentice
Image Picker
Dec 18 2024 · Chapter
…background” notifications through NotificationCenter that you can configure the view controller to listen to. Earlier you used the notification center to observe notifications from Core Data. This time you’ll listen for the UIScene.didEnterBackgroundNotification notification. ➤ In LocationDetailsViewController.swift, add a new method: func listenForBackgroundNotification() { NotificationCenter.default.addObserver( forName: UIScene.didEnterBackgroundNotification, object: nil, queue: OperationQueue.main…
iOS & Swift
Chapter in UIKit Apprentice
The Locations Tab
Dec 18 2024 · Chapter
…show the data that you're now able to save via Core Data as a list of locations. Learn about TableView sections, NSFetchedResults and deleting tagged locations…
iOS & Swift
Chapter in UIKit Apprentice
Polishing the App
Dec 18 2024 · Chapter
…apps, while the Swift Apprentice books focus more on the Swift language itself. https://www.kodeco.com/books/swift-apprentice-fundamentals and https://www.kodeco.com/books/swift-apprentice-beyond-the-basics There are several good Core Data beginner books on the market. Here are two recommendations: Core Data by Tutorials by Team Kodeco. One of the few Core Data books that…
iOS & Swift
Chapter in UIKit Apprentice
Get Location Data
Dec 18 2024 · Chapter
…show the user’s favorite locations on a map, the iPhone’s camera and photo library to attach photos to these locations, and finally, Core Data to store everything in a database. Phew, that’s a lot of stuff! The finished app looks like this: The MyLocations app MyLocations lets…
iOS & Swift
Chapter in UIKit Apprentice
Maps
Dec 18 2024 · Chapter
…protocol. ➤ Change the class line from Location+CoreDataClass.swift to: public class Location: NSManagedObject, MKAnnotation { Just because Location is an object that is managed by Core Data doesn’t mean you can’t add your own stuff to it. It’s still an object! Exercise: Xcode now says “Cannot find type…
iOS & Swift
Chapter in UIKit Apprentice
Introduction
Dec 18 2024 · Chapter
…location-aware app that lets you keep a list of spots that you find interesting. In the process, you’ll learn about Core Location, Core Data, Map Kit, and much more! App 4: StoreSearch Mobile apps often need to talk to web services and that’s what…
iOS & Swift
Chapter in UIKit Apprentice
The Tag Location Screen
Dec 18 2024 · Chapter
Time to get back to coding again. You'll learn how to build the Tag Location screen and how to set up another data entry…
iOS & Swift
Chapter in UIKit Apprentice
The Detail Pop-up
Dec 18 2024 · Chapter
…existing screen using a presentation controller, use Dynamic Type to change the fonts based on the user’s preferences, draw your own gradients with Core Graphics, and learn to make cool keyframe animations. Fun times ahead! This chapter will cover the following: The new view controller: Create the bare minimum…
iOS & Swift
Chapter in UIKit Apprentice
Use Location Data
Dec 18 2024 · Chapter
You were able to access location data and display it in the last chapter. In this chapter, you will improve upon that code by handling…
iOS & Swift
Chapter in UIKit Apprentice
Swift Review
Dec 18 2024 · Chapter
String is a collection of Characters. UInt. A variation on Int that you may encounter occasionally. The U stands for unsigned, meaning the data type can hold positive values only. It’s called unsigned because it cannot have a negative sign (-) in front of the number. UInt can store numbers…
iOS & Swift
Chapter in UIKit Apprentice
Asynchronous Networking
Dec 18 2024 · Chapter
…come up with some way to let the table view’s data source know that the app is currently in a state of downloading data from the server. The simplest way to do that is to add another boolean flag. If this variable is true, then the app is downloading…
iOS & Swift
Chapter in UIKit Apprentice
UI Improvements
Dec 18 2024 · Chapter
…that are provided by iOS that you as a programmer can use to write apps. The iOS API consists of everything from UIKit, Foundation, Core Graphics, and so on. Likewise, when people talk about “the Facebook API” or “the Google API”, they mean the services that these companies provide that…
iOS & Swift
Chapter in UIKit Apprentice
Adding Polish
Dec 18 2024 · Chapter
…navigation controller’s content view. So far, when you’ve made your own objects, they have always been view controllers or data model objects, but it’s also possible to make your own views. Often, using the standard buttons and labels is sufficient. But when you want to do something…