use new iOS8 method as deprecated methods are no longer available in swift