Detect 64bit iOS devices at runtime

So, I found myself wanting to identify whether the current device was 64bit or not, so I made a ridiculously simple UIDevice category. It might be useful to someone else, so please… have at it.

https://github.com/sammio2/UIDevice-ArchitectureDetection

P.S. You should know, it’s really not good practice to switch behaviours or code based on the devices architecture!

Author: Sam

iOS Developer & blogger

One thought on “Detect 64bit iOS devices at runtime”

  1. This won’t work BTW because it’s a compile time check, i.e. which SDK you built the code with. It only works because you’re building two binaries; arm64 and armv7 and each has been built with different SDK’s (64 or 32bit) and the runtime on the phone runs with the correct binary. If you build just one binary (armv7) which will work on either 32bit or 64bit, it will always tell you that you’re on a 32 bit machine which is wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *