Build flexible and attractive declarative UIs for your apps with less code using SwiftUI!
SwiftUI in the tutorial is designed to help you learn how to transition from the “old way” of building app UIs using UIKit to the “new way” of building responsive UIs with a modern declarative syntax using SwiftUI. This book is for readers who are familiar with building Swift apps and want to take an exciting leap forward in building app UIs with modern declarative code.
What is SwiftUI?
With SwiftUI, you can build faster and better apps with less code. A developer’s dream come true! SwiftUI lets you design user interfaces in a declarative way. Instead of developing your app interface in an imperative way, you can precode all your application state logic to define your app’s UI. should Do it in a specific state and let the underlying OS figure it out. how In order to. What’s more, SwiftUI lets you build modern, responsive UIs and animations. all iOS as well as Apple devices. So, whether you’re building apps for iOS, watchOS, tvOS, or other Apple platforms, you can use the same concise and natural language to describe your UI and make it look great wherever your code runs. Plus, building apps has never been easier with SwiftUI’s built-in automatic support for things like dark mode, localization, and accessibility, along with Xcode 11 support for drag-and-drop design and instant previews.
How is this book different from SwiftUI Apprentice?
Another book on getting started with SwiftUI, SwiftUI Apprentice, is designed to teach new developers how to build iOS apps using the SwiftUI-first approach. The goal of this book is to teach you the basics of development when it comes to building fully functional and looking great apps! this book, SwiftUI by tutorial, designed for developers who have a solid background in iOS development and want to jump from building apps with UIKit to building apps with SwiftUI.
This section tells you a few things you need to know before you start, such as what you will need for your hardware and software, and where to find the project files for this book.
Section I: Dive into SwiftUI
Start your SwiftUI journey with the foundation you need.
This chapter gives you an overview of the whole book and the apps you’ll be building while learning the basics of SwiftUI!
Get started with SwiftUI! Learn the basics and discover the power of building interfaces directly from the preview canvas. See how SwiftUI makes declarative development easy and simple, and how drag-and-drop just like you do with storyboards.
SwiftUI’s declarative style makes it easy to implement eye-catching designs. You can unify your designs by creating reusable modifiers. In this chapter, we will implement a pneumatic Figma design for RGBullsEye.
We all know how important testing is in modern application development. See how to apply UI testing to SwiftUI apps in this very simple yet powerful course.
Section II: Building Blocks in SwiftUI
If you want to start using SwiftUI in more complex and advanced apps, build on what you learned in Section I.
Learn how to add and configure various SwiftUI controls within your app. Discover modifiers in practical ways and learn how to share them between controls or use them individually. Learn an introduction to container views and how to use them with SwiftUI.
Learn about the most used key controls in user interfaces, such as TextFields, Buttons, Toggles, Sliders, and Steppers, and how to use them with SwiftUI.
Discover the power of vertical and horizontal stacking. Adapt to your app layout and see how easy it is to nest them to create almost any possible combination. The stack is more powerful than ever before and it will definitely be a game changer for SwiftUI.
Section III: State and Data Flow
Learn how the user interface reacts to data flow and state changes.
Learn how to bind data to the UI, develop responsive updates of the UI through state management, and deep use of SwiftUI-specific properties.
Learn how to bind data to a UI, post-update UI through state management, and deep use of properties related to SwiftUI.
In this chapter, you will expand your knowledge by learning advanced input controls such as calendars and color pickers. You’ll also learn how to persist information through an overview of App Storage.
Learn how to easily test SwiftUI interfaces, manage screen flow across complex apps, and trigger updates in interfaces, including handling gestures, including developing custom gestures.
Navigate your app with VoiceOver on iOS devices and learn how to use SwiftUI accessibility API properties to improve your app’s accessibility UI. Improve VoiceOver information by adding labels that provide context for UI elements and rearranging, combining, or ignoring sub-elements.
Section IV: Explore and Display Data
Learn how to move app screens and display data on screens with SwiftUI.
Learn about the different ways to allow users to navigate between views in your app, create navigation hierarchies, and display information using tab navigation.
Displaying a list of data is a must for almost any app. Here you will learn how to process all kinds of lists to get the best results.
This chapter shows the additional features available to the list introduced in SwiftUI 3.0.
In this chapter, we will explore the new grid features in SwiftUI and use them to create more flexible and complex layouts with less effort than using stacks.
Sometimes a view may or may not be displayed depending on certain conditions. Consider, for example, a warning message. You can use it to focus your users’ attention and ask for immediate feedback.
Section V: UI Extensions
Advance your SwiftUI knowledge with complex interfaces that implement animations and custom graphics.
Learn to draw using paths, shapes, and geometry. Follow along and design your own elements.
Learn the basic concepts for animating views using SwiftUI. Learn how to animate view transitions, animate state changes, and combine and link these animations.
In this chapter, you will learn how to develop more complex interfaces. Step outside the familiar realm and dive into advanced concepts that can create almost any UI imaginable. You will learn the limitations you may discover while developing advanced SwiftUI interfaces.
Section VI: SwiftUI for macOS
Learn how to implement everything you know about SwiftUI in your macOS desktop application.
Learn how to create document-based Mac apps. Understand how to handle different file types and how to use the different standard Mac UI elements.
Start with an existing iOS app and learn how to reuse code, views, and assets to create macOS apps. Find out what works as is and what you need to change on your Mac.