IFang Lee3 min

Swiftly Highlights: EU Updates, Performance Hacks & Building for Vision Pro

EngineeringFeb 8, 2024



Feb 8, 2024

IFang LeeiOS Engineer

Share this article

In the rapidly evolving Apple ecosystem, we’re happy to take on the role of your source for the freshest highlights, breakthroughs and trends. And boy, do we have a lot going on right now.

Apple x EU

Apple has released major updates to iOS, Safari and the App Store — specifically tailored for the EU

The move is in direct response to the region's Digital Markets Act (DMA). These changes provide developers with new options for app distribution, payment processing, web browser engine use, interoperability with iPhone/iOS and data access. However, these updates don't impact other regions, and developers in the EU can continue using the App Store as is without any required action. 

For the full scoop, swing by Apple's update announcement. Soon, we'll discover if EU users prefer alternative app stores and payment methods, or if they remain loyal to Apple's in-house options. 

Mandatory Privacy

Staying busy, Apple has also introduced privacy manifests, a feature of Apple's iOS 17 aimed to enhance transparency for app developers about data collection by third-party SDKs

By Spring 2024, compliance with these requirements will be mandatory for app submission in the App Store. To avoid rejection by Apple Review, we now have to follow key steps — to create a privacy manifest, understand its components and use it to generate a comprehensive privacy report. 

Review Guidelines

When it comes to Apple Review, it's essential to stay updated with the latest App Store Review Guidelines, updated on January 25, 2024. Newly introduced changes include the subdivision of certain guidelines for the Notarization of iOS apps in the EU, the deletion of several guidelines and revisions to others. 

Notable edits include a new requirement for mini apps, mini games, streaming games and plugins, and additional privacy features for login services. Plus, the original rule regarding streaming games has now been removed and replaced with a new guideline focusing on Apple Pay. Check out the guidelines in full. 

Apple Vision Pro

Quick summary: Apple Vision Pro was launched across U.S. Apple Stores on February 2, offering a revolutionary spatial computing experience that blends digital content with the real world. The launch includes a brand-new App Store featuring over 1 million compatible apps and more than 600 new experiences designed for Vision Pro. 

So how do we get to building an Apple Vision Pro app? 

A good place to start is by learning from those who’ve already done it. For instance, Paul Hudson describes his journey of developing and launching a visionOS app called Spatial Symphony. He outlines the process from ideation to prototyping and testing at Apple's Vision Pro labs. The app — a synthesizer controlled by hand movements — utilizes frameworks like AudioKit, ARKit and RealityKit, along with Swift and SwiftUI for development. Hudson shares insights on building with SwiftUI, the importance of testing on real devices, and the steps taken from prototype to the final app launch.

Performance: Problems, Solutions & Examples

AnyView in SwiftUI is a type-erased view beneficial for containing diverse view types without specifying each one's concrete type, simplifying code. However, it can cause performance issues. SwiftUI's diffing mechanism struggles with AnyView, often leading to full-view redraws. Apple recommends not using AnyView in ForEach, particularly in complex, endless lists like chat or activity feeds — due to these performance issues. 

Martin Mitrevski tested Stream's SwiftUI chat SDK, comparing the SDK's standard generics-based implementation with an AnyView version. He concluded that using concrete types for varied views in scrollable lists is more efficient and can be simpler than handling generics. Look into his article, which provides a comprehensive analysis of the trade-offs between code simplicity and efficiency.

If you're using ObservableObject in your SwiftUI project and find the automatic redraw of views and debugging to be challenging, The @Observable Macro — as introduced at WWDC 2023 — is indeed a game-changer and a significant advancement in SwiftUI development. 

Antoine van der Lee strongly suggests switching from ObservableObject to the @Observable Macro to effectively eliminate unnecessary redraws of SwiftUI views, leading to more efficient and streamlined app performance. He demonstrates how to replace ObservableObject and @Published with @Observable, while also explaining the functionality of @Observable and outlining its advantages over ObservableObject. However, he points out that @State remains essential for establishing a reliable single source of truth for model data in SwiftUI — and goes over the importance of using @State with @Observable.

That wraps up this round of Swiftly Highlights. I hope you found it informative and enjoyable. Catch you next time!

Share this article

Sign up to our newsletter

Monthly updates, real stuff, our views. No BS.