Start a new topic

How to disable swipe exit in iOS from AR World?

How to disable swipe exit in iOS from AR World?

1 person has this problem

Hi Huy,

you do have access to the native files of the Wikitude Cordova plugin; so you should be able to change the behaviour an way you see fit.

- Daniel

Hey everyone,
Now, swipe left to close is handled on native code.

How to add Exit button on AR View.? click on that button, will close AR View.

Please advice,


Edit on my last message : the first screenshot is to prevent default back-button behavior on Android. For swipe-back gesture on iOS, just consider the second screenshot. 


I did not see anything regarding this problem in the new sdk. 

However, the fix I provided above still works. These are the changes you should make (2 screenshots below) :




Could you please let me know if this has been addressed in the 6.0 release?


Hi Amaury,
Thx for the update. After two years, chances are hight that code lines references do not match anymore.

I wrote an internal ticket that we include some kind of configuration in the future. 

Best regards,


PS : IMHO it would be nice to be able to have an option in the config.xml (of the cordova project) to deactivate this default behavior. 

Hi again,

I finally found a solution =D

I commented the following lines on WTARViewController.m file : 

- lines 90 to 93
- lines 229 to 233

I modified the two versions of the files :

- MyApp/platforms/ios/Museopic/Plugins/com.wikitude.phonegap.WikitudePlugin/WTARViewController.m
- MyApp/plugins/com.wikitude.phonegap.WikitudePlugin/src/ios/WTARViewController.m

Then I closed XCode, rebuild with COrdova CLI, relaunch XCode, and build from XCode.

NB : I did that with the version 5.2.0 of the Wikitude Plugin.


Hi Andreas,

The solution you provided does not seem to be effective anymore. Is there a new way to prevent this "swipe to exit" gesture ?

Thanks :-)

that should work as well ;)

I am thinking to comment it out, we may require it in future. Thanks.

thx for the information - removing the mentioned lines should then be suffiecient and the changes will be applied once you rerun the application.

Best regards


Thanks alot Andreas. I can see the code, tomorrow I will try it out. Thanks again for your help and support.

PS: we are using xcode.

Sorry that I got you wrong.
To disable the gesture recognizer you have to remove line 86 to 89 in WTARViewController.m. You can find this file in the Wikitude Plugin. After you have removed the lines mentioned, simply rebuild your project and you should be fine.

Are you using the Xcode project to start your application or a phonegap/cordova command?

Best regards


Hi Andreas,

Thanks for getting back. We have already implemente the exit method based on the article you have provide. But my Question is different, apparently this issue is observed in Iphone 5 series, where you can swipe to right to exit. Although is a good feature, but for some reasons we want to stop it from happening. 

Kindly point us to the right direction, we really appreciate your help and support. Thanks.

- Udit
Login or Signup to post a comment