Drop-in support for Steam Controllers for iOS and tvOS.
For information about how to use a Steam Controller in Bluetoth LE mode, see Steam Controller BLE.
To run the example project, clone the repo, and run the SteamControllerTestApp target.
In the example app, power on your controller (in BLE or BLE pairing mode) and press Scan. Connected controllers will appear in the list, and the UI will reflect the state of the controller. Tapping on a controller from the list will open the settings view for that controller, where you can also see the battery level, and change its configuration (seen above).
GameController
framework.NSBluetoothAlwaysUsageDescription
key with a description of how it uses bluetooth.CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate SteamController into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'SteamController'
Then, run the following command:
$ pod install
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate SteamController into your Xcode project using Carthage, specify it in your Cartfile
:
github "zydeco/SteamController"
Run carthage update
to build the framework and drag the built SteamController.framework
into your Xcode project.
Everything should work like with MFi controllers. Depending on how your game works, you might not need any changes at all.
#import <SteamController/SteamController.h>
.[SteamControllerManager listenForConnections]
when your app starts (uses private IOKit API).[[SteamControllerManager sharedManager] scanForControllers]
when you want to scan for controllers.GCControllerDidConnectNotification
and GCControllerDidDisconnectNotification
, as with native controllers.[GCController controllers]
.GCController
(SteamController
) that implements the extendedGamepad
profile.steamButtonCombinationHandler
, or home buttonSince options and menu buttons were added in iOS 13, back and forward are also added as a class extension to GCExtendedGamepad
.
steamBackButton
steamForwardButton
The SteamController
class has some additional properties to customise its configuration.
See the documentation for more info.
These are available as GUI options in the example app.
The SteamController framework is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 56 |
Last commit: 2 years ago |
iOS 14 support contributed by @ToddLa:
STEAMCONTROLLER_NO_SWIZZLING
compile-time option, to remove swizzling of [GCController controllers]
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics