SteamControllerManager
Objective-C
@interface SteamControllerManager : NSObject
Swift
class SteamControllerManager : NSObject
SteamControllerManager handles the connection and disconnection of Steam Controllers, and inserts connected Steam
Controllers into the array of controllers returned by [GCController controllers].
-
Returns the shared instance of
SteamControllerManager.Declaration
Objective-C
+ (nonnull instancetype)sharedManager;Swift
class func shared() -> Self -
Returns the currently connected Steam Controllers. Unless you only want to support Steam Controllers, you should use
[GCController controllers]instead of this property.Declaration
Objective-C
@property (nonatomic, readonly) NSArray<SteamController *> *_Nonnull controllers;Swift
var controllers: [SteamController] { get } -
Detects connected and pairing Steam Controllers. If a controller is in pairing mode, this will initiate the pairing process. If it is already paired and connected, it will configure it and post a
GCControllerDidConnectNotificationnotification when it’s ready.Declaration
Objective-C
- (void)scanForControllers;Swift
func scanForControllers()
-
Starts listening for controller connections.
You should call this method in your app delegate’s
application:didFinishLaunchingWithOptions:method.This enables controllers to be detected automatically when they connect/reconnect, without having to call
scanForControllers. This feature calls IOKit functions dynamically, which is private API on iOS/tvOS, it can be excluded from the build by passing-DSTEAMCONTROLLER_NO_PRIVATE_APIto the compiler, or using theSteamController/no-private-apisubspec in your Podfile.Declaration
Objective-C
+ (BOOL)listenForConnections;Swift
class func listenForConnections() -> Bool
View on GitHub
SteamControllerManager Class Reference