how to create @something property attribute?
Asked on 08/06/2024
1 search
To create a @something
property attribute, you can refer to the session on "Create custom visual effects with SwiftUI" where the new text attribute protocol is introduced. This protocol allows you to pass data from your text to your text renderer. Here's a brief overview of how you can implement a custom attribute:
- Define the Attribute: Implement the new text attribute protocol.
- Apply the Attribute: Use the custom attribute text modifier to mark the text with your custom attribute.
For a detailed example, you can check out the session Create custom visual effects with SwiftUI (18:31).
If you need more information on attributes in different contexts, you might also find the following sessions useful:
- Support semantic search with Core Spotlight for creating searchable items with attributes.
- What’s new in App Intents for specifying attributes in app intents.
These sessions provide a comprehensive understanding of how to work with attributes in various scenarios.

Bring your app to Siri
Learn how to use App Intents to expose your app’s functionality to Siri. Understand which intents are already available for your use, and how to create custom intents to integrate actions from your app into the system. We’ll also cover what metadata to provide, making your entities searchable via Spotlight, annotating onscreen references, and much more.

Catch up on accessibility in SwiftUI
SwiftUI makes it easy to build amazing experiences that are accessible to everyone. We’ll discover how assistive technologies understand and navigate your app through the rich accessibility elements provided by SwiftUI. We’ll also discuss how you can further customize these experiences by providing more information about your app’s content and interactions by using accessibility modifiers.

Support semantic search with Core Spotlight
Learn how to provide semantic search results in your app using Core Spotlight. Understand how to make your app’s content available in the user’s private, on-device index so people can search for items using natural language. We’ll also share how to optimize your app’s performance by scheduling indexing activities. To get the most out of this session, we recommend first checking out Core Spotlight documentation on the Apple Developer website.