Add support for iOS 8

Tested from iOS 5 onwards.