Skip to content

AVRouting iOS xcode14.0 beta1

TJ Lambert edited this page Aug 30, 2022 · 3 revisions

#AVRouting.framework https://github.com/xamarin/xamarin-macios/pull/15811

diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomDeviceRoute.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomDeviceRoute.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomDeviceRoute.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomDeviceRoute.h	2022-05-31 14:52:39.000000000 -0400
@@ -0,0 +1,41 @@
+/*
+    File:  AVCustomDeviceRoute.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+#import <Foundation/Foundation.h>
+#import <Network/Network.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+	@class		AVCustomDeviceRoute
+	@abstract	This class represents a custom device route.
+	@discussion	Clients can use the receiver's networkEndpoint or bluetoothIdentifier to establish a connection to the device.
+                Usually, either the network endpoint or the Bluetooth identifier will be nil, depending on what type of device it is.
+                In certain scenarios both can be non-nil, in which case the client can decide which one to use.
+ */
+API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos)
+@interface AVCustomDeviceRoute : NSObject
+
+/*!
+	@property 	networkEndpoint
+	@abstract	An nw_endpoint_t to which clients can establish a connection.
+	@discussion Use Network.opaque() to convert an nw_endpoint_t to an NWEndpoint in Swift.
+ */
+@property (nonatomic, nullable, readonly) nw_endpoint_t networkEndpoint;
+
+/*!
+	@property 	bluetoothIdentifier
+	@abstract	A bluetooth identifier which clients can use to establish a connection to a bluetooth device.
+ */
+@property (nonatomic, nullable, readonly) NSUUID *bluetoothIdentifier;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingActionItem.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingActionItem.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingActionItem.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingActionItem.h	2022-05-31 14:52:39.000000000 -0400
@@ -0,0 +1,41 @@
+/*
+    File:  AVCustomRoutingActionItem.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+#import <Foundation/Foundation.h>
+
+@class UTType;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+    @class      AVCustomRoutingActionItem
+    @abstract   AVCustomRoutingActionItem objects can be created by 3rd parties to inject custom action items into the route picker.
+    @discussion An item can be any action the app wants to provide as menu items besides the discovered routes.
+    Tapping on the custom items dismisses the picker and invokes a callback to the app telling it which item was tapped. (See -[AVCustomRoutingController customRoutingController:didSelectItem:])
+ */
+API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos, tvos)
+@interface AVCustomRoutingActionItem : NSObject
+
+/*!
+    @property   type
+    @abstract   A UTType with an identifier which matches a UTType in the info.plist.
+    @discussion Provide a UTTypeSymbolName and description in the info.plist.
+ */
+@property (nonatomic, copy) UTType *type API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos, tvos);
+
+/*!
+    @property   overrideTitle
+    @abstract   A title which overrides the title of the UTType.
+    @discussion Use this to dynamically override the title of the custom item.
+ */
+@property (nonatomic, copy, nullable) NSString *overrideTitle API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos, tvos);
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingController.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingController.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingController.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingController.h	2022-05-31 14:52:39.000000000 -0400
@@ -0,0 +1,125 @@
+/*
+    File:  AVCustomRoutingController.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+
+#import <Foundation/Foundation.h>
+
+#import <AVRouting/AVRoutingDefines.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AVCustomDeviceRoute;
+@class AVCustomRoutingEvent;
+@class AVCustomRoutingActionItem;
+@protocol AVCustomRoutingControllerDelegate;
+
+/*!
+	@constant	AVCustomRoutingControllerAuthorizedRoutesDidChangeNotification
+	@abstract	Posted when the value of authorizedRoutes changes.
+ */
+AVROUTING_EXTERN NSNotificationName const AVCustomRoutingControllerAuthorizedRoutesDidChangeNotification NS_SWIFT_NAME(AVCustomRoutingController.authorizedRoutesDidChange) API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos);
+
+/*!
+	@class		AVCustomRoutingController
+	@abstract	When a user selects / deselects a 3rd party device in the route picker, this class delegates the activation / deactivation of that device to the client of this class via AVCustomRoutingEvents.
+	@discussion	This class also informs the client which routes have been previously authorized, allowing them to reconnect if appropriate.
+ */
+API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos)
+@interface AVCustomRoutingController : NSObject
+
+/*!
+	@property 	delegate
+	@abstract	The receiver's delegate.
+ */
+@property (nonatomic, weak, nullable) id<AVCustomRoutingControllerDelegate> delegate;
+
+/*!
+	@property 	authorizedRoutes
+	@abstract	The list of authorized routes. Once a route has been activated, it remains authorized for a certain amount of time even if the connection to the route temporarily goes down.
+				The app may reactivate any one of these routes if they deem it appropriate, but must inform the system by calling -setActive:forRoute:.
+ */
+@property (nonatomic, readonly) NSArray<AVCustomDeviceRoute *> *authorizedRoutes;
+
+/*!
+    @property   customActionItems
+    @abstract   An array of custom action items to be added in the picker.
+ */
+@property (nonatomic, strong) NSArray<AVCustomRoutingActionItem *> *customActionItems API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos, tvos);
+
+/*!
+	@method     invalidateAuthorization
+	@param		route
+				The route for which to invalidate authorization.
+	@abstract	Calling this method revokes the app's authorization to connect to a route. The route will only become authorized again if the user selects it via the route picker.
+ */
+- (void)invalidateAuthorizationForRoute:(AVCustomDeviceRoute *)route;
+
+/*!
+    @method     setActive:forRoute:
+    @param      active
+                Whether or not the route is active.
+    @param      route
+                The route to set as active or inactive.
+    @abstract   Set this to NO if the connection to the route temporarily drops, and set it to YES once the connection is reestablished.
+ */
+- (void)setActive:(BOOL)active forRoute:(AVCustomDeviceRoute *)route;
+
+/*!
+    @method     isRouteActive:
+    @param      route
+                The route for which to check active status.
+    @abstract   Returns whether or not the given route is active.
+ */
+- (BOOL)isRouteActive:(AVCustomDeviceRoute *)route;
+
+@end
+
+
+/*!
+	@protocol	AVCustomRoutingControllerDelegate
+	@abstract	A protocol for delegates of AVCustomRoutingController.
+ */
+API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos)
+@protocol AVCustomRoutingControllerDelegate <NSObject>
+
+/*!
+	@method		customRoutingController:handleEvent:completionHandler:
+	@param		controller
+				The custom routing controller.
+	@param		event
+				The route event for the delegate to process.
+	@param		completionHandler
+				The completion handler the delegate needs to call after the event has been processed. Pass YES to the completion handler if the activation, reactivation or deactivation of the route was successful, and NO otherwise.
+	@abstract	The delegate needs to implement this method in order to both establish and tear down connection to a device when a user requests it through the picker.
+ */
+- (void)customRoutingController:(AVCustomRoutingController *)controller handleEvent:(AVCustomRoutingEvent *)event completionHandler:(void (^)(BOOL success))completionHandler;
+
+
+@optional
+
+/*!
+	@method		customRoutingController:eventDidTimeOut:
+	@param		controller
+                The custom routing controller.
+	@param		event
+				The route event that timed out.
+	@abstract	The delegate can implement this method in order know when a route event timed out. This gives them a chance to clean up any connection attempts that are currently in flight.
+ */
+- (void)customRoutingController:(AVCustomRoutingController *)controller eventDidTimeOut:(AVCustomRoutingEvent *)event;
+
+/*!
+    @method     customRoutingController:didSelectItem:
+    @abstract   Informs the delegate that the user selected a custom item in the route picker.
+ */
+- (void)customRoutingController:(AVCustomRoutingController *)controller didSelectItem:(AVCustomRoutingActionItem *)customActionItem;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingEvent.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingEvent.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingEvent.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVCustomRoutingEvent.h	2022-05-31 14:52:39.000000000 -0400
@@ -0,0 +1,54 @@
+/*
+    File:  AVCustomRoutingEvent.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AVCustomDeviceRoute;
+
+/*!
+	@constant	AVCustomRoutingEventReasonActivate
+				Represents an activation event, e.g. a user selected a route in the picker.
+	@constant	AVCustomRoutingEventReasonDeactivate
+				Represents a deactivation event, e.g. a user deselected a route in the picker.
+	@constant	AVCustomRoutingEventReasonReactivate
+				Represents a reactivation event, e.g. a route that is already authorized is selected by the user.
+ */
+typedef NS_ENUM(NSInteger, AVCustomRoutingEventReason) {
+	AVCustomRoutingEventReasonActivate = 0,
+	AVCustomRoutingEventReasonDeactivate,
+	AVCustomRoutingEventReasonReactivate,
+};
+
+/*!
+	@class		AVCustomRoutingEvent
+	@abstract	This class represents an event that occurs on a route.
+	@discussion	Depending on the reason for the event, clients are expected to establish or tear down the connection to the given route.
+ */
+API_AVAILABLE(ios(16.0)) API_UNAVAILABLE(macos)
+@interface AVCustomRoutingEvent : NSObject
+
+/*!
+	@property 	reason
+	@abstract	The reason for the event.
+ */
+@property (nonatomic, readonly) AVCustomRoutingEventReason reason;
+
+/*!
+	@property 	route
+	@abstract	The route associated with the event.
+ */
+@property (nonatomic, readonly) AVCustomDeviceRoute *route;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRouting.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRouting.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRouting.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRouting.h	2022-05-21 07:09:25.000000000 -0400
@@ -0,0 +1,14 @@
+/*
+    File:  AVRouting.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+#import <AVRouting/AVRoutingDefines.h>
+#import <AVRouting/AVCustomRoutingController.h>
+#import <AVRouting/AVCustomRoutingEvent.h>
+#import <AVRouting/AVCustomRoutingActionItem.h>
+#import <AVRouting/AVCustomDeviceRoute.h>
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRoutingDefines.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRoutingDefines.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRoutingDefines.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AVRouting.framework/Headers/AVRoutingDefines.h	2022-05-21 07:09:25.000000000 -0400
@@ -0,0 +1,10 @@
+/*
+    File:  AVRoutingDefines.h
+    
+    Framework:  AVRouting
+    
+    Copyright © 2022 Apple Inc. All rights reserved.
+    
+ */
+
+#define AVROUTING_EXTERN extern __attribute__((visibility ("default")))
Clone this wiki locally