CMWaterSubmersionManager
An object for managing the collection of pressure and temperature data during submersion.
Declaration
class CMWaterSubmersionManagerMentioned in
Overview
Use this class to receive live depth, water pressure, and water temperature data on Apple Watch Ultra.
Start by assigning a usage description using the NSMotionUsageDescription key in your app target’s information property list. You also need to include an entitlement to access the live submersion data.
To access data for dives with a maximum depth of 6 m, add the Shallow Depth and Pressure capability to your app. For more information, see Adding capabilities to your app.
To enable a maximum depth of 40 m, you must apply for the full Submerged Depth and Pressure entitlement. For more information, see Express interest in the Submerged Depth and Pressure API.
Next, check whether submersion data is available.
guard CMWaterSubmersionManager.waterSubmersionAvailable else {
return false
}If the waterSubmersionAvailable property is true, instantiate a CMWaterSubmersionManager object and assign a delegate.
// Instantiate the submersion manager.
submersionManager = CMWaterSubmersionManager()
// Assign the submersion manager delegate.
submersionManager.delegate = selfYour delegate then begins receiving updates from the system. For more information, see Accessing submersion data.