识别焦虑和压力的情绪
Asked on 06/16/2025
2 searches
Apple's WWDC 2024 introduced several features related to mental wellbeing through the HealthKit API. One of the key highlights was the introduction of the "State of Mind" API, which allows developers to integrate mental health tracking into their apps. This API helps in identifying emotions and moods, which can be useful for recognizing feelings of anxiety and stress.
The "State of Mind" API includes parameters such as:
- Feeling Kind: Differentiates between a daily mood or a momentary emotion.
- Valence: A self-reported measure of how pleasant or unpleasant someone is feeling, on a scale from negative to positive.
- Labels: Descriptive terms for emotions, such as calm, stressed, or overwhelmed.
- Associations: Contextual factors contributing to the emotion, like work or family.
These features are designed to help users reflect on their emotional state, providing clinical benefits and promoting emotional awareness and resilience. The API can be used in various applications, not limited to mental health apps, to encourage mindfulness and reflection.
For more detailed information, you can refer to the session Explore wellbeing APIs in HealthKit (00:01:28) which covers the mental wellbeing APIs.

Explore wellbeing APIs in HealthKit
Learn how to incorporate mental health and wellbeing into your app using HealthKit. There are new APIs for State of Mind, as well as for Depression Risk and Anxiety Risk. We’ll dive into principles of emotion science to cover how reflecting on feelings can be beneficial, and how State of Mind can be used to represent different types of mood and emotion.

Enhanced suggestions for your journaling app
Find out how your journaling app can display journaling suggestions with richer content from the system. Explore new types of available content like state of mind data, reflection prompts, and support for third-party media content and motion-based activities.

Get started with HealthKit in visionOS
Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.