Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Use the Apple Remote to control your OS X apps.

License

Notifications You must be signed in to change notification settings

insidegui/AppleRemoteFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apple Remote Framework

A framework to use the Apple Remote to control your apps.

Documentation

The functionality is wrapped in a single class: AppleRemote. Take a look at the header, it's pretty well documented.

The sample app included shows a really good example of how It can be used, but the basic usage is as shown below:

Objective-C

// setup an AppleRemote
self.remote = [AppleRemote remoteWithListeningMode:AppleRemoteListenWhenActiveApp];
    
// set the block to be called when a button is pressed
[self.remote setPressEventReceiver:^(RemoteControlEventIdentifier eventId) {
   // do something with eventId, probably a switch :)
}];
    
// set the block to be called when a button is released
[self.remote setReleaseEventReceiver:^(RemoteControlEventIdentifier eventId) {
   // do something with eventId
}];

Swift

// setup an AppleRemote
let remote = AppleRemote(listeningMode: .ListenWhenActiveApp)

// set the block to be called when a button is pressed
remote.pressEventReceiver = { eventId in
    // do something with eventId, probably a switch :)
}

// set the block to be called when a button is released
remote.releaseEventReceiver = { eventId in
    // do something with eventId
}

demo app screenshot

Thanks

This framework is based on classes created by Martin Kahr, thanks Martin for your great work.

Contributing

You can contribute with code, just send me a pull request, or open an issue for any bug/enhancement. Please try to code in a similar way to the code that's already been written.

Disclaimer: sending a pull request does not mean I will accept It, if I don't accept your pull request It doesn't mean I don't love you ;)

About

Use the Apple Remote to control your OS X apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published