▶Book Description
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.
▶What You Will Learn
- Explore the fundamentals of SwiftUI and compare it with existing UI frameworks
- Write SwiftUI syntax and understand what should and shouldn't be included in SwiftUI's layer
- Add text and images to a SwiftUI view and decorate them using SwiftUI's modifiers
- Create basic forms, and use camera and photo library functions to add images to them
- Understand the core concepts of Maps in iOS apps and add a MapView in SwiftUI
- Design extensions within your existing apps to run them on watchOS
- Handle networking calls in SwiftUI to retrieve data from external sources
▶Key Features
- Use SwiftUI for building dynamic apps for Apple devices from scratch
- Understand declarative syntax in cross-platform development and how states work within SwiftUI
- Learn to develop watchOS apps by reusing SwiftUI code
▶Who This Book Is For
This SwiftUI book helps any mobile app developer looking to understand the fundamentals of the new SwiftUI framework along with the benefits of cross-device development. A solid understanding of iOS and macOS app development, along with some knowledge of the Swift programming language, will be beneficial. Basic programming knowledge is essential to grasp the concepts covered in the book effectively.
▶What this book covers
- Chapter 1, Getting Started with SwiftUI, offers an introduction to the Swift programming language and the SwiftUI framework.
- Chapter 2, Understanding Declarative Syntax, provides details on declarative syntax and how this works in SwiftUI.
- Chapter 3, Building Layout and Structure, discusses the architecture and design patterns that can be used with SwiftUI.
- Chapter 4, Creating Your First Application, gives you an introduction to Xcode and shows how to create your very first project.
- Chapter 5, Understanding Controls, Views, and Lists, is where we start to build a recipe app, learning about the core components available to us in SwiftUI.
- Chapter 6, Working with Navigation in SwiftUI, sees us adding navigation to our recipe app and moving from one view to another.
- Chapter 7, Creating a Form with States and Data Binding, covers how to create an input form and teaches you how to use states and binding.
- Chapter 8, Networking and Linking to Your Existing App Logic, discusses adding a network layer and calling our app to retrieve data from an external source.
- Chapter 9, Maps and Location Services, sees us working with MapKit and Location Services in SwiftUI.
- Chapter 10, Updating for iPad with NavigationViewStyle, covers updating our recipe app to support the iPad.
- Chapter 11, SwiftUI on watchOS, shows how to add a watchOS companion app to our recipe app.
- Chapter 12, SwiftUI versus UIKit, covers comparisons between common UIKit and SwiftUI controls.
- Chapter 13, Basic Animation in Views, touches on the basic animations available to us in SwiftUI.
- Chapter 14, Animations in Transitions, allows you to learn how transitions work in SwiftUI alongside animations.
- Chapter 15, Testing in SwiftUI, covers how to do UI and unit testing in Swift UI and looks at some of the debugging features available in Xcode 11+.