1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

ios Support

This commit is contained in:
Michael 2023-07-08 18:15:36 +02:00 committed by GitHub
parent a5fe6cc80b
commit da8bcdd2dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -25,6 +25,9 @@
#ifdef VCMI_ANDROID
#include "../../lib/CAndroidVMHelper.h"
#endif
#ifdef VCMI_IOS
#include "../ios/utils.h"
#endif
#include <SDL_events.h>
#include <SDL_hints.h>
@ -299,4 +302,7 @@ void InputSourceTouch::hapticFeedback() {
CAndroidVMHelper vmHelper;
vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "hapticFeedback");
#endif
#if defined(VCMI_IOS)
iOS_utils::hapticFeedback();
#endif
}

View File

@ -15,4 +15,6 @@ double screenScale();
void showLoadingIndicator();
void hideLoadingIndicator();
void hapticFeedback();
}

View File

@ -43,4 +43,11 @@ void hideLoadingIndicator()
[indicator removeFromSuperview];
indicator = nil;
}
void hapticFeedback()
{
UIImpactFeedbackGenerator *hapticGen = [[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleLight)];
[hapticGen impactOccurred];
hapticGen = NULL;
}
}