# 23 : Equip Your App with Privacy Manifests

Published on

Get weekly handpicked updates on Swift and SwiftUI!

Weekly Comment

Apple recently notified developers submitting apps for review to include privacy manifest files in their apps if they use specific APIs. This requirement stems from the new policy introduced at WWDC 2023, aimed at compelling app developers and SDK producers to explicitly declare their app’s privacy practices. By May 1, 2024, apps that fail to provide a complete privacy manifest will not pass the App Store’s review process. Developers are required to provide clear privacy statements for the APIs or third-party libraries used, ensuring transparency and the protection of user privacy.

Besides the privacy manifest, developers were also required last week to verify and submit their app’s merchant identity proofs on the App Store in compliance with EU regulations. This new requirement sparked fresh discussions in the developer community, with many seeking guidance on how to determine their own status. Apple’s customer service advises consulting a legal advisor for clarity.

These updates reflect Apple’s continuous adjustments to global legal and regulatory changes, suggesting that developers may need to comply with more such regulations in the future. This undoubtedly adds an additional burden on small development teams. While the intent to protect consumer interests is commendable, regulators should provide clearer and more understandable guidelines. Moreover, there is a hope that Apple will introduce more intelligent features in its development tools to help developers streamline the process of creating necessary privacy manifests. This would not only effectively safeguard user privacy but also allow developers to focus more on creating exceptional app experiences, rather than being bogged down by complex compliance demands.

Originals

Tips and Considerations for Using Lazy Containers in SwiftUI

Fatbobman

In the SwiftUI framework, lazy layout containers such as List and LazyVStack provide an efficient way to display large datasets. These containers are ingeniously designed to dynamically build and load views only when necessary, thereby significantly optimizing the app’s performance and memory usage efficiency. This article will introduce the following tips and considerations aimed at empowering developers to enhance app responsiveness and resource management when utilizing SwiftUI’s lazy containers.

  • Custom Implementation Conforming to RandomAccessCollection
  • Implementing Infinite Data Loading
  • The Impact of the id Modifier on List’s Lazy Loading Mechanism
  • SwiftUI Only Retains the Top-Level State of ForEach Subviews in Lazy Containers
  • SwiftUI’s Passive Memory Resource Release for Specific State Types
Recent Selections

Swift Tooling: Windows Edition

The Browser Company

Swift is actively expanding its support for various platforms. Beyond Linux, its toolchain for the Windows platform is also gradually being perfected. This article, presented by The Browser Company — the developers of the Arc browser — provides a detailed overview of the tools and development experience for using the Swift programming language on the Windows platform. The Arc browser, which is developed using Swift, is currently in the process of developing its Windows version, indicating more opportunities for Swift developers to leverage the potential of the Swift language across different platforms.

To build mature applications, merely having a comprehensive development language toolchain is not sufficient; an appropriate UI framework is also needed. OpenSwiftUI is a project initiated by Kyle Ye, aimed at creating an open-source version of SwiftUI that can be used for GUI app development on non-Apple platforms. Although the project is still in its early stages, it has already made significant progress. We look forward to more developers’ attention and participation to collectively propel the development of this project.

Using environment variables in Swift

Tibor Bödecs

Environment variables are key-value pairs that influence app behavior, injected into the app’s runtime as part of the process environment. They can be set at the system level or customized by the user. These variables are commonly used for configuration purposes, such as setting values to distinguish between development, testing, and production environments, used as feature flags, or for storing keys separately from the app’s codebase. In this article, Tibor Bödecs explores the significance and application methods of using environment variables in Swift, providing a practical perspective to understand and implement environment variables, thereby enhancing the flexibility and security of app configuration.

Byte-sized Swift: Building Tiny Games for the Playdate

Rauhul Varma

In an era dominated by AAA titles, Playdate stands out with its retro hardware, distinctive body design, and unique crank interaction, offering players a novel gaming experience. The manufacturer also provides an SDK to support developers in creating new games for Playdate. In this article, Rauhul Varma shares his experience using Swift’s newly developed embedded language mode to create games for Playdate. He discusses not only the technical details of introducing Swift to a new platform, such as addressing calling conventions, CPU configuration, and memory layout discrepancies but also explains how to optimize the interaction between Swift and Playdate’s C API, creating an API layer that is more in line with Swift’s style, and explores its impact on game development.

Using @_silgen_name to Forward Declare Functions in Swift and Improve Build Times

Bruno Rocha

The @_silgen_name attribute grants developers the ability to forward-declare functions in Swift, allowing them to directly reference functions in the compiled binary that might be invisible in the current module. This mechanism is extensively used in the Swift standard library to implement a feature akin to forward declarations in Obj-C, enabling the library to call deeper functions within the Swift runtime. In this article, Bruno Rocha elaborates on how to utilize @_silgen_name for forward declaring functions and thereby optimize build times. He specifically notes that, as an underscored attribute, @_silgen_name might conceal numerous potential risks, and its behavior could unpredictably change or become deprecated in the future. Therefore, he advises using this attribute in projects only when fully aware of the possible consequences.

Global actors in Swift

Majid Jabrayilov

A global actor is essentially a special kind of actor that provides a unique global concurrency context for applications, with @MainActor being the most typical example. This means that all code marked with a global actor tag runs in the same serial execution context, which is particularly crucial for managing global state or synchronizing resources that must be serialized. In this article, Majid Jabrayilov explores the use of global actors in Swift and guides on how to customize global actors, such as creating a consolidated type collection for accessing local storage to ensure a conflict-free state of disk files. Although global actors are not frequently needed in everyday app development, they prove to be exceptionally useful in certain specific scenarios, such as main-thread rendering.

Weekly Swift & SwiftUI insights, delivered every Monday night. Join developers worldwide.
Easy unsubscribe, zero spam guaranteed