Skip to content

CarPlay iOS xcode13.0 beta5

Manuel de la Pena edited this page Aug 16, 2021 · 3 revisions

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

diff -ruN /Applications/Xcode_13.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListSection.h /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListSection.h
--- /Applications/Xcode_13.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListSection.h	2021-07-22 14:22:53.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListSection.h	2021-08-09 03:25:59.000000000 -0400
@@ -86,7 +86,7 @@
  */
 
 @property (nullable, nonatomic, readonly, copy) NSString *headerSubtitle API_AVAILABLE(ios(15.0));
-@property (nullable, nonatomic, readonly, copy) UIImage *headerImage API_AVAILABLE(ios(15.0));
+@property (nullable, nonatomic, copy) UIImage *headerImage API_AVAILABLE(ios(15.0));
 @property (nullable, nonatomic, readonly, copy) CPButton *headerButton API_AVAILABLE(ios(15.0));
 
 /**
diff -ruN /Applications/Xcode_13.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListTemplate.h /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListTemplate.h
--- /Applications/Xcode_13.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListTemplate.h	2021-07-22 14:35:06.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CarPlay.framework/Headers/CPListTemplate.h	2021-08-09 03:22:57.000000000 -0400
@@ -14,6 +14,17 @@
 NS_ASSUME_NONNULL_BEGIN
 
 /*
+ Actions that Siri will perform when users select the assistant cell.
+ 
+ These actions require that your app supports the required SiriKit intents, and your app is of a supporting category.
+ For CarPlay audio apps, this is limited to INPlayMediaIntent. For CarPlay communication apps, this is INStartCallIntent.
+ */
+typedef NS_ENUM(NSInteger, CPAssistantCellActionType) {
+    CPAssistantCellActionTypePlayMedia = 0,
+    CPAssistantCellActionTypeStartCall,
+} API_AVAILABLE(ios(15.0));
+
+/*
  Visibility of the Assistant Cell
  */
 typedef NS_ENUM(NSInteger, CPAssistantCellVisibility) {
@@ -33,6 +44,40 @@
 @protocol CPListTemplateDelegate;
 @class CPListItem;
 
+API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, watchos, tvos)
+/**
+ @c CPAssistantCellConfiguration encapsulates the configuration options for your assistant cell.
+  
+ @note The Assistant Cell is only supported by CarPlay Audio and Communication apps.
+*/
+@interface CPAssistantCellConfiguration : NSObject <NSSecureCoding>
+
+/**
+ Initialize an Assistant Cell Configuration with a position, visibility, and action representing the SiriKit intent that should be invoked when users select the assistant cell.
+ */
+- (instancetype)initWithPosition:(CPAssistantCellPosition)position visibility:(CPAssistantCellVisibility)visibility assistantAction:(CPAssistantCellActionType)assistantAction;
+
+/**
+ The position of the Assistant Cell.
+ 
+ @note The default value of this property is @c CPAssistantCellPositionTop.
+ */
+@property (nonatomic, readonly) CPAssistantCellPosition position;
+
+/**
+ The visibility of the Assistant Cell.
+ 
+ @note The default value of this property is @c CPAssistantCellVisibilityOff.
+ */
+@property (nonatomic, readonly) CPAssistantCellVisibility visibility;
+
+/**
+ The action that Siri will perform when users select the assistant cell.
+ */
+@property (nonatomic, readonly) CPAssistantCellActionType assistantAction;
+
+@end
+
 API_AVAILABLE(ios(12.0)) API_UNAVAILABLE(macos, watchos, tvos)
 @interface CPListTemplate : CPTemplate <CPBarButtonProviding>
 
@@ -46,10 +91,9 @@
                      sections:(NSArray <CPListSection *> *)sections;
 
 /**
- Initialize a list template with one or more sections of items, an optional title, and specifications
- for the visibility and position of an Assistant Cell.
+ Initialize a list template with one or more sections of items, an optional title, and configuration for the assistant cell via a @c CPAssistantCellConfiguration object.
  
- @note The Assistant Cell will only be rendered for the Audio and Communication app categories.
+ @note The Assistant Cell is only supported by CarPlay Audio and Communication Apps.
  
  @discussion Unlike @c CPListItem, your application will not receive a callback when the user selects the cell.
  Instead, configure an Intents app extention to receive user requests from SiriKit, in order to turn the requests into an
@@ -57,8 +101,7 @@
  */
 - (instancetype)initWithTitle:(nullable NSString *)title
                      sections:(NSArray <CPListSection *> *)sections
-      assistantCellVisibility:(CPAssistantCellVisibility)visibility
-        assistantCellPosition:(CPAssistantCellPosition)position API_AVAILABLE(ios(15.0));
+   assistantCellConfiguration:(nullable CPAssistantCellConfiguration *)assistantCellConfiguration API_AVAILABLE(ios(15.0));
 
 /**
  The list template's delegate is informed of list selection events.
@@ -148,31 +191,17 @@
 #pragma mark - Assistant Cell
 
 /**
- The visibility of the Assistant Cell.
-
- Assigning to this property will dynamically update the List Template to reflect the visibility of the Assistant Cell.
- The default value of this property is @c CPAssistantCellVisibilityOff.
+ The configuration of the Assistant Cell.
 
- @note The Assistant Cell will only be rendered for the Audio and Communication app categories.
- 
- @discussion Unlike @c CPListItem, your application will not receive a callback when the user selects the cell.
- Instead, configure an Intents app extention to receive user requests from SiriKit, in order to turn the requests into an
- app-specific actions.
- */
-@property (nonatomic, assign) CPAssistantCellVisibility assistantCellVisibility API_AVAILABLE(ios(15.0));
-
-/**
- The position of the Assistant Cell.
- Assigning to this property will dynamically update the List Template to reflect the position of the Assistant Cell.
- The default value of this property is @c CPAssistantCellPositionTop.
+ Assigning to this property will dynamically update the List Template to reflect the visibility, position, and intent identifier of the Assistant Cell.
 
- @note The Assistant Cell will only be rendered for the Audio and Communication app categories.
+ @note The Assistant Cell is only supported by CarPlay Audio and Communication Apps.
  
  @discussion Unlike @c CPListItem, your application will not receive a callback when the user selects the cell.
  Instead, configure an Intents app extention to receive user requests from SiriKit, in order to turn the requests into an
  app-specific actions.
  */
-@property (nonatomic, assign) CPAssistantCellPosition assistantCellPosition API_AVAILABLE(ios(15.0));
+@property (nonatomic, nullable, strong) CPAssistantCellConfiguration *assistantCellConfiguration API_AVAILABLE(ios(15.0));
 
 @end
 
Clone this wiki locally