Post

Replies

Boosts

Views

Activity

Reply to Method to capture voice input when using CPVoiceControlTemplate
I actually think I figured it out. It seems I need to capture the category before I change it: // Save previous category self.previousCategory = audioSession.category And then set it back before I stop the audio session being active: do { if let category = self.previousCategory { try audioSession.setCategory(category) } try audioSession.setActive(false, options: .notifyOthersOnDeactivation) } catch { print(error) } I no longer get the error that an audio session/object is running.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’25
Reply to Use Siri to control parts of my CarPlay app
Yes, just what I was looking for. Thank you. Question about this, I have a CPMapButton and added an accessiblityLabel but it does not seem to tap the button when I say "tap current location": lazy var currentLocationButton: CPMapButton = { let recenterButton = CPMapButton { [weak self] button in guard let self = self else { return } if let mapView = self.mapViewController?.mapView { mapView.setUserTrackingMode(.followWithCourse, animated: true, completionHandler: nil) } } recenterButton.accessibilityLabel = NSLocalizedString("Current Location", comment: "CarPlay: Current Location Button accessiblity") recenterButton.accessibilityHint = NSLocalizedString("Show the users current location on the map", comment: "CarPlay: Show current user location on the map") let bundle = Bundle.main recenterButton.image = UIImage(named: "carplay_locate", in: bundle, compatibleWith: traitCollection) return recenterButton }()
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’25