I have a customer who has bought my iPad app and is running it on a Mac. (sigh)
Some things are odd.
eg File browsing , (which is now mostly resolved by using iCloud style API calls)
The latest oddity is the use of MobileMessageBox
One of these has up to 8 items - acting as best it can as a popupmenu substitute.
However, on an iPad, the options are stacked in a vertical list, while on the Mac, they are presented as a horizontal list that doesnt fit in the screen.
Any suggestions for a better approach?
eg a better popupmenu substitute, or some way to force vertical stacking on a Mac, (or even at the worst case, some way to know that a Mac is being used?)
This is what I use to detect an iOS app running on Mac
Function isiOSAppOnMac() As Boolean
if getiOSVersion >= 14 then
//Detecting Apple silicon
declare function processInfo_ lib "Foundation" selector "processInfo" (clsRef as ptr) as ptr
declare function isiOSAppOnMac_ lib "Foundation" selector "isiOSAppOnMac" (obj_id as ptr) as Boolean
dim AppOnMac as boolean = isiOSAppOnMac_(processInfo_(NSClassFromString("NSProcessInfo")))
Return AppOnMac
end if
End Function
And
Function getiOSVersion() As Double
Static sSystemVersion As Double
//Get sSystemVersion only once
If sSystemVersion = 0.0 Then
Declare Function currentDevice_ Lib "UIKit" selector "currentDevice" (clsRef As ptr) As ptr
Declare Function systemversion_ Lib "UIKit" selector "systemVersion" (obj_id As ptr) As CFStringRef
Dim device As Ptr = currentDevice_(NSClassFromString("UIDevice"))
Dim systemVersion As String = systemversion_(device)
Try
sSystemVersion = Double.FromString(systemVersion)
Catch
End Try
End If
Return sSystemVersion
End Function