Game Development Reference
In-Depth Information
Native game controllers
Support for native game controllers first appeared in iOS 7. What are the advantages
of native controllers? Here are some of them:
A universal API for every controller out there : You will need to
write the code only once to support a myriad of different controllers
by different manufacturers.
An easy-to-use API written and supported by Apple engineers : You know
that your code will work on the latest versions of iOS and will generally be
supported throughout your application's lifetime. Bugs will be removed and
everyone will be happy.
A standard layout for buttons and joysticks : You know what buttons each
controller will have and where they are expected to be.
Now that we have found out why game controllers are useful, let's incorporate them
into our project.
Game controller basics
The Game Controller API is based on the Game Controller framework.
Everything related to controllers happens there.
There are three types of controllers that are supported by the framework:
Standard form-fitting controller : This is a controller in which the iOS device
resides. This controller has a direction pad, a pause button, four buttons,
and two shoulder buttons.
Extended form-fitting controller : This is the same as the previous one, but it
can also have up to two sticks and two more shoulder buttons.
Extended wireless controller : This is the same as the previous one, but it
works wirelessly and is an external device without holding your iOS device
in it.
The following figure shows the various types of controllers:
 
Search WWH ::




Custom Search