How do I know if my app runs on iPhone / iPad or on Mac with M1 CPU

I'm running my iOS app on my Macbook with M1 cpu.I need to determine whether the current device is a Mac or iOS device...

Answered by DTS Engineer in 680912022

I need to determine whether the current device is a Mac or iOS device

See this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I need to determine whether the current device is a Mac or iOS device

See this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

#define IsiOSAppOnMac (\

{\

BOOL IsiOSAppOnMac = NO;\

if (@available(iOS 14.0, *)) {\

IsiOSAppOnMac = [NSProcessInfo processInfo].isiOSAppOnMac;\

}\

(IsiOSAppOnMac);}\

)

How do I know if my app runs on iPhone / iPad or on Mac with M1 CPU
 
 
Q