Book Image

SwiftUI Projects

By : Craig Clayton
Book Image

SwiftUI Projects

By: Craig Clayton

Overview of this book

Released by Apple during WWDC 2019, SwiftUI provides an innovative and exceptionally simple way to build user interfaces for all Apple platforms with the power of Swift. This practical guide involves six real-world projects built from scratch, with two projects each for iPhone, iPad, and watchOS, built using Swift programming and Xcode. Starting with the basics of SwiftUI, you’ll gradually delve into building these projects. You’ll learn the fundamental concepts of SwiftUI by working with views, layouts, and dynamic types. This SwiftUI book will also help you get hands-on with declarative programming for building apps that can run on multiple platforms. Throughout the book, you’ll work on a chart app (watchOS), NBA draft app (watchOS), financial app (iPhone), Tesla form app (iPhone), sports news app (iPad), and shoe point-of-sale system (iPad), which will enable you to understand the core elements of a SwiftUI project. By the end of the book, you’ll have built fully functional projects for multiple platforms and gained the knowledge required to become a professional SwiftUI developer.
Table of Contents (13 chapters)

Creating an account

We will work on one more screen, and that is where a user would create an account. As stated earlier, we will work on data, state-driven elements, and animations in Chapter 7, Financial AppCore Data. In this view, we will be saving the data entered into Core Data.

I broke this screen into five views – one we have already done (the card view). At the end of this section, you will be challenged to build another screen similar to this one:

Figure 6.12

Let's look at each view:

  • Account type view
  • Color button menu
  • Credit card type menu
  • Card view (previously done)
  • Form view

We will work with the account type view first. Let's get started there now.

Account type view

The account type view contains custom radio buttons. When the user selects Credit Card, we will make sure that credit limit is shown and if the account is a debit card, then we will hide CREDIT LIMIT. Open AccountTypeView...