Chapter 13

Ten SwiftUI Tips and Tricks

IN THIS CHAPTER

check Seeing what you can do with SwiftUI

check Becoming a better SwiftUI developer

SwiftUI makes creating your iOS applications easy and efficient. However, there are neat tricks that are not so obvious. In this chapter, you learn some of these tips and tricks so that you can become a better SwiftUI developer.

Resuming Live Preview

My number-one pet peeve about SwiftUI is that the Live Preview feature in Xcode doesn’t always work. Very often, changes made to your code will cause the automatic previewing feature to pause. Even though your code is perfectly correct and there is no error, the Live Preview just can’t seem to update automatically.

Of course, you can click the Resume button to update the preview, but you waste precious time moving your mouse to click the button.

Tip A better way is to press ⌘  +Option+P. This causes the Live Preview to resume and update itself. Now that you know this trick, there is no reason to click the Resume button anymore!

Tip You may also want to check out the list of shortcuts for working in Xcode available ...

Get SwiftUI For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.