- Notifications
You must be signed in to change notification settings - Fork 548
TouchController iOS xcode26.0 b2
Alex Soto edited this page Sep 2, 2025 · 3 revisions
#TouchController.framework https://github.com/dotnet/macios/pull/23691
diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCButton.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCButton.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCButton.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCButton.h 2025-06-14 04:00:17 @@ -0,0 +1,115 @@ +// +// TCButton.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> +#import <simd/simd.h> + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCControl.h> +#import <TouchController/TCControlVisuals.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// A control that represents a single on-screen button. +/// +/// This is mirrored by a <doc://com.apple.documentation/documentation/gamecontroller/gccontrollerbuttoninput> +/// on the associated <doc://com.apple.documentation/documentation/gamecontroller/gccontroller>. +@interface TCButton : NSObject<TCControl, TCTransform> + +/// The touch controller that manages this button. +@property (nonatomic, strong, readonly) TCTouchController *touchController; + +/// The visuals for the button in its normal state. +/// +/// This value can be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *visuals; + +/// The visuals for the button when it is toggled on. +/// +/// This value is only used when the button is a toggle, and can be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *toggleVisuals; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// A Boolean value that indicates whether the button is a toggle button. +@property (nonatomic, assign, getter=isToggle) BOOL toggle; + +/// A Boolean value that indicates whether the button is currently toggled on. +@property (nonatomic, assign, getter=isToggle, readonly) BOOL toggled; + +/// The position of the button in points, with the origin at the top left corner of the screen. +@property (nonatomic, assign, readonly) CGPoint position; + +/// The anchor point that the control's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the button, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The size (width, height) of the button in points. +@property (nonatomic, assign) CGSize size; + +/// The collider for the button. +@property (nonatomic, strong) id<TCCollider> collider; + +/// Not available. Create the control via a `TCTouchController`. +- (instancetype)init NS_UNAVAILABLE; + +@end + + + +/// A descriptor for configuring a button. +@interface TCButtonDescriptor : NSObject + +/// The label you associate with the button. +@property (nonatomic, strong) TCControlLabel *label; + +/// The visuals for the button in its normal state. +/// +/// This value can be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *visuals; + +/// The visuals for the button when it is toggled on. +/// +/// This value is only used when the button is a toggle, and can be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *toggleVisuals; + +/// Whether the button is a toggle button. +@property (nonatomic, assign, getter=isToggle) BOOL toggle; + +/// The anchor point that the button's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the button, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The size (width, height) of the button in points. +@property (nonatomic, assign) CGSize size; + +/// The type of collider to use for the button. +@property (nonatomic, assign) TCColliderType colliderType; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Creates a new button descriptor with default values. +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCircleCollider.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCircleCollider.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCircleCollider.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCircleCollider.h 2025-06-14 04:00:17 @@ -0,0 +1,25 @@ +// +// TCCircleCollider.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <TouchController/TCCollider.h> +#import <TouchController/TCTransform.h> + +NS_ASSUME_NONNULL_BEGIN + +/// A circular collider. +@interface TCCircleCollider : NSObject<TCCollider> + +/// Creates a new circle collider with the specified transform. +/// +/// - Parameters: +/// - transform: The transform to use for the collider. +/// - Returns: A new `TCCircleCollider` instance. +- (instancetype)initWithTransform:(id<TCTransform>)transform; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCollider.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCollider.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCollider.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCCollider.h 2025-06-14 04:00:17 @@ -0,0 +1,48 @@ +// +// TCCollider.h +// TouchController +// + +#import <Foundation/Foundation.h> + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the type of collider. +typedef NS_ENUM(NSInteger, TCColliderType) { + /// A circular collider. + TCColliderTypeCircle, + /// A rectangular collider. + TCColliderTypeRect, + /// A collider representing the left side of the touch controller. + TCColliderTypeLeftSide, + /// A collider representing the right side of the touch controller. + TCColliderTypeRightSide, +}; + +/// A protocol defining the collider properties for a control. +@protocol TCCollider <NSObject> + +@required +/// The type of the collider. +- (TCColliderType)colliderType; + +/// Determines whether the collider contains the specified point. +/// +/// - Parameters: +/// - point: The point to check. +/// - Returns: `YES` if the collider contains the point; otherwise, `NO`. +- (BOOL)containsPoint:(CGPoint)point; + +/// A Boolean value that indicates whether the collider is enabled. +- (BOOL)enabled; + +/// Sets whether the collider is enabled. +/// +/// - Parameters: +/// - enabled: `YES` to enable the collider, `NO` to disable it. +- (void)setEnabled:(BOOL)enabled; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControl.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControl.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControl.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControl.h 2025-06-14 04:00:17 @@ -0,0 +1,65 @@ +// +// TCControl.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <TouchController/TCCollider.h> +#import <TouchController/TCTransform.h> +#import <TouchController/TCControlLabel.h> + +NS_ASSUME_NONNULL_BEGIN + +/// A protocol that defines the base properties and methods for all touch controls. +@protocol TCControl <NSObject, TCTransform> + +@required + +/// The label associated with the control. +@property (nonatomic, strong, readonly) TCControlLabel *label; + +/// The collider for the control. +@property (nonatomic, strong) id<TCCollider> collider; + +/// Indicates whether the control is currently pressed. +@property (nonatomic, assign, readonly) BOOL pressed; + +/// A Boolean value that indicates whether the control is enabled. +/// +/// If disabled, it won't respond to touches. +@property (nonatomic, assign) BOOL enabled; + +/// Handles a touch began event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch began. +- (void)handleTouchBeganAtPoint:(CGPoint)point; + +/// Handles a touch moved event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch moved to. +- (void)handleTouchMovedAtPoint:(CGPoint)point; + +/// Handles a touch ended event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch ended. +- (void)handleTouchEndedAtPoint:(CGPoint)point; + +@optional + +/// The factor by which to highlight the control when pressed. +@property (nonatomic, assign) float highlightFactor; +/// The duration of the highlight animation. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Updates the layout of the control. +/// +/// You won't need to call this directly, unless you change the layout. +- (void)layoutIfNeeded; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlLabel.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlLabel.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlLabel.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlLabel.h 2025-06-14 04:00:17 @@ -0,0 +1,62 @@ +// +// TCControlLabel.h +// TouchController +// + +#import <Foundation/Foundation.h> + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the type of control label. +typedef NS_ENUM(NSInteger, TCControlLabelType) { + /// A label for a button input controller. + TCControlLabelTypeButton, + /// A label for a direction pad controller. + TCControlLabelTypeDirectionPad, +}; + +/// A label you associate with a touch control and provides a semantic description. +@interface TCControlLabel : NSObject + +/// Creates a pre-configured label for the "A" button. ++ (instancetype)buttonA; +/// Creates a pre-configured label for the "B" button. ++ (instancetype)buttonB; +/// Creates a pre-configured label for the "X" button. ++ (instancetype)buttonX; +/// Creates a pre-configured label for the "Y" button. ++ (instancetype)buttonY; +/// Creates a pre-configured label for the "Menu" button. ++ (instancetype)buttonMenu; +/// Creates a pre-configured label for the "Options" button. ++ (instancetype)buttonOptions; +/// Creates a pre-configured label for the left shoulder button. ++ (instancetype)buttonLeftShoulder; +/// Creates a pre-configured label for the left trigger button. ++ (instancetype)buttonLeftTrigger; +/// Creates a pre-configured label for the right shoulder button. ++ (instancetype)buttonRightShoulder; +/// Creates a pre-configured label for the right trigger button. ++ (instancetype)buttonRightTrigger; +/// Creates a pre-configured label for the left thumbstick. ++ (instancetype)leftThumbstick; +/// Creates a pre-configured label for the left thumbstick button. ++ (instancetype)leftThumbstickButton; +/// Creates a pre-configured label for the right thumbstick. ++ (instancetype)rightThumbstick; +/// Creates a pre-configured label for the right thumbstick button. ++ (instancetype)rightThumbstickButton; +/// Creates a pre-configured label for the direction pad. ++ (instancetype)directionPad; + +- (instancetype)init NS_UNAVAILABLE; + +/// The name of the control label that you use for lookup on a game controller instance. +@property (nonatomic, retain, readonly) NSString *name; +/// The type of the control label. +@property (nonatomic, assign, readonly) TCControlLabelType type; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlSystemVisualsProvider.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlSystemVisualsProvider.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlSystemVisualsProvider.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlSystemVisualsProvider.h 2025-06-13 23:04:26 @@ -0,0 +1,135 @@ +// +// TCControlSystemVisualsProvider.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <Metal/Metal.h> + +#import <TouchController/TCTouchController.h> +#import <TouchController/TCControlLabel.h> +#import <TouchController/TCControlVisuals.h> + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the visual shape of a button. +typedef NS_ENUM(NSInteger, TCButtonVisualShape) { + /// A circular button shape. + TCButtonVisualShapeCircle, + /// A rectangular button shape. + TCButtonVisualShapeRect, +}; + +/// Defines the direction of a direction pad visual. +typedef NS_ENUM(NSInteger, TCDirectionPadVisualDirection) { + /// The up direction. + TCDirectionPadVisualDirectionUp, + /// The down direction. + TCDirectionPadVisualDirectionDown, + /// The left direction. + TCDirectionPadVisualDirectionLeft, + /// The right direction. + TCDirectionPadVisualDirectionRight, +}; + +/// Defines the visual style of a direction pad. +typedef NS_ENUM(NSInteger, TCDirectionPadVisualStyle) { + /// A circular direction pad style. + TCDirectionPadVisualStyleCircle, + /// A pentagon direction pad style. + TCDirectionPadVisualStylePentagon, +}; + +/// Provides system-defined visuals for touch controls. +@interface TCControlSystemVisualsProvider : NSObject + +/// Not available. Use `initWithTouchController:` to create a `TCControlSystemVisualsProvider`. +- (instancetype)init NS_UNAVAILABLE; + +/// Creates a new visuals provider with the specified touch controller. +/// +/// - Parameters: +/// - touchController: The touch controller to use for creating the visuals. +/// - Returns: A new `TCControlSystemVisualsProvider` instance. +- (instancetype)initWithTouchController:(TCTouchController *)touchController; + +/// The button visuals for the specified label, size, and shape. +/// +/// - Parameters: +/// - label: The label for the button. +/// - size: The size of the button in points. +/// - shape: The shape of the button. +/// - Returns: The `TCControlVisuals` for the button. +- (TCControlVisuals *)buttonVisualsForLabel:(TCControlLabel *)label ofSize:(CGSize)size ofShape:(TCButtonVisualShape)shape; + +/// The button visuals for the specified system image name, size, and shape. +/// +/// - Parameters: +/// - imageName: The name of the system image to use for the button. +/// - size: The size of the button in points. +/// - shape: The shape of the button. +/// - Returns: The `TCControlVisuals` for the button. +- (TCControlVisuals *)buttonVisualsForSystemImageNamed:(NSString *)imageName ofSize:(CGSize)size ofShape:(TCButtonVisualShape)shape; + +/// The toggle visuals for the specified label, size, and shape. +/// +/// - Parameters: +/// - label: The label for the toggle button. +/// - size: The size of the toggle button in points. +/// - shape: The shape of the toggle button. +/// - Returns: The `TCControlVisuals` for the toggle button. +- (TCControlVisuals *)toggleVisualsForLabel:(TCControlLabel *)label ofSize:(CGSize)size ofShape:(TCButtonVisualShape)shape; + +/// The toggle visuals for the specified system image name, size, and shape. +/// +/// - Parameters: +/// - imageName: The name of the system image to use for the toggle button. +/// - size: The size of the toggle button in points. +/// - shape: The shape of the toggle button. +/// - Returns: The `TCControlVisuals` for the toggle button. +- (TCControlVisuals *)toggleVisualsForSystemImageNamed:(NSString *)imageName ofSize:(CGSize)size ofShape:(TCButtonVisualShape)shape; + +/// The thumbstick stick visuals for the specified label and size. +/// +/// - Parameters: +/// - label: The label for the thumbstick. +/// - size: The size of the thumbstick stick in points. +/// - Returns: The `TCControlVisuals` for the thumbstick stick. +- (TCControlVisuals *)thumbstickStickVisualsForLabel:(TCControlLabel *)label ofSize:(CGSize)size; + +/// The thumbstick background visuals for the specified label and size. +/// +/// - Parameters: +/// - label: The label for the thumbstick. +/// - size: The size of the thumbstick background in points. +/// - Returns: The `TCControlVisuals` for the thumbstick background. +- (TCControlVisuals *)thumbstickBackgroundVisualsForLabel:(TCControlLabel *)label ofSize:(CGSize)size; + +/// The throttle indicator visuals for the specified size. +/// +/// - Parameters: +/// - size: The size of the throttle indicator in points. +/// - Returns: The `TCControlVisuals` for the throttle indicator. +- (TCControlVisuals *)throttleIndicatorVisualsOfSize:(CGSize)size; + +/// The throttle background visuals for the specified size. +/// +/// - Parameters: +/// - size: The size of the throttle background in points. +/// - Returns: The `TCControlVisuals` for the throttle background. +- (TCControlVisuals *)throttleBackgroundVisualsOfSize:(CGSize)size; + +/// The direction pad visuals for the specified label, size, style, and direction. +/// +/// - Parameters: +/// - label: The label for the direction pad. +/// - size: The size of the direction pad in points. +/// - style: The style of the direction pad. +/// - direction: The direction of the direction pad visual. +/// - Returns: The `TCControlVisuals` for the direction pad. +- (TCControlVisuals *)directionPadVisualsForLabel:(TCControlLabel *)label ofSize:(CGSize)size ofStyle:(TCDirectionPadVisualStyle)style withDirection:(TCDirectionPadVisualDirection)direction; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlVisuals.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlVisuals.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlVisuals.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCControlVisuals.h 2025-06-14 04:00:17 @@ -0,0 +1,30 @@ +// +// TCControlVisuals.h +// TouchController +// + +#import <Foundation/Foundation.h> + +@class TCSpriteRenderer; + +NS_ASSUME_NONNULL_BEGIN + +/// Represents the visual elements of a touch control. +@interface TCControlVisuals : NSObject + +/// Creates a new instance with the specified sprites. +/// +/// - Parameters: +/// - sprites: An array of `TCSpriteRenderer` objects to use for the visuals. +/// - Returns: A new `TCControlVisuals` instance. ++ (instancetype)visualsWithSprites:(NSArray<TCSpriteRenderer *> *)sprites; + +/// Not available. Use `visualsWithSprites:` to create a `TCControlVisuals`. +- (instancetype)init NS_UNAVAILABLE; + +/// The array of objects used to render the control. +@property (nonatomic, strong, readwrite) NSArray<TCSpriteRenderer *> *sprites; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCDirectionPad.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCDirectionPad.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCDirectionPad.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCDirectionPad.h 2025-06-13 23:04:26 @@ -0,0 +1,174 @@ +// +// TCDirectionPad.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> +#import <simd/simd.h> + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCControl.h> +#import <TouchController/TCControlVisuals.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// An object that represents a direction pad. +/// +/// You can configure this object to behave as either a composite direction pad (mirrored by a +/// `GCControllerDirectionPad` on the associated `GCController` instance) or as four separate +/// buttons. +@interface TCDirectionPad : NSObject<TCControl, TCTransform> + +/// The touch controller that manages this direction pad. +@property (nonatomic, strong, readonly) TCTouchController *touchController; + +/// A composite control label. +/// +/// If set, the control will behave as a `GCControllerDirectionPad`; otherwise, it behaves as separate buttons. +@property (nonatomic, strong, nullable) TCControlLabel *compositeLabel; +/// The label for the up button, if the control isn't a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *upLabel; +/// The label for the down button, if the control isn't a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *downLabel; +/// The label for the left button, if the control isn't a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *leftLabel; +/// The label for the right button, if the control isn't a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *rightLabel; + +/// The visuals for the up button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *upVisuals; + +/// The visuals for the down button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *downVisuals; + +/// The visuals for the left button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *leftVisuals; + +/// The visuals for the right button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *rightVisuals; + +/// The position of the direction pad in points, with the origin at the top left corner of the screen. +@property (nonatomic, assign, readonly) CGPoint position; + +/// The anchor point that the direction pad's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the direction pad, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The size (width, height) of the direction pad in points. +@property (nonatomic, assign) CGSize size; + +/// The collider for the direction pad. +@property (nonatomic, strong) id<TCCollider> collider; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// A Boolean value that indicates whether the control behaves as a swipeable radial button. +/// +/// If `YES`, the control behaves as a swipable radial button, rather than a collection of 4 separate buttons. +@property (nonatomic, assign, getter=isRadial) BOOL radial; + +/// A Boolean value that indicates whether the control behaves as a digital button. +/// +/// If `YES`, dpad buttons will report 1 or 0. Ignored if radial is set, as button presses will always be digital. +@property (nonatomic, assign, getter=isDigital) BOOL digital; + +/// A Boolean value that indicates whether the control has mutally exclusive input. +/// +/// If `YES`, only one element of the direction pad can be pressed at a time. +@property (nonatomic, assign, getter=hasMutuallyExclusiveInput) BOOL mutuallyExclusiveInput; + +/// Not available. Create the control via a `TCTouchController`. +- (instancetype)init NS_UNAVAILABLE; + +@end + + + +/// A descriptor for configuring a directional pad. +@interface TCDirectionPadDescriptor : NSObject + +/// A composite control label. +/// +/// If set, the control will behave as a `GCControllerDirectionPad`. Otherwise, it will behave as separate buttons. +@property (nonatomic, strong, nullable) TCControlLabel *compositeLabel; +/// The label for the up button, if the control isn't a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *upLabel; +/// The label for the down button, if the control is not a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *downLabel; +/// The label for the left button, if the control is not a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *leftLabel; +/// The label for the right button, if the control is not a composite direction pad. +@property (nonatomic, strong, nullable) TCControlLabel *rightLabel; + +/// The visuals for the up button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *upVisuals; +/// The visuals for the down button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *downVisuals; +/// The visuals for the left button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *leftVisuals; +/// The visuals for the right button. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *rightVisuals; + +/// The anchor point that the direction pad's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; +/// The layer of the direction pad, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; +/// The size (width, height) of the direction pad in points. +@property (nonatomic, assign) CGSize size; + +/// The type of collider to use for the direction pad. +@property (nonatomic, assign) TCColliderType colliderType; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// A Boolean value that indicates whether the control behaves as a swipeable radial button. +/// +/// If `YES`, the control behaves as a swipable radial button, rather than a collection of 4 separate buttons. +@property (nonatomic, assign, getter=isRadial) BOOL radial; + +/// A Boolean value that indicates whether the control behaves as a digital button. +/// +/// If `YES`, dpad buttons will report 1 or 0. Ignored if radial is set, as button presses will always be digital. +@property (nonatomic, assign, getter=isDigital) BOOL digital; + +/// A Boolean value that indicates whether the control has mutally exclusive input. +/// +/// If `YES`, only one element of the direction pad can be pressed at a time. +@property (nonatomic, assign, getter=hasMutuallyExclusiveInput) BOOL mutuallyExclusiveInput; + +/// Creates a new instance with default values. +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRectCollider.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRectCollider.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRectCollider.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRectCollider.h 2025-06-14 04:00:17 @@ -0,0 +1,25 @@ +// +// TCRectCollider.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <TouchController/TCCollider.h> +#import <TouchController/TCTransform.h> + +NS_ASSUME_NONNULL_BEGIN + +/// A rectangular collider. +@interface TCRectCollider : NSObject<TCCollider> + +/// Creates a new rect collider with the specified transform. +/// +/// - Parameters: +/// - transform: The transform to use for the collider. +/// - Returns: A new `TCRectCollider` instance. +- (instancetype)initWithTransform:(id<TCTransform>)transform; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRegionCollider.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRegionCollider.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRegionCollider.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCRegionCollider.h 2025-06-14 04:00:17 @@ -0,0 +1,37 @@ +// +// TCRegionCollider.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <TouchController/TCCollider.h> +#import <TouchController/TCTransform.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the region of the touch controller that the `TCRegionCollider` represents. +typedef NS_ENUM(NSInteger, TCRegionColliderRegion) { + /// The left side of the touch controller. + TCRegionColliderRegionLeftSide, + /// The right side of the touch controller. + TCRegionColliderRegionRightSide, +}; + +/// A collider that covers a specific region of the touch controller. +@interface TCRegionCollider : NSObject<TCCollider> + +/// Creates a new region collider with the specified region and touch controller. +/// +/// - Parameters: +/// - region: The region of the screen to cover. +/// - touchController: The touch controller to use for determining the screen size. +/// - Returns: A new `TCRegionCollider` instance. +- (instancetype)initWithRegion:(TCRegionColliderRegion)region TouchController:(TCTouchController *)touchController; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCSpriteRenderer.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCSpriteRenderer.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCSpriteRenderer.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCSpriteRenderer.h 2025-06-14 04:00:17 @@ -0,0 +1,51 @@ +// +// TCSpriteRenderer.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> + +NS_ASSUME_NONNULL_BEGIN + +/// A renderer for drawing sprites using Metal. +@interface TCSpriteRenderer : NSObject + +/// Not available. Use designated initializer. +- (instancetype)init NS_UNAVAILABLE; + +/// Creates a new sprite renderer with the specified texture and size. +/// +/// - Parameters: +/// - texture: The Metal texture to use for the sprite. +/// - size: The size of the sprite in points. +/// - Returns: A new `TCSpriteRenderer` instance. +- (instancetype)initWithTexture:(id<MTLTexture>)texture size:(CGSize)size; + +/// Creates a new sprite renderer with the specified texture, size, highlight texture, offset, and color tint. +/// +/// - Parameters: +/// - texture: The Metal texture to use for the sprite. +/// - size: The size of the sprite in points. +/// - highlightTexture: The Metal texture to use for the sprite when highlighted. May be `nil`. +/// - offset: The offset from the center of the parent control in points. +/// - colorTint: The color tint to apply to the texture. The color ref is retained. +/// - Returns: A new `TCSpriteRenderer` instance. +- (instancetype)initWithTexture:(id<MTLTexture>)texture size:(CGSize)size highlightTexture:(id<MTLTexture> __nullable)highlightTexture offset:(CGPoint)offset colorTint:(CGColorRef)colorTint NS_DESIGNATED_INITIALIZER; + +/// The Metal texture to use for the sprite. +@property (nonatomic, strong) id<MTLTexture> texture; +/// The Metal texture to use for the sprite when highlighted. May be `nil`. +@property (nonatomic, strong, nullable) id<MTLTexture> highlightTexture; +/// The size of the sprite in points. +@property (nonatomic, assign) CGSize size; +/// The offset from the center of the parent control in points. +@property (nonatomic, assign) CGPoint offset; +/// The color tint to apply to the texture. The color ref is retained. +@property (nonatomic, assign) CGColorRef colorTint; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThrottle.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThrottle.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThrottle.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThrottle.h 2025-06-14 04:00:17 @@ -0,0 +1,139 @@ +// +// TCThrottle.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> +#import <simd/simd.h> + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCControl.h> +#import <TouchController/TCControlVisuals.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the orientation of the throttle. +typedef NS_ENUM(NSInteger, TCThrottleOrientation) { + /// A vertical throttle. + TCThrottleOrientationVertical, + /// A horizontal throttle. + TCThrottleOrientationHorizontal, +}; + +/// Represents a single on-screen throttle - a one axis input. +/// +/// This is mirrored by a `GCControllerButtonInput` on the associated `GCController` instance. +@interface TCThrottle : NSObject<TCControl, TCTransform> + +/// The touch controller that manages this throttle. +@property (nonatomic, strong, readonly) TCTouchController *touchController; + +/// The visuals for the background of the throttle. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *backgroundVisuals; +/// The visuals for the indicator of the throttle. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *indicatorVisuals; + +/// The position of the throttle in points, with the origin at the top left corner of the screen. +@property (nonatomic, assign, readonly) CGPoint position; + +/// The anchor point that the throttle's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the throttle, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The orientation of the throttle. +@property (nonatomic, assign, readonly) TCThrottleOrientation orientation; + +/// A Boolean value that indicates whether the control reverts to it's base value. +/// +/// If `YES`, the control's value will revert to its base value when no longer pressed. +@property (nonatomic, assign) BOOL snapToBaseValue; + +/// The initial value of this control. +@property (nonatomic, assign) CGFloat baseValue; + +/// The size (width, height) of the throttle in points. +@property (nonatomic, assign) CGSize size; + +/// The size (width, height) of the indicator itself in points. +@property (nonatomic, assign) CGSize indicatorSize; + +/// The size (width, height) of the throttle itself, providing boundaries for the indicator, in points. +@property (nonatomic, assign) CGSize throttleSize; + +/// The collider for the throttle. +@property (nonatomic, strong) id<TCCollider> collider; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Not available. Create the control via a `TCTouchController`. +- (instancetype)init NS_UNAVAILABLE; + +@end + + + +/// A descriptor for configuring a throttle. +@interface TCThrottleDescriptor : NSObject + +/// The label associated with the throttle. +@property (nonatomic, strong) TCControlLabel *label; + +/// The visuals for the background of the throttle. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *backgroundVisuals; +/// The visuals for the indicator of the throttle. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *indicatorVisuals; + +/// The size (width, height) of the throttle in points. +@property (nonatomic, assign) CGSize size; +/// The size (width, height) of the indicator itself in points. +@property (nonatomic, assign) CGSize indicatorSize; +/// The size (width, height) of the throttle itself, providing boundaries for the indicator, in points. +@property (nonatomic, assign) CGSize throttleSize; + +/// The orientation of the throttle. +@property (nonatomic, assign) TCThrottleOrientation orientation; +/// A Boolean value that indicates whether the control reverts to it's base value. +/// +/// If `YES`, the control's value will revert to its base value when no longer pressed. +@property (nonatomic, assign) BOOL snapToBaseValue; +/// The initial value of this control. +@property (nonatomic, assign) CGFloat baseValue; + +/// The anchor point that the throttle's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; +/// The layer of the throttle, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The type of collider to use for the throttle. +@property (nonatomic, assign) TCColliderType colliderType; +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Creates a new throttle descriptor with default values. +- (instancetype)init; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThumbstick.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThumbstick.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThumbstick.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCThumbstick.h 2025-06-14 04:00:17 @@ -0,0 +1,115 @@ +// +// TCThumbstick.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> +#import <simd/simd.h> + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCControl.h> +#import <TouchController/TCControlVisuals.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// Represents a single on-screen thumbstick. +/// +/// This is mirrored by a `GCControllerDirectionPad` on the associated `GCController` instance. +@interface TCThumbstick : NSObject<TCControl, TCTransform> + +/// The touch controller that manages this thumbstick. +@property (nonatomic, strong, readonly) TCTouchController *touchController; + +/// The visuals for the background of the thumbstick. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *backgroundVisuals; + +/// The visuals for the thumbstick itself. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *stickVisuals; + +/// A Boolean value that indicates whether to hide the thumbstick when it is not being pressed. +@property (nonatomic, assign) BOOL hideWhenNotPressed; + +/// The position of the thumbstick in points, with the origin at the top left corner of the screen. +@property (nonatomic, assign, readonly) CGPoint position; + +/// The anchor point that the thumbstick's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the thumbstick, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The size (width, height) of the thumbstick in points. +@property (nonatomic, assign) CGSize size; + +/// The size (width, height) of the thumbstick stick itself in points. +@property (nonatomic, assign) CGSize stickSize; + +/// The collider for the thumbstick. +@property (nonatomic, strong) id<TCCollider> collider; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Not available. Create the control via a `TCTouchController`. +- (instancetype)init NS_UNAVAILABLE; + +@end + + + +/// A descriptor for configuring a thumbstick. +@interface TCThumbstickDescriptor : NSObject + +/// The label associated with the thumbstick. +@property (nonatomic, strong) TCControlLabel *label; + +/// The visuals for the background of the thumbstick. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *backgroundVisuals; + +/// The visuals for the thumbstick itself. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *stickVisuals; + +/// Whether to hide the thumbstick when it is not being pressed. +@property (nonatomic, assign) BOOL hideWhenNotPressed; + +/// The size (width, height) of the thumbstick stick itself in points. +@property (nonatomic, assign) CGSize stickSize; +/// The size (width, height) of the thumbstick in points. +@property (nonatomic, assign) CGSize size; + +/// The anchor point that the thumbstick's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; +/// The layer of the thumbstick, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The type of collider to use for the thumbstick. +@property (nonatomic, assign) TCColliderType colliderType; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// Creates a new thumbstick descriptor with default values. +- (instancetype)init; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchController.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchController.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchController.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchController.h 2025-06-14 04:00:17 @@ -0,0 +1,271 @@ +// +// TCTouchController.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <simd/simd.h> +#import <Metal/Metal.h> +#import <GameController/GameController.h> + +#import <TouchController/TCControl.h> + +@class TCButton; +@class TCButtonDescriptor; + +@class TCThumbstick; +@class TCThumbstickDescriptor; + +@class TCDirectionPad; +@class TCDirectionPadDescriptor; + +@class TCTouchpad; +@class TCTouchpadDescriptor; + +@class TCThrottle; +@class TCThrottleDescriptor; + +@class TCTouchControllerDescriptor; + +NS_ASSUME_NONNULL_BEGIN + +/// An object that allows you to create and customize on-screen touch controls for a game that uses Metal. +/// +/// The controller exposes controls through a <doc://com.apple.documentation/documentation/gamecontroller/gccontroller> +/// instance, and enables seamless integration with the <doc://com.apple.documentation/documentation/gamecontroller> +/// framework. +/// +/// This class manages the lifecycle of touch controls, handles user interaction, renders the controls using Metal, +/// and provides a `GCController` instance that reflects the state of the on-screen controls. +@interface TCTouchController : NSObject + +/// The Metal device the touch control uses for rendering the touch controls. +@property (nonatomic, readonly) id<MTLDevice> device; + +/// An array containing all the touch controls managed by this controller. +@property (nonatomic, readonly) NSArray<id<TCControl>> *controls; + +/// An array containing all the button controls managed by this controller. +@property (nonatomic, readonly) NSArray<TCButton *> *buttons; + +/// An array containing all the thumbstick controls managed by this controller. +@property (nonatomic, readonly) NSArray<TCThumbstick *> *thumbsticks; + +/// An array containing all the direction pad controls managed by this controller. +@property (nonatomic, readonly) NSArray<TCDirectionPad *> *directionPads; + +/// An array containing all the throttle controls managed by this controller. +@property (nonatomic, readonly) NSArray<TCThrottle *> *throttles; + +/// An array containing all the touchpad controls managed by this controller. +@property (nonatomic, readonly) NSArray<TCTouchpad *> *touchpads; + +/// The width of the screen in points. +@property (nonatomic, readonly) CGFloat screenWidth; + +/// The height of the screen in points. +@property (nonatomic, readonly) CGFloat screenHeight; + +/// The scale factor of the screen. +/// +/// For example, 2.0 or 3.0 for Retina displays. +@property (nonatomic, readonly) CGFloat scaleFactor; + +/// Creates a new instance with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCTouchControllerDescriptor` containing the configuration for the touch controller. +/// - Returns: A new `TCTouchController` instance. +- (instancetype)initWithDescriptor:(TCTouchControllerDescriptor *)descriptor; + +/// Sets up a default layout for the provided control labels. +/// +/// This is used to automatically position control labels based on a predefined layout. +/// +/// - Parameters: +/// - labels: An array of `TCControlLabel` objects to be laid out. +- (void)setupDefaultLayoutForLabels:(NSArray<TCControlLabel *> *)labels; + +// MARK: Layout + +/// Creates a new button control with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCButtonDescriptor` containing the configuration for the button. +/// - Returns: A new `TCButton` instance. +- (TCButton *)buttonWithDescriptor:(TCButtonDescriptor *)descriptor; + +/// Adds a button to the touch controller. +/// +/// - Parameters: +/// - button: The `TCButton` to add. +- (void)addButton:(TCButton *)button; + +/// Removes a button from the touch controller. +/// +/// - Parameters: +/// - button: The `TCButton` to remove. +- (void)removeButton:(TCButton *)button; + +/// Removes all buttons from the touch controller. +- (void)removeAllButtons; + +/// Creates a new thumbstick control with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCThumbstickDescriptor` containing the configuration for the thumbstick. +/// - Returns: A new `TCThumbstick` instance. +- (TCThumbstick *)thumbstickWithDescriptor:(TCThumbstickDescriptor *)descriptor; + +/// Adds a thumbstick to the touch controller. +/// +/// - Parameters: +/// - button: The `TCThumbstick` to add. +- (void)addThumbstick:(TCThumbstick *)button; + +/// Removes a thumbstick from the touch controller. +/// +/// - Parameters: +/// - button: The `TCThumbstick` to remove. +- (void)removeThumbstick:(TCThumbstick *)button; + +/// Removes all thumbsticks from the touch controller. +- (void)removeAllThumbsticks; + +/// Creates a new direction pad control with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCDirectionPadDescriptor` containing the configuration for the direction pad. +/// - Returns: A new `TCDirectionPad` instance. +- (TCDirectionPad *)directionPadWithDescriptor:(TCDirectionPadDescriptor *)descriptor; + +/// Adds a direction pad to the touch controller. +/// +/// - Parameters: +/// - directionPad: The `TCDirectionPad` to add. +- (void)addDirectionPad:(TCDirectionPad *)directionPad; + +/// Removes a direction pad from the touch controller. +/// +/// - Parameters: +/// - directionPad: The `TCDirectionPad` to remove. +- (void)removeDirectionPad:(TCDirectionPad *)directionPad; + +/// Removes all direction pads from the touch controller. +- (void)removeAllDirectionPads; + +/// Creates a new throttle control with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCThrottleDescriptor` containing the configuration for the throttle. +/// - Returns: A new `TCThrottle` instance. +- (TCThrottle *)throttleWithDescriptor:(TCThrottleDescriptor *)descriptor; + +/// Adds a throttle to the touch controller. +/// +/// - Parameters: +/// - throttle: The `TCThrottle` to add. +- (void)addThrottle:(TCThrottle *)throttle; + +/// Removes a throttle from the touch controller. +/// +/// - Parameters: +/// - throttle: The `TCThrottle` to remove. +- (void)removeThrottle:(TCThrottle *)throttle; + +/// Removes all throttles from the touch controller. +- (void)removeAllThrottles; + +/// Creates a new touchpad control with the provided descriptor. +/// +/// - Parameters: +/// - descriptor: The `TCTouchpadDescriptor` containing the configuration for the touchpad. +/// - Returns: A new `TCTouchpad` instance. +- (TCTouchpad *)touchpadWithDescriptor:(TCTouchpadDescriptor *)descriptor; + +/// Adds a touchpad to the touch controller. +/// +/// - Parameters: +/// - touchpad: The `TCTouchpad` to add. +- (void)addTouchpad:(TCTouchpad *)touchpad; + +/// Removes a touchpad from the touch controller. +/// +/// - Parameters: +/// - touchpad: The `TCTouchpad` to remove. +- (void)removeTouchpad:(TCTouchpad *)touchpad; + +/// Removes all touchpads from the touch controller. +- (void)removeAllTouchpads; + +/// Removes all controls from the touch controller. +- (void)removeAllControls; + +// MARK: User Interaction + +/// The control at the specified point, if any. +/// +/// - Parameters: +/// - point: The point to check for a control. +/// - Returns: The control at the specified point, or `nil` if no control is found. +- (nullable id<TCControl>)controlAtPoint:(CGPoint)point; + +/// Handles a touch began event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch began. +/// - index: An NSNumber representing a unique index for the touch +/// - Returns: `YES` if the touch was handled by a control; otherwise `NO`. +- (BOOL)handleTouchBeganAtPoint:(CGPoint)point index:(NSNumber *)index; + +/// Handles a touch moved event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch moved to. +/// - index: An NSNumber representing a unique index for the touch +/// - Returns: `YES` if the touch was handled by a control, `NO` otherwise. +- (BOOL)handleTouchMovedAtPoint:(CGPoint)point index:(NSNumber *)index; + +/// Handles a touch ended event at the specified point. +/// +/// - Parameters: +/// - point: The point where the touch ended. +/// - index: An NSNumber representing a unique index for the touch +/// - Returns: `YES` if the touch was handled by a control, `NO` otherwise. +- (BOOL)handleTouchEndedAtPoint:(CGPoint)point index:(NSNumber *)index; + +// MARK: Rendering + +/// Renders the touch controls using the provided Metal render command encoder. +/// +/// - Parameters: +/// - encoder: The `MTLRenderCommandEncoder` to use for rendering. +- (void)renderWithRenderCommandEncoder:(id<MTLRenderCommandEncoder>)encoder; + +/// Called when the drawable size changes. +/// +/// - Parameters: +/// - size: The new size of the drawable in points. +/// - scaleFactor: The new scale factor of the screen. +- (void)drawableSizeWillChange:(CGSize)size scaleFactor:(CGFloat)scaleFactor; + +// MARK: Game Controller + +/// A Boolean value that indicates whether the touch controller is connected to the Game Controller framework. +@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected; + +/// Connects the touch controller to the app, allowing its controls to be drawn and an associated `GCController` to be created. +- (void)connect; + +/// Disconnects the touch controller from the app, preventing its controls from being drawn. +- (void)disconnect; + +/// The game controller instance associated with this touch controller. +/// +/// - Returns: The `GCController` instance. +- (GCController *)controller; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchControllerDescriptor.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchControllerDescriptor.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchControllerDescriptor.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchControllerDescriptor.h 2025-06-14 04:00:17 @@ -0,0 +1,44 @@ +// +// TCTouchControllerDescriptor.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <Metal/Metal.h> + +NS_ASSUME_NONNULL_BEGIN + +/// A descriptor for configuring a touch controller. +@interface TCTouchControllerDescriptor : NSObject + +/// The Metal device to use for rendering. +@property (nonatomic, readwrite, strong) id<MTLDevice> device; + +/// The width of the screen in points. +@property (nonatomic, readwrite, assign) CGFloat screenWidth; + +/// The height of the screen in points. +@property (nonatomic, readwrite, assign) CGFloat screenHeight; + +/// The scale factor of the screen. +/// +/// For example, 2.0 or 3.0 for Retina displays. +@property (nonatomic, readwrite, assign) CGFloat scaleFactor; + +/// The pixel format for the drawable texture. +@property (nonatomic, readwrite, assign) MTLPixelFormat colorPixelFormat; + +/// The pixel format for the depth attachment. +@property (nonatomic, readwrite, assign) MTLPixelFormat depthAttachmentPixelFormat; + +/// The pixel format for the stencil attachment. +@property (nonatomic, readwrite, assign) MTLPixelFormat stencilAttachmentPixelFormat; + +/// The number of samples per pixel for multisampling. +@property (nonatomic, readwrite, assign) NSUInteger sampleCount; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchpad.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchpad.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchpad.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTouchpad.h 2025-06-14 04:00:17 @@ -0,0 +1,102 @@ +// +// TCTouchpad.h +// TouchController +// + +#import <Foundation/Foundation.h> +#import <CoreGraphics/CoreGraphics.h> +#import <Metal/Metal.h> +#import <simd/simd.h> + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCControl.h> +#import <TouchController/TCControlVisuals.h> + +@class TCTouchController; + +NS_ASSUME_NONNULL_BEGIN + +/// Represents a single on-screen touchpad that reports absolute coordinates or delta movements. +/// +/// This is mirrored by a `GCControllerDirectionPad` on the associated `GCController` instance. +@interface TCTouchpad : NSObject<TCControl, TCTransform> + +/// The touch controller that manages this touchpad. +@property (nonatomic, strong, readonly) TCTouchController *touchController; + +/// The visuals for the touchpad. May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *visuals; + +/// The position of the touchpad in points, with the origin at the top left corner of the screen. +@property (nonatomic, assign, readonly) CGPoint position; + +/// The anchor point that the touchpad's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; + +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; + +/// The layer of the touchpad, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The width and height of the touchpad. in points. +@property (nonatomic, assign) CGSize size; + +/// The collider for the touchpad. +@property (nonatomic, strong) id<TCCollider> collider; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// A Boolean value that represents the touchpad reports deltas. +/// +/// If `YES`, the touchpad will report delta values as touch moves instead of absolute positions. +@property (nonatomic, assign) BOOL reportsDeltas; + +/// Not available. Create the control via a `TCTouchController`. +- (instancetype)init NS_UNAVAILABLE; + +@end + + + +/// A descriptor for configuring a touchpad. +@interface TCTouchpadDescriptor : NSObject + +/// The label associated with the touchpad. +@property (nonatomic, strong) TCControlLabel *label; + +/// The visuals for the touchpad. +/// +/// May be `nil`. +@property (nonatomic, strong, nullable) TCControlVisuals *visuals; + +/// The anchor point that the touchpad's offset is relative to. +@property (nonatomic, assign) TCTransformAnchor anchor; +/// The control's offset from the anchor, which determines its position. +@property (nonatomic, assign) CGPoint offset; +/// The layer of the touchpad, used for z-sorting. +@property (nonatomic, assign) simd_int1 layer; + +/// The size (width, height) of the touchpad in points. +@property (nonatomic, assign) CGSize size; + +/// The type of collider to use for the touchpad. +@property (nonatomic, assign) TCColliderType colliderType; + +/// The time it takes for a highlight to fade away, in seconds. +@property (nonatomic, assign) simd_float1 highlightTime; + +/// A Boolean value that represents the touchpad reports deltas. +/// +/// If `YES`, the touchpad will report delta values as touch moves instead of absolute positions. +@property (nonatomic, assign) BOOL reportsDeltas; + +/// Creates a new touchpad descriptor with default values. +- (instancetype)init; + +@end + + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTransform.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTransform.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTransform.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TCTransform.h 2025-06-14 04:00:17 @@ -0,0 +1,72 @@ +// +// TCTransform.h +// TouchController +// + +#import <Foundation/Foundation.h> + +#import <simd/simd.h> + +NS_ASSUME_NONNULL_BEGIN + +/// Defines the anchor point for a transform. +typedef NS_ENUM(NSInteger, TCTransformAnchor) { + /// Anchors to the top-left corner, relative to the screen size. + TCTransformAnchorTopLeft, + /// Anchors to the top-center, relative to the screen size. + TCTransformAnchorTopCenter, + /// Anchors to the top-right corner, relative to the screen size. + TCTransformAnchorTopRight, + /// Anchors to the center-left, relative to the screen size. + TCTransformAnchorCenterLeft, + /// Anchors to the center, relative to the screen size. + TCTransformAnchorCenter, + /// Anchors to the center-right, relative to the screen size. + TCTransformAnchorCenterRight, + /// Anchors to the bottom-left corner, relative to the screen size. + TCTransformAnchorBottomLeft, + /// Anchors to the bottom-center, relative to the screen size. + TCTransformAnchorBottomCenter, + /// Anchors to the bottom-right corner, relative to the screen size. + TCTransformAnchorBottomRight, + + /// Anchors to the top-left corner, using absolute coordinates. + TCTransformAnchorAbsoluteTopLeft, + /// Anchors to the top-center, using absolute coordinates. + TCTransformAnchorAbsoluteTopCenter, + /// Anchors to the top-right corner, using absolute coordinates. + TCTransformAnchorAbsoluteTopRight, + /// Anchors to the center-left, using absolute coordinates. + TCTransformAnchorAbsoluteCenterLeft, + /// Anchors to the center, using absolute coordinates. + TCTransformAnchorAbsoluteCenter, + /// Anchors to the center-right, using absolute coordinates. + TCTransformAnchorAbsoluteCenterRight, + /// Anchors to the bottom-left corner, using absolute coordinates. + TCTransformAnchorAbsoluteBottomLeft, + /// Anchors to the bottom-center, using absolute coordinates. + TCTransformAnchorAbsoluteBottomCenter, + /// Anchors to the bottom-right corner, using absolute coordinates. + TCTransformAnchorAbsoluteBottomRight, +}; + +/// A protocol defining the transform properties for a control. +@protocol TCTransform <NSObject> + +@required + +/// The anchor point of the transform. +@property (nonatomic, assign) TCTransformAnchor anchor; +/// The offset from the anchor point. +@property (nonatomic, assign) CGPoint offset; +/// The layer of the transform, used for z-ordering. +@property (nonatomic, assign) simd_int1 layer; +/// The size of the transform in points. +@property (nonatomic, assign) CGSize size; + +/// The calculated position of the transform. +- (CGPoint)position; + +@end + +NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TouchController.h /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TouchController.h --- /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TouchController.h 1969-12-31 19:00:00 +++ /Applications/Xcode_26.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/TouchController.framework/Headers/TouchController.h 2025-06-14 04:00:17 @@ -0,0 +1,26 @@ +// +// TCTouchControllerPublic.h +// TCTouchController +// + +#import <TouchController/TCTransform.h> +#import <TouchController/TCCollider.h> +#import <TouchController/TCRectCollider.h> +#import <TouchController/TCCircleCollider.h> +#import <TouchController/TCRegionCollider.h> + +#import <TouchController/TCControlVisuals.h> +#import <TouchController/TCSpriteRenderer.h> +#import <TouchController/TCControlSystemVisualsProvider.h> + +#import <TouchController/TCControl.h> +#import <TouchController/TCControlLabel.h> +#import <TouchController/TCButton.h> +#import <TouchController/TCThumbstick.h> +#import <TouchController/TCDirectionPad.h> +#import <TouchController/TCTouchpad.h> +#import <TouchController/TCThrottle.h> + +#import <TouchController/TCTouchControllerDescriptor.h> +#import <TouchController/TCTouchController.h> +