How to go from settings menu back to app? (Swift IOS 10) - swift

I have created an SMS app in Xcode (Swift). The user will go to the app's settings menu by pressing a button.
Here is the code for the button:
UIApplication.shared.open(NSURL(string: UIApplicationOpenSettingsURLString) as! URL, options:[:], completionHandler: nil)
There I can write the phone number and it will be linked to my app. But when I am in my settings menu I would like to go back to my app. Now it will only go back to the normal settings menu. Is this possible? I have tried looking but it's hard to find something when iOS 10 is new. I have just recently started coding on iPhone apps.

There's nothing you can do in your own app. The call to open launches another app and leaves your app.
iOS provides two simple ways for the user to return to your app.
In the top left corner of the iOS screen will be a little arrow and the name of your app. If the user taps on this, they will be returned to your app.
The user can double-tap the Home button to bring up the list of recently used apps. They can then tap on your app's icon to return to your app.

Related

iOS app - on quit ask for password

I am building iOS app for promo. The client asked that people using it should never quit it, so I got an idea.
When people are trying to quit, they would be asked to enter the password, otherwise it's impossible. Is there a solution to this?
I would appreciate any help, thanks!
Here are the steps to easily disable the home button :
Launch the Settings app from the Home screen of your iPhone or iPad Tap on General.
Scroll down towards the bottom of the screen and tap on
Accessibility.
Under the Learning section, tap on Guided Access.
If it's not already, turn the toggle next to Guided Access to the On
position, then choose a passcode.
After having deployed your application on the device, open it and triple tap the home button.
Set your options and then tap on start.
You can leave the guided access mode by triple tapping the home button again, it will ask you for the passcode you set before.
Here is a link for more details (and illustrated with photos)
What you are doing is not possible I guess. See for quitting any app the user can simply press the big quit button on the ipad or iphone and then the app would go into the background nevertheless.
You can't prevent the user from quitting. If you try to prevent it, the OS will terminate the app directly. With iOS 4.0, you can have tasks that are allowed to complete in the background.
Check this out.
For an overview about running tasks.

How to do a clean app restart (iOS 6.1)?

I realized an app for iOS. It all goes well, works like a charm... until the device is restarted! When I manually close the app (for example, on my iPad I slide four fingers upwards, visualize the menu showing the app "alive", hold the icon of the app and press the red badge, terminating the app) and I try to open it again this is what happens to me:
First the app remains stuck on the last page visited before closing the app (I cannot tap buttons on the tab bar or do anything else)
Then, the only thing I can do is tap the Home button and try to open the app again
At this point all I get is a perfectly black screen
The restart seems to be not a real restart, or not to be clean. This is totally meaningless to me. Am I missing something?
EDIT :
Remove your application by press Hold down Application iCon From simulator/device
And then re-install app. and check it worked or not ???
If your view display with black screen then give it backGround Color redColor or as u wish.
Its iOS app natural behavior only.
When you press Home button on device, While running any iOS app it goes in background but the The app is still in background and its save application's state.
So if you Tap agin app's icon you will get the last screen where did you leave it.
Now, if you want to Restart the app from initial you need to clear it.
Go this way.
Just double press device's Home button you can see running apps on bottom like this
For delete particular app, you simply press and hold, you can see red (-) icon on app
just click on that and you are on way.
Now press Home button and Go to Start app!!
The problem is that Xcode, when it runs an app, attach to it a debbuger which prevents it to close normally and causes problems in the reopening. Thank you very much to this guy who pointed out the problem: https://stackoverflow.com/a/15176137/1272105

Exit button in iPhone Application?

https://itunes.apple.com/us/app/ccnv/id574345063?mt=8
I download this app from Apple app store.
This application also having same form which i want to implement in my application.
Registration form opens in it and having Accept and Cancel button.
when i tap on Cancel button an alert pop up shows with two buttons Yes and No.
when tap on yes app exits.
so how this app is on Apple app store.same functionality i want to perform in my iPhone Application.
As per apple's guidelines programmatically one should not close the application. An app should quit only when the user clicks the home button.

Preload WebSite

I am using the iPhone simulator that is part of the SDK to test a jQuery Mobile website. I have the startup of the simulator scripted but once the simulator is up and running, I still have to click on Safari/enter the website URL. Is there a way to preload Safari/website URL through the shell script?
You can do the following... Once you open your webpage via mobile safari, look at the bottom tool bar where you see a set of icons. Click on the centre one "Share" and you get a list of options. Select "Add to home screen" and give it a name when prompted. Now, you will have this page added to the home screen and you can simply open this with a click.

iPhone webClip browser app suggestions

I want do build an webclip browser app. I will display all my webclips in to a scroll view when the user taps on one I want to add that web clip to the iPhone.
How to I tell to the iOS to install that webclip from my app?
Any docs, example, tutorials are welcome.
If by webclip you mean adding a link to a web address to the home screen then you can't do that programatically.
I think only Safari can do this so you would have to open the destination webpage in Safari and instruct the user how to add it to the home screen.
See this for a discussion on the feature. Javascript for "Add to Home Screen" on iPhone?