Class

INGetCarPowerLevelStatusIntentResponse

Your app’s response to a request for the car power level.

Declaration

class INGetCarPowerLevelStatusIntentResponse : INIntentResponse

Overview

Use an INGetCarPowerLevelStatusIntentResponse object to specify the result of a request for a car’s current power level. You create instances of this class when confirming or handling a car power level intent. Use this object to confirm that the request is valid and communicate whether the app was able to successfully get the power level data from the car, or to report any errors that occur.

You create an INGetCarPowerLevelStatusIntentResponse object in the confirm(intent:completion:) and handle(intent:completion:) methods of your handler object. For more information about implementing your handler object, see INGetCarPowerLevelStatusIntentHandling.

Topics

Initializing the Response Object

init(code: INGetCarPowerLevelStatusIntentResponseCode, userActivity: NSUserActivity?)

Initializes the response object with the specified code and user activity.

Getting the Response Code

var code: INGetCarPowerLevelStatusIntentResponseCode

The code indicating success or failure when confirming or handling an intent.

enum INGetCarPowerLevelStatusIntentResponseCode

Constants indicating the status of the response.

Providing the Power Level Information

var chargePercentRemaining: Float?

The percentage of charge remaining for electric cars.

var distanceRemaining: Measurement<UnitLength>?

The distance that the car can travel on the remaining charge or fuel.

var fuelPercentRemaining: Float?

The percentage of fuel remaining for fuel-powered cars.

var charging: Bool?

A Boolean value that indicates whether the car is currently charging.

var minutesToFull: Int?

The number of minutes it will take to charge the car’s battery to full.

Relationships

Inherits From

Conforms To

See Also

Get Car Power Level Status

protocol INGetCarPowerLevelStatusIntentHandling

The handler interface for requesting a car’s current power level.

class INGetCarPowerLevelStatusIntent

A request for the current power level of the user’s car.