Improve ios8 support

@krukow I want to get this into CI and I think I need to make some changes.
I was really hoping that the device target would be resolved before this method was called.