Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI

Here’s a recap of the Live Q&A for SwiftUI foundations: Build great apps with SwiftUI. If you participated and asked questions, thank you for coming and participating! If you weren’t able to join us live we hope this recap is useful

Where can I watch the VOD? Is the sample code “Wishlist” that was shown available for download?

You can view the replay of the entire event here https://www.youtube.com/watch?v=Z3vloOtZLkQ

The sample code for the Wishlist app will be made available in the coming weeks on the Apple Developer website, we'll send an update via email when it is available.

What are the best practices when it comes to building complex navigations in SwiftUI?

The developer website has documentation on navigation style best practices. Explore navigation basics like NavigationStack and TabView to get a ground-up understanding. For documentation on navigation APIs see Navigation.

How can I integrate UIKit with my SwiftUI app? What about adding SwiftUI into my UIKit app?

See UIKit integration: Add UIKit views to your SwiftUI app, or use SwiftUI views in your UIKit app. Both UIKit and SwiftUI provide API to show a view hierarchy of the other.

Landmarks: Interfacing with UIKit walks you through step by step how to implement UIKit in SwiftUI with UIViewControllerRepresentable, and this WWDC22 video demonstrates UIHostingController, for those that want to add SwiftUI to their UIKit.

Does Wishlist feature a new iOS 26 font? How can I add custom fonts and text of my app?

We’re glad to hear many of you liked wide text shown in Wishlist, however, It is the default system font with some light SwiftUI styling! Check it out for yourself in the sample code when made available, and you can learn more about customizing fonts and text by seeing Font and Applying custom fonts to text.

Does Xcode have a dependency graph we can use to optimize our SwiftUI Views?

Xcode comes with Instruments. Instruments is the best way to figure out what is causing excessive updates and other issues with performance. That link provides direct tutorials and resources for how to use and understand. Previews also have many useful tools for analyzing SwiftUI views, for more info see Previews in Xcode

Check out this video from our latest WWDC Optimize SwiftUI performance with Instruments for information on how to use Instruments to profile and optimize your app with real-world applications

If you still have questions, Check out the Instruments section of these forums and create a post so the community has the opportunity to help guide you.

Are there UI debugging tools to help diagnose layout issues?

Yes, Xcode also features a View Debugger located by selecting the View Debug Hierarchy, pictured below. Use the View Debugger to capture and inspect your view hierarchy, identifying which views affect window sizing. The SwiftUI Inspector also lets you examine view frames and layout behavior.

See Diagnosing issues in the appearance of a running app to learn about debugging visual and layout issues.

As an absolute beginner, what would be the first go-to step to go for training? Do I need prior knowledge of frameworks to get started with SwiftUI?

A great place to learn how to develop for Apple platforms is with Pathways! Many developers start with Develop in Swift tutorials, which exposes you to several frameworks while teaching you the basics of SwiftUI. When you're ready to take your learning further, you can read the documentation for the specific frameworks that interest you at https://developer.apple.com/documentation/.

Can I make the view layout conditional based on device orientation? For example, responsively switching between HStack and VStack depending on if the device is in Portrait or Landscape mode?

Yes you can. In most scenarios you should prefer to make your SwiftUI view layouts conditional based on device orientation. Use AnyLayout to dynamically switch between layout containers based on orientation without destroying the state of your subviews.

AnyLayout lets you change layout type at runtime while preserving view identity and state. For example, you can switch between HStackLayout and VStackLayout based on the current size class or orientation, and SwiftUI maintains your view hierarchy seamlessly.

For the symbolEffect(_:options:value:) method for SF symbols, the animation only runs when the value changes. Is there a way to implement this behavior idiomatically in SwiftUI?

For animations that respond to value changes, use the animation(_:value:) modifier, which applies animations automatically when the specified value updates.


And the most asked question. Many of you on the forums already know this is a resource but I would like to echo their question here, in case anyone reading this is not aware:

Where can I ask questions or get code-level support with my project?

That would be here on the developer forums! I encourage you to utilize the wealth of knowledge and expertise available at your fingertips by joining discussion here on the forums. You can share code snippets, files, ask questions and have discussion with developers across the world.

Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI
 
 
Q