Added iOS implementation (tested on iOS7, iPhone 4S...)