I don't want the function to be included if the iOS app is running on a Mac. (Designed for iPad)
For example the sample code below
@available(iOS 13.4, *) func keyPressed(_ key: UIKey) { .. }
The keyPressed function is included when running in iOS or iPadOS. I would like to know if there is a way to prevent the keyPressed function from being included at launch time, even when running an iOS app as "Designed for iPad" on M1/M2 devices.
"targetEnvironment(macCatalyst)"
When this is called, false is unconditionally displayed, so the distinction cannot be made.
#if ProcessInfo().isiOSAppOnMac func keyPressed(_ key: UIKey) { .. } #endif
If you use the code above, ProcessInfo cannot be executed in RunTime, so false is output unconditionally.
So far I'm looking for a possible way, but there doesn't seem to be any possible way.
If anyone has solved this problem, please reply.