Not able to switch between applications in IOS

Hi All,

I have an automation testbed for IOS which uses robot framework + Appium on MAC.
I need to switch between my application on IOS (Iphone 6) and Settings. Once Settings is opened, I am not able to switch back to my application.
Can you please suggest some ideas on how to do it.

driver.runAppInBackground(-1); //take ur app in background, -1 for uncertain duration

driver.launchApp(); // bring ur app in foreground