1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

support building against iOS SDK < 13.0

This commit is contained in:
Andrey Filipenkov 2022-09-22 14:31:57 +03:00
parent d2ded404bb
commit b8eef4ce35
3 changed files with 13 additions and 0 deletions

View File

@ -264,6 +264,15 @@ template<typename T, size_t N> 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 <AvailabilityVersions.h>
#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 {

View File

@ -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:)];

View File

@ -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];
}