diff --git a/Global.h b/Global.h index 965c24d8f..80776b24f 100644 --- a/Global.h +++ b/Global.h @@ -264,6 +264,15 @@ template char (&_ArrayCountObj(const T (&)[N]))[N]; // should be used for variables that becomes unused in release builds (e.g. only used for assert checks) #define UNUSED(VAR) ((void)VAR) +// old iOS SDKs compatibility +#ifdef VCMI_IOS +#include + +#ifndef __IPHONE_13_0 +#define __IPHONE_13_0 130000 +#endif +#endif // VCMI_IOS + // single-process build makes 2 copies of the main lib by wrapping it in a namespace #ifdef VCMI_LIB_NAMESPACE #define VCMI_LIB_NAMESPACE_BEGIN namespace VCMI_LIB_NAMESPACE { diff --git a/client/ios/startSDL.mm b/client/ios/startSDL.mm index 1a89ac4a7..6cf867478 100644 --- a/client/ios/startSDL.mm +++ b/client/ios/startSDL.mm @@ -46,9 +46,11 @@ textField.frame = r; self.gameChatHandler.textFieldSDL = textField; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 if(@available(iOS 13.0, *)) textField.backgroundColor = UIColor.systemBackgroundColor; else +#endif textField.backgroundColor = UIColor.whiteColor; auto longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; diff --git a/launcher/ios/main.m b/launcher/ios/main.m index 3db701feb..5f14d4ff1 100644 --- a/launcher/ios/main.m +++ b/launcher/ios/main.m @@ -21,8 +21,10 @@ void launchGame(int argc, char * argv[]) { qtNativeWindow.hidden = YES; [qtNativeWindow.rootViewController.view removeFromSuperview]; qtNativeWindow.rootViewController = nil; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 if (@available(iOS 13.0, *)) qtNativeWindow.windowScene = nil; +#endif } [NSNotificationCenter.defaultCenter postNotificationName:@"StartGame" object:nil]; }