From the course: iOS Development: Siri Shortcuts

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implementing CoffeeOrderDataManager

Implementing CoffeeOrderDataManager - iOS Tutorial

From the course: iOS Development: Siri Shortcuts

Start my 1-month free trial

Implementing CoffeeOrderDataManager

- [Instructor] At present, our CoffeeOrders are not persisted. Every time we run the application, we start fresh. But we can persist our CoffeeOrders in a database or a file-storage system. To make things simpler, we are simply going to use the userDefaults and put our CoffeeOrders in the userDefaults. To do that, I'm going to go ahead and add a new group, and I will call it Managers. Inside the Managers I'm going to go ahead and add a new file. Make sure that you select Swift File, and go ahead and add CoffeeOrderDataManager. You can call this anything you want, but since its duty is to perform with data and to interact with data, we're simply going to call it CoffeeOrderDataManager. We'll start with creating a class called CoffeeOrderDataManager, which will be responsible for getting all of the orders as well as saving the orders. In order to get the orders, we will create a new function called getAllOrders.…

Contents