iOS swipe up gesture

#1

I’ve noticed that with my game on iOS, the swipe up system gesture to close or see the opened apps, is somehow greyed out until I click on it once. Then it acquires focus and I can swipe up again and close the game.

Is there a setting somewhere I need to check to have it behave like normal apps?

Thanks :slight_smile:

0 Likes

#2

That’s normal behaviour for games, so that you don’t accidentally swipe up. You should probably keep it that way. But if you want to change it nevertheless, I think it’s UIStatusBarHidden in Info.plist, but that will show the status bar as well.

1 Like

#3

I also found this: https://developer.apple.com/forums/thread/93310

1 Like

#4

Found this information but ahah this is where I hit a wall :stuck_out_tongue:

https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/gestures/

Do I need a native extension?

0 Likes

#5

Yup. You’ll need a NE to implement that method. Not sure how to override the app delegate though.

2 Likes

#6

You can register a delegate using the dmExtension::RegisteriOSUIApplicationDelegate

It seems the documentation is a bit weird looking currently, so I post it here too. It uses a global constructor in order to be able to add it self as early as possible during the app startup.

 // myextension_ios.mm

 id<UIApplicationDelegate> g_MyApplicationDelegate;

 @interface MyApplicationDelegate : NSObject <UIApplicationDelegate>

 - (void) applicationDidBecomeActive:(UIApplication *) application;

 @end

 @implementation MyApplicationDelegate

 - (void) applicationDidBecomeActive:(UIApplication *) application {
     dmLogWarning("applicationDidBecomeActive - MyAppDelegate");
 }

 @end

 struct MyAppDelegateRegister
 {
     MyApplicationDelegate* m_Delegate;
     MyAppDelegateRegister() {
         m_Delegate = [[MyApplicationDelegate alloc] init];
         dmExtension::RegisteriOSUIApplicationDelegate(m_Delegate);
     }
     ~MyAppDelegateRegister() {
         dmExtension::UnregisteriOSUIApplicationDelegate(m_Delegate);
         [m_Delegate release];
     }
 };

 MyAppDelegateRegister g_FacebookDelegateRegister;

Here’s an actual example from extension-facebook

3 Likes

#7

Thank you both!
Looks like a small enough project for me to test the water with NE.
It would be nice to have it natively as an option :slight_smile:

3 Likes