Book Image

SwiftUI Cookbook - Third Edition

By : Juan C. Catalan
5 (1)
Book Image

SwiftUI Cookbook - Third Edition

5 (1)
By: Juan C. Catalan

Overview of this book

SwiftUI is the modern way to build user interfaces for iOS, macOS, and watchOS. It provides a declarative and intuitive way to create beautiful and interactive user interfaces. The new edition of this comprehensive cookbook includes a fully updated repository for SwiftUI 5, iOS 17, Xcode 15, and Swift 5.9. With this arsenal, it teaches you everything you need to know to build beautiful and interactive user interfaces with SwiftUI 5, from the basics to advanced topics like custom modifiers, animations, and state management. In this new edition, you will dive into the world of creating powerful data visualizations with a new chapter on Swift Charts and how to seamlessly integrate charts into your SwiftUI apps. Further, you will be able to unleash your creativity with advanced controls, including multi-column tables and two-dimensional layouts. You can explore new modifiers for text, images, and shapes that give you more control over the appearance of your views. You will learn how to develop apps for multiple platforms, including iOS, macOS, watchOS, and more. With expert insights, real-world examples, and a recipe-based approach, you’ll be equipped to build remarkable SwiftUI apps that stand out in today’s competitive market.
Table of Contents (20 chapters)
18
Other Books You May Enjoy
19
Index

Using XCTest to test SwiftUI apps

When we build an app and implement the different features, we need to test that the app works correctly. Testing an app manually is a repetitive and time-consuming process, which becomes very boring. It is very common to make mistakes when performing boring and repetitive tasks. These mistakes could lead to the release of an app with defects to the App Store, affecting our users. Luckily, with the help of test automation, we can make Xcode test the app for us. Test automation is a very important discipline in software engineering and is based on the use of automated tests, with different levels of abstraction. The automated tests verify that the app under test works according to a well-known specification. Automated tests are a part of the software development process, and they verify that the code changes did not inadvertently introduce defects. With adequate automated test coverage, we have a higher confidence level, and we can catch the code defects...