-
Notifications
You must be signed in to change notification settings - Fork 572
GameController iOS xcode27.0 b3
Alex Soto edited this page Jul 7, 2026
·
1 revision
#GameController.framework
diff -ruN /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCControllerHomeButtonSettingsManager.h /Applications/Xcode_27.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCControllerHomeButtonSettingsManager.h
--- /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCControllerHomeButtonSettingsManager.h 2026-06-12 03:40:36
+++ /Applications/Xcode_27.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCControllerHomeButtonSettingsManager.h 2026-06-25 03:53:29
@@ -9,33 +9,97 @@
#import <GameController/GCExtern.h>
+@class GCControllerHomeButtonSettingsManager;
+
NS_ASSUME_NONNULL_BEGIN
-typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingsAction) {
- /** The controller home button action could not be accessed. */
- GCControllerHomeButtonSettingsActionUnavailable = 0,
- /** The controller home button action opens the current application. */
- GCControllerHomeButtonSettingsActionOpenCurrentApplication = 1,
- /** The controller home button action performs some other action. */
- GCControllerHomeButtonSettingsActionOther = NSIntegerMax,
- /** Controller home button actions are disabled. */
- GCControllerHomeButtonSettingsActionDisabled API_AVAILABLE(macos(27.0)) API_UNAVAILABLE(ios, tvos, visionos) = -1,
-} NS_SWIFT_NAME(GCControllerHomeButtonSettingsManager.Action) API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
+/**
+ * How the system responds to a press of the game controller Home button
+ * outside of contexts where an action of the front-most app takes priority.
+ */
+typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingSystemAction) {
+ /** The setting value could not be retrieved.
+ *
+ * This result indicates that an error occurred, typically because the
+ * app is not currently permitted to read settings state. */
+ GCControllerHomeButtonSettingSystemActionUnavailable = -1,
+ /** The controller home button system action performs some other action. */
+ GCControllerHomeButtonSettingSystemActionOther = 0,
+ /** The controller home button system action opens the current application. */
+ GCControllerHomeButtonSettingSystemActionOpenCurrentApplication = 1,
+ /** System response to the game controller Home button press is
+ * disabled. */
+ GCControllerHomeButtonSettingSystemActionDisabled API_AVAILABLE(macos(27.0)) API_UNAVAILABLE(ios, tvos, visionos) = NSIntegerMax,
+} API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
+
/**
- * A hint passed to `-openControllerHomeButtonSettingsForActivity:` that
- * indicates the reason the app is requesting to open the Home button settings.
+ * How the system responds to a press of the game controller Home button while
+ * your application is front-most.
*/
-typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingsActivity) {
- /** Customize the action that occurs in response to long press of the
- * Home button. */
- GCControllerHomeButtonSettingsCustomizeActionActivity NS_SWIFT_NAME(customizeAction) = 1,
- /** Disable the system Home button actions while this app has focus. */
- GCControllerHomeButtonSettingsCustomizeOverridesActivity NS_SWIFT_NAME(customizeOverrides),
-} NS_SWIFT_NAME(GCControllerHomeButtonSettingsManager.Activity) API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
+typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingInAppAction) {
+ /** The setting value could not be retrieved.
+ *
+ * This result indicates that an error occurred, typically because the
+ * app is not currently permitted to read settings state. */
+ GCControllerHomeButtonSettingInAppActionUnavailable = -1,
+ /** The system maintains its default handling regardless of your app's
+ * preference. */
+ GCControllerHomeButtonSettingInAppActionDefault NS_SWIFT_NAME(systemDefault) = 0,
+ /** The system defers its handling to your app's preference.
+ *
+ * The system reponse to the game controller Home button press is disabled
+ * when the app indicates that it wants to handle the Home button
+ * press. The app indicates that it wants to handle the Home button
+ * press by setting:
+ *
+ * ```
+ * controller.physicalInputProfile.buttons[GCInputButtonHome].preferredSystemGestureState = GCSystemGestureStateDisabled;
+ * ```
+ */
+ GCControllerHomeButtonSettingInAppActionDefer = 1,
+ /** System response to the game controller Home button press is
+ * disabled. */
+ GCControllerHomeButtonSettingInAppActionDisabled API_AVAILABLE(macos(27.0)) API_UNAVAILABLE(ios, tvos, visionos) = NSIntegerMax,
+} API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
/**
+ * An additional returned flag indicating whether a setting has been modified
+ * by the user.
+ */
+typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingCustomizationStatus) {
+ /** The user has not customized this setting.
+ *
+ * The setting's value is the system default. */
+ GCControllerHomeButtonSettingCustomizationDefault NS_SWIFT_NAME(systemDefault) = 0,
+ /** The user has customized this setting at least once. */
+ GCControllerHomeButtonSettingCustomizationUser,
+} API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
+
+
+/**
+ * A hint passed to `-openControllerHomeButtonSettingsForActivity:` to
+ * indicate the reason the app is requesting to open Settings.
+ *
+ * The system uses this hint to navigate to the appropriate screen in the
+ * Settings application.
+ */
+typedef NS_ENUM(NSInteger, GCControllerHomeButtonSettingsCustomizationActivity) {
+ /** Customize the system action. */
+ GCControllerHomeButtonSettingsCustomizeSystemActionActivity NS_SWIFT_NAME(customizeSystemAction) = 1,
+ /** Customize the in-app action. */
+ GCControllerHomeButtonSettingsCustomizeInAppActionActivity NS_SWIFT_NAME(customizeInAppAction),
+} API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos);
+
+
+/**
+ * The type of the block that is scheduled after Home button settings change.
+ */
+typedef void(^GCControllerHomeButtonSettingsDidChangeHandler)(GCControllerHomeButtonSettingsManager *) NS_REFINED_FOR_SWIFT;
+
+
+/**
* Access the game controller system Home button settings.
*
* macOS, iOS, and visionOS allow the user to assign an action that launches a
@@ -49,19 +113,19 @@
* Performing operations on `GCControllerHomeButtonSettingsManager` is only
* permitted while a game controller is connected.
*/
-API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos)
+API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos) NS_REFINED_FOR_SWIFT
@interface GCControllerHomeButtonSettingsManager : NSObject
-- (nullable instancetype)initWithQueue:(nullable dispatch_queue_t)queue;
-- (nullable instancetype)init;
+- (instancetype)initWithQueue:(nullable dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
+- (instancetype)init;
/**
- * A block that is called after shortcut settings change.
+ * A block that is scheduled after Home button settings change.
*
- * This block is called on the queue that the
+ * This block is scheduled on the `queue` the
* `GCControllerHomeButtonSettingsManager` was initialized with.
*/
-@property (atomic, copy, nullable) dispatch_block_t settingsDidChangeHandler;
+@property (atomic, copy, nullable) GCControllerHomeButtonSettingsDidChangeHandler settingsDidChangeHandler;
/**
* Opens the Settings app to the screen in game controller settings where
@@ -72,12 +136,19 @@
* \p error contains additional information. This function returns immediately
* after attempting to open the Settings app.
*/
-- (BOOL)openControllerHomeButtonSettingsForActivity:(GCControllerHomeButtonSettingsActivity)activity error:(NSError * __autoreleasing *)error;
+- (BOOL)openControllerHomeButtonSettingsForActivity:(GCControllerHomeButtonSettingsCustomizationActivity)activity error:(NSError * __autoreleasing *)error;
/**
- * Get the current controller Home button action.
+ * Get the current controller Home button system action setting.
*/
-- (GCControllerHomeButtonSettingsAction)readControllerHomeButtonActionWithError:(NSError * _Nullable __autoreleasing * _Nullable)error NS_REFINED_FOR_SWIFT;
+- (GCControllerHomeButtonSettingSystemAction)readControllerHomeButtonSystemAction:(GCControllerHomeButtonSettingCustomizationStatus * _Nullable)customization withError:(NSError * _Nullable __autoreleasing * _Nullable)error;
+- (GCControllerHomeButtonSettingSystemAction)readControllerHomeButtonSystemActionWithError:(NSError * _Nullable __autoreleasing * _Nullable)error;
+
+/**
+ * Get the current controller Home button in-app action setting.
+ */
+- (GCControllerHomeButtonSettingInAppAction)readControllerHomeButtonInAppAction:(GCControllerHomeButtonSettingCustomizationStatus * _Nullable)customization withError:(NSError * _Nullable __autoreleasing * _Nullable)error;
+- (GCControllerHomeButtonSettingInAppAction)readControllerHomeButtonInAppActionWithError:(NSError * _Nullable __autoreleasing * _Nullable)error;
@end