Skip to content

CarPlay iOS xcode13.3 beta1

Alex Soto edited this page Mar 7, 2022 · 2 revisions

#CarPlay.framework https://github.com/xamarin/xamarin-macios/pull/14325

diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInstrumentClusterController.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInstrumentClusterController.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInstrumentClusterController.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInstrumentClusterController.h	2022-01-25 13:04:20.000000000 -0500
@@ -0,0 +1,76 @@
+//
+//  CPInstrumentClusterController.h
+//  CarPlay
+//
+//  Copyright © 2021 Apple Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol CPInstrumentClusterControllerDelegate;
+
+typedef NS_ENUM(NSUInteger, CPInstrumentClusterSetting) {
+    CPInstrumentClusterSettingUnspecified,
+    CPInstrumentClusterSettingEnabled,
+    CPInstrumentClusterSettingDisabled,
+    CPInstrumentClusterSettingUserPreference,
+} API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos, watchos, tvos);
+
+API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos, watchos, tvos)
+@interface CPInstrumentClusterController : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+@property (nonatomic, weak) id<CPInstrumentClusterControllerDelegate> delegate;
+
+/**
+   The UIWindow created for this CPInstrumentClusterController
+*/
+@property (nullable, nonatomic, strong, readonly) UIWindow *instrumentClusterWindow;
+
+@property (nonatomic, readonly) CPInstrumentClusterSetting speedLimitSetting;
+@property (nonatomic, readonly) CPInstrumentClusterSetting compassSetting;
+
+/**
+ inactiveDescriptionVariants is an array of @c NSString to be displayed when the user is not actively navigating,
+ arranged from most to least preferred.
+ */
+@property (nonatomic, copy) NSArray <NSString *> *inactiveDescriptionVariants;
+
+/**
+ attributedInactiveDescriptionVariants is an array of @c NSAttributedString to be displayed when the user is not actively navigating,
+ arranged from most to least preferred.
+ 
+ @c attributedInactiveDescriptionVariants will be preferred over inactiveDescriptionVariants.
+ 
+ Only one attribute is presently supported: text attachments. You may annotate the string with an image
+ by including a text attachment. The maximum text attachment image size is 64x16 points.
+
+ @warning All attributes other than text attachment attributes will be removed from your attributed string.
+
+ @see +[NSAttributedString attributedStringWithAttachment:], -[NSTextAttachment image]
+ */
+@property (nonatomic, copy) NSArray <NSAttributedString *> *attributedInactiveDescriptionVariants;
+
+@end
+
+API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos, watchos, tvos)
+@protocol CPInstrumentClusterControllerDelegate <NSObject>
+
+- (void)instrumentClusterControllerDidConnectWindow:(UIWindow *)instrumentClusterWindow;
+- (void)instrumentClusterControllerDidDisconnectWindow:(UIWindow *)instrumentClusterWindow;
+
+@optional
+
+- (void)instrumentClusterControllerDidZoomIn:(CPInstrumentClusterController *)instrumentClusterController;
+- (void)instrumentClusterControllerDidZoomOut:(CPInstrumentClusterController *)instrumentClusterController;
+
+- (void)instrumentClusterController:(CPInstrumentClusterController *)instrumentClusterController didChangeCompassSetting:(CPInstrumentClusterSetting)compassSetting;
+- (void)instrumentClusterController:(CPInstrumentClusterController *)instrumentClusterController didChangeSpeedLimitSetting:(CPInstrumentClusterSetting)speedLimitSetting;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInterfaceController.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInterfaceController.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInterfaceController.h	2021-11-19 17:06:34.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPInterfaceController.h	2022-01-25 12:59:37.000000000 -0500
@@ -47,7 +47,7 @@
  */
 - (void)setRootTemplate:(__kindof CPTemplate *)rootTemplate
                animated:(BOOL)animated
