SwiftUI by Tutorials | raywenderlich.com


Construct fluid and interesting declarative UI to your apps — utilizing much less code — with SwiftUI!

SwiftUI by Tutorials is designed that can assist you discover ways to transition from the “previous approach” of constructing your app UI with UIKit, to the “new approach” of constructing responsive UI with fashionable declarative syntax with SwiftUI.
This e-book is for readers who’re comfy constructing Swift apps, and need to make the thrilling leap into constructing their app UI with fashionable, declarative code.

What’s SwiftUI?

SwiftUI permits you to construct higher apps, sooner, and with much less code. It’s a developer’s dream come true!
With SwiftUI, you possibly can design your person interfaces in a declarative approach; as an alternative of growing app interfaces in an crucial approach, by coding all the software state logic earlier than time, you possibly can as an alternative outline what your app’s UI ought to do in a selected state and let the underlying OS work out how to do it.
What’s extra is that SwiftUI permits you to construct fashionable, responsive UI and animations for all Apple units — not simply iOS. So whether or not you’re constructing apps for iOS, watchOS, tvOS or every other Apple platform, you should utilize the identical concise, pure language to explain your UI and have it look gorgeous — regardless of the place your code runs.
As well as, SwiftUI’s built-in computerized assist for issues equivalent to darkish mode, localization and accessibility, together with Xcode 11 assist for drag-and-drop design and instantaneous preview makes it simpler to construct apps than ever earlier than.

How is that this e-book completely different than SwiftUI Apprentice?

Our different e-book on getting began with SwiftUI, SwiftUI Apprentice, is designed to show new builders the way to construct iOS apps, utilizing a SwiftUI-first method. The aim of that e-book is to show you elementary improvement practices as you construct out some fully-functional and great-looking apps!
This e-book, SwiftUI by Tutorials, is designed for builders who’ve a stable background in iOS improvement, and need to make the leap from constructing apps with UIKit, to constructing apps with SwiftUI.

Earlier than You Start

This part tells you a number of issues you have to know earlier than you get began, equivalent to what you’ll want for {hardware} and software program, the place to search out the undertaking information for this e-book, and extra.

Part I: Diving Into SwiftUI

Begin your SwiftUI journey with the foundations you want.

On this chapter, you may get an outline of the e-book as an entire, in addition to the apps you can be constructing as you study the basics of SwiftUI!

Get began with SwiftUI! Study in regards to the fundamental terminology, and uncover the facility of constructing your interface instantly within the preview canvas. Test how SwiftUI makes declarative improvement simple and easy, and how one can drag and drop as you used to do with storyboards.

SwiftUI’s declarative fashion makes it simple to implement eye-catching designs. You may create reusable modifiers to unify your design. On this chapter, you may implement a neumorphic Figma design for RGBullsEye.

Everyone knows how necessary testing is in fashionable software improvement.
See the way to apply UI Testing to your SwiftUI apps on this quite simple, but highly effective course.

Part II: Constructing Blocks of SwiftUI

Construct on what you may have discovered in Part I to start utilizing SwiftUI in additional complicated and superior apps.

Learn to add and configure completely different SwiftUI controls inside your apps. Uncover modifiers in a sensible approach and the way they are often shared throughout controls or used individually. Get an introduction to container views and the way to use them with SwiftUI.

Study a number of the primary and most used controls in person interfaces equivalent to TextFields, Buttons, Toggles, Sliders and Steppers, and the way to use them with SwiftUI.

Study the highly effective capabilities of vertical and horizontal stacks. See how simple it’s to use them to your app structure and to nest them to generate nearly any attainable mixture. Stacks are again stronger than earlier than and can for certain turn into a game-changer in SwiftUI.

Part III: State & Knowledge Movement

Find out how your person interface reacts to information circulation and state modifications.

Learn to bind information to the UI, develop reactive updates of the UI by means of state administration, and in-depth utilization of the attributes associated to SwiftUI.

Learn to bind information to the UI, about reactive updates to the UI by means of state administration, and in-depth utilization of the attributes associated to SwiftUI.

On this chapter, you’ll increase your information by studying extra superior enter controls like calendar and coloration pickers. Additionally, you will get to know the way to persist the data with an outline of App Storage.

Learn to set off updates on the interface, together with the way to simply check a SwiftUI interface, the way to handle the circulation of screens all through a posh app, and the way to take care of gestures, together with the event of a customized gesture.

Learn to navigate your app with VoiceOver on an iOS machine and use the SwiftUI Accessibility API attributes to enhance your app’s accessible UI. You will add labels that present context for UI parts and enhance VoiceOver info by reordering, combining or ignoring baby parts.

Part IV: Navigation & Knowledge Show

Transfer by means of your app screens with SwiftUI and uncover the way to show information in them.

You’ll find out about completely different strategies of permitting your person to navigate between views in your app, making a navigation hierarchy, and utilizing tabbed navigation to show info.

Displaying lists of information is a should in nearly any app. Right here you’ll discover ways to take care of all kinds of lists to get one of the best out of them.

This chapter exhibits you further options accessible for lists launched in SwiftUI 3.0.

On this chapter, you may discover the brand new grid performance in SwiftUI and use it to create extra versatile and sophisticated layouts with much less effort than utilizing stacks.

Typically you may want to indicate (or not) a view relying on sure situations. Consider an alert message, for instance. You need to use them to focus the customers’ consideration and request quick suggestions from them.

Part V: UI Extensions

Push ahead your SwiftUI information with complicated interfaces implementing animations and customized graphics.

Learn to draw with using paths, shapes and geometry. Observe alongside to design your individual parts.

Study the essential ideas for animating views utilizing SwiftUI. Learn to apply animations to view transitions, the way to animate state modifications, and the way to mix and chain these animations.

On this chapter, you’ll discover ways to develop extra complicated interfaces. Get out of your consolation zone and dive into extra superior ideas that can will let you generate nearly any UI you possibly can think about. You’ll study the restrictions it’s possible you’ll discover whereas growing superior SwiftUI interfaces.

Part VI: SwiftUI for macOS

Learn to implement all you understand of SwiftUI in macOS desktop purposes.

Learn to create a document-based Mac app. Perceive the way to deal with completely different file sorts and the way to use a wide range of customary Mac UI parts.

Begin with an present iOS app and discover ways to re-use code, views and belongings for making a macOS app. Discover out what works as is, and what you have to change for the Mac.