I am trying to use CPVoiceControlState and include an animated image, but for the life of me I cannot figure out what sort of image it wants. I have tried animated .gif, .png, a static image, an image sequence and none seem to animate.
Here is what I am using with an animated .png:
func showLoadingTemplate() {
enum VoiceControlStates: String {
case loading = "loading"
}
let spinner = UIImage(named: "spinner")
loadingTemplate = CPVoiceControlTemplate(voiceControlStates: [
CPVoiceControlState(identifier: VoiceControlStates.loading.rawValue, titleVariants: [NSLocalizedString("Loading...", comment: "CarPlay: Loading")], image: spinner, repeats: true)
])
loadingTemplate?.activateVoiceControlState(withIdentifier: VoiceControlStates.loading.rawValue)
if let loading = loadingTemplate {
currentInterfaceController?.presentTemplate(loading, animated: true, completion: { (result: Bool, error: Error?) in
})
}
}
This shows the image but it isn't animating.
Can anyone let me know what sort of image needs to be used in order to get it to animate? I have seen animated images working in Waze and Google Maps so if must be possible.