-             completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+             completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Push a new template onto the template navigation hierarchy, showing it immediately.
@@ -59,7 +59,7 @@
  */
 - (void)pushTemplate:(__kindof CPTemplate *)templateToPush
             animated:(BOOL)animated
-          completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+          completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Pop back a single level in the template navigation hierarchy.
@@ -67,7 +67,7 @@
  The success parameter in the completion block indicates if any template was popped.
  */
 - (void)popTemplateAnimated:(BOOL)animated
-                 completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+                 completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Pop back to the first template in the template navigation hierarchy.
@@ -75,7 +75,7 @@
  The success parameter in the completion block indicates if any templates were popped.
  */
 - (void)popToRootTemplateAnimated:(BOOL)animated
-                       completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+                       completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Pop back to a specified template.
@@ -88,7 +88,7 @@
  */
 - (void)popToTemplate:(__kindof CPTemplate *)targetTemplate
              animated:(BOOL)animated
-           completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+           completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Present a template modally over the navigation hierarchy. Only one template may be presented at a time.
@@ -102,7 +102,7 @@
  */
 - (void)presentTemplate:(__kindof CPTemplate *)templateToPresent
                animated:(BOOL)animated
-             completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+             completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 /**
  Dismiss the current modally-presented template, optionally animating the dismissal.
@@ -113,7 +113,7 @@
  the boolean parameter will be YES. Otherwise, the boolean parameter will be NO and an @c NSError will be provided describing the failure.
  */
 - (void)dismissTemplateAnimated:(BOOL)animated
-                     completion:(nullable void (^)(BOOL, NSError * _Nullable))completion API_AVAILABLE(ios(14.0));
+                     completion:(nullable void (^)(BOOL success, NSError * _Nullable error))completion API_AVAILABLE(ios(14.0));
 
 #pragma mark - Template Access
 
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPManeuver.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPManeuver.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPManeuver.h	2021-11-19 17:06:36.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPManeuver.h	2022-01-25 13:04:22.000000000 -0500
@@ -24,6 +24,11 @@
 @property (nullable, nonatomic, strong) CPImageSet *symbolSet API_DEPRECATED_WITH_REPLACEMENT("symbolImage", ios(12.0, 13.0)) API_UNAVAILABLE(macos, watchos, tvos);
 
 /**
+ Takes precedence over @c guidanceBackgroundColor set in @c CPMapTemplate.
+ */
+@property (nullable, nonatomic, strong) UIColor *cardBackgroundColor API_AVAILABLE(ios(15.4));
+
+/**
  symbolImage is a @c UIImage representing the maneuver. Provide variants for UIUserInterfaceStyleLight and UIUserInterfaceStyleDark that will be used against light backgrounds and dark backgrounds.
  */
 @property (nullable, nonatomic, strong) UIImage *symbolImage;
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPNavigationSession.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPNavigationSession.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPNavigationSession.h	2021-11-19 10:27:04.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPNavigationSession.h	2022-01-25 13:04:21.000000000 -0500
@@ -39,6 +39,15 @@
 - (void)pauseTripForReason:(CPTripPauseReason)reason description:(nullable NSString *)description;
 
 /**
+ Pause the current trip.
+ 
+ @param reason The reason navigation was paused.
+ @param description An optional description of the pause reason. If @c nil, a system-provided string will be used.
+ @param turnCardColor An optional color of the pause card. If @c nil, will fallback to the @c guidanceBackgroundColor on @c CPMapTemplate. If no color is specified there, will default to a system-provided color.
+ */
+- (void)pauseTripForReason:(CPTripPauseReason)reason description:(nullable NSString *)description turnCardColor:(nullable UIColor *)turnCardColor API_AVAILABLE(ios(15.4));
+
+/**
  Finish the trip.
  */
 - (void)finishTrip;
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationInstrumentClusterScene.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationInstrumentClusterScene.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationInstrumentClusterScene.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationInstrumentClusterScene.h	2022-01-25 13:04:20.000000000 -0500
@@ -0,0 +1,46 @@
+//
+//  CPTemplateApplicationInstrumentClusterScene.h
+//  CarPlay
+//
+//  Copyright © 2021 Apple Inc. All rights reserved.
+//
+
+#import <CarPlay/CarPlay.h>
+#import <CarPlay/CPInstrumentClusterController.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@class CPTemplateApplicationInstrumentClusterScene;
+
+API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, watchos, tvos)
+@protocol CPTemplateApplicationInstrumentClusterSceneDelegate <UISceneDelegate>
+
+@optional
+
+/**
+The instrument cluster navigation scene has connected.
+*/
+- (void)templateApplicationInstrumentClusterScene:(CPTemplateApplicationInstrumentClusterScene *)templateApplicationInstrumentClusterScene didConnectInstrumentClusterController:(CPInstrumentClusterController *)instrumentClusterController;
+
+/**
+The instrument cluster navigation scene has connected.
+*/
+- (void)templateApplicationInstrumentClusterScene:(CPTemplateApplicationInstrumentClusterScene *)templateApplicationInstrumentClusterScene didDisconnectInstrumentClusterController:(CPInstrumentClusterController *)instrumentClusterController;
+
+@end
+
+API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, watchos, tvos)
+@interface CPTemplateApplicationInstrumentClusterScene : UIScene
+
+/**
+   The delegate for a CPTemplateApplicationInstrumentClusterScene must conform to the CPTemplateApplicationInstrumentClusterSceneDelegate protocol.
+*/
+@property (nullable, nonatomic, strong) id<CPTemplateApplicationInstrumentClusterSceneDelegate> delegate;
+
+@property (nonnull, nonatomic, strong, readonly) CPInterfaceController *interfaceController;
+
+@end
+
+// A session role which defines a typical interactive application in the CarPlay instrument cluster
+extern UISceneSessionRole const CPTemplateApplicationInstrumentClusterSceneSessionRoleApplication API_AVAILABLE(ios(15.0));
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationScene.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationScene.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationScene.h	2021-11-19 10:27:05.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPTemplateApplicationScene.h	2022-01-25 12:59:39.000000000 -0500
@@ -72,6 +72,8 @@
  */
 - (void)templateApplicationScene:(CPTemplateApplicationScene *)templateApplicationScene didSelectManeuver:(CPManeuver *)maneuver;
 
