As I’ve previously mentioned on this blog, I am currently working on a new iOS audio recorder app called SimpleMic. One of the primary goals of the app is to allow the user to get recorded audio off the device and onto one of many endpoints as easily as possible. With the arrival of iOS 6, Apple have introduced a very nice API for concisely encapsulating this type of integration and presenting it via an OS-standard user interface. The API I am referring to is UIActivity and it’s user interface companion, UIActivityViewController.
When I decided I wanted to include the ability for users of my app to upload recorded audio to SoundCloud, it was clear that UIActivity was the right way to enable this feature. With that, I give you NBSoundCloudActivity, a simple UIActivity subclass that wraps the SoundCloud sharing SDK and that is available under the MIT license for use with your own apps.
If you have the need to provide sharing to SoundCloud, this class makes it as easy as dropping in your SC credentials and displaying an instance of UIActivityViewController. Your user’s will get a standard iOS activity view that includes a “SoundCloud” button, complete with official icon.
Tapping the button will bring up the SoundCloud SDK UI for sharing where further info about the audio can be specified.
The full source is available on Github at the below URL. The README has a good amount of info on how to get started and the code is well unit tested. If you have any questions or feedback, drop a comment here or contact me directly.
And if you’re interested in finding out more about the app that inspired this code, check out my SimpleMic preview page and sign up for email updates
That’s all for now, for more musings on software development and other such things, you can follow me on Twitter at @nickbona.
UPDATE: I’ve now also turned this project into a CocoaPod, so it’s even easier to add it to your own project. Enjoy!