First working version
Added support to iOS 6