+- (void)contentStyleDidChange:(UIUserInterfaceStyle)contentStyle API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos, watchos, tvos);
+
 @end
 
 
@@ -93,6 +95,8 @@
  */
 @property (nonnull, nonatomic, strong, readonly) CPWindow *carWindow;
 
+@property (nonatomic, readonly) UIUserInterfaceStyle contentStyle API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(macos, watchos, tvos);
+
 @end
 
 // A session role which defines a typical interactive application on the car display
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CarPlay.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CarPlay.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CarPlay.h	2021-11-06 05:45:47.000000000 -0400
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CarPlay.h	2022-01-14 18:47:28.000000000 -0500
@@ -24,6 +24,7 @@
 #import <CarPlay/CPInterfaceController.h>
 #import <CarPlay/CPInformationItem.h>
 #import <CarPlay/CPInformationTemplate.h>
+#import <CarPlay/CPInstrumentClusterController.h>
 #import <CarPlay/CPInterfaceController.h>
 #import <CarPlay/CPListImageRowItem.h>
 #import <CarPlay/CPListItem.h>
@@ -47,6 +48,7 @@
 #import <CarPlay/CPTabBarTemplate.h>
 #import <CarPlay/CPTemplate.h>
 #import <CarPlay/CPTemplateApplicationDashboardScene.h>
+#import <CarPlay/CPTemplateApplicationInstrumentClusterScene.h>
 #import <CarPlay/CPTemplateApplicationScene.h>
 #import <CarPlay/CPTextButton.h>
 #import <CarPlay/CPTravelEstimates.h>
Clone this wiki locally