Book Image

Learn SwiftUI

By : Chris Barker
Book Image

Learn SwiftUI

By: Chris Barker

Overview of this book

SwiftUI is the new and powerful interface toolkit that lets you design and build iOS, iPadOS, and macOS apps using declarative syntax. It is a powerful way to develop the UI elements of applications, which would normally be tightly coupled to application logic. Learn SwiftUI will get you up to speed with the framework and cross-device UI development in no time. Complete with detailed explanations and practical examples, this easy-to-follow guide will teach you the fundamentals of the SwiftUI toolkit. You'll learn how to build a powerful iOS and iPadOS application that can be reused for deployment on watchOS. As you progress, you'll delve into UI and unit testing in iOS apps, along with learning how to test your SwiftUI code for multiple devices. The book will also show you how to integrate SwiftUI features such as data binding and network requests into your current application logic. By the end of this book, you will have learned how to build a cross-device application using the SwiftUI framework and Swift programming.
Table of Contents (17 chapters)

When to use SwiftUI, and why

When it comes to using SwiftUI, first off, you need to start by thinking of what type of app you're building. If you're looking to build the next shoot-em-up multiplayer game, then I'm afraid SwiftUI is not for you. However, anything else—from a banking app to a catalog app—can benefit immediately from Swift UI.

The afore mentioned declarative syntax allows for States to be used in order to allow effective but— more importantly—efficient reloads of data. For those familiar with UIKit's UICollectionViews or UITableViews, you'll know that writing logic to reload the whole table in order to change just one tiny value can be both tiresome and tedious.

Designers taking their first step into development will certainly benefit from SwiftUI, with top graphical design packages already rumored to be incorporating plugins that will allow SwiftUI syntax to be exported directly from the drawing board.

The term full-stack is often used (and overused) in the development industry, particularly with web developers. A frontend web developer would generally look after the design elements and visual construction of a site, such as HTML, Cascading Style Sheets (CSS), and presentation logic, with backend web developers concentrating more on core application logic, networking, and data layers.

This type of separation is not commonly seen in mobile app development, even though developers may follow the same, or similar, architecture patterns. Could SwiftUI be the first step toward acknowledging, and even achieving, full stack mobile app development?

As we'll find out in the next chapter, SwiftUI is perfect for beginners, either young or old. Interface and application logic can be written and designed in such a way it simply rolls off your tongue as you type, almost like painting by numbers.... but for developers.