Book Image

Build an iOS 16 Coffee Shop Application Using SwiftUI and Firebase [Video]

By : David Kababyan
Book Image

Build an iOS 16 Coffee Shop Application Using SwiftUI and Firebase [Video]

By: David Kababyan

Overview of this book

In this course, we will build a real online coffee shop ordering application using SwiftUI. You will learn how to build an application from scratch using iOS, SwiftUI, and XCode. The course explains how to write clean and readable code and structure our app development to be able to reuse the code for a long time. As part of the course, we will cover concepts such as setting up the TabView, creating a model and dummy drinks, creating a HomeView model and Firebase repository, creating a Drinks row, Async image, the drinks detailed view, and a basket view model. We will create different views to include the basket view, empty basket view, and account view. You will learn to secure storage and save users to a keychain. We will advance to create a Firebase app, save the menu to Firebase, and set up a Firebase repository, create orders, and more. Upon completion of the course, you will independently be able to build your very own coffee shop application that can choose items, place orders, pay, and save users to storage using Xcode, SwiftUI, and Firebase.
Table of Contents (1 chapters)
Chapter 1
Building the App
Content Locked
Section 10
Basket View Model
In this video, we will create a basket view model for your coffee shop application. We begin by creating a BasketItem struct that will represent an item in the user's cart, and a BasketViewModel for the functions needed to manage the cart. We will then add functions to the BasketViewModel to add/remove items from the cart, calculate the total price of the items in the cart, and place an order.