Splash screen getting invoked on map - iphone

I am working on a small project and my query is i have a view which displays the map and prompts me to use my current location.
my query is that when i press allow or dont allow button of the pop up it relaunches my app displaying my splash screen and then takes me back to my mapview.
So can we stop this from happening and does anyone know why this happens.
Thanks in advance.

As said in the comments, this "question" is hard to answer. Here's a try:
The popup is actually not shown by your app, but by iOS. Upon return of the popup, your application delegate's -applicationDidBecomeActive will get called. Apparently you (or the person who wrote the code for you) takes this as a sign to launch your splash screen. Of course, this should only happen when coming from the background or on startup.
So my guess is that the app is actually not relaunched at all. Put some logging in each of the application delegate functions, to see when and in what order they are called.

Related

How does one access the current SceneDelegate from a XCUIApplication object?

I went through the official documentation and the autocomplete options in Xcode but couldn't find anything.
UI Tests are not supposed to provide you application code access. You test them as a user would (black box testing).
On current screen,
find a button with label "Get Started"
Tap on it
Swipe Up etc.
You would exercise the app as a user would use it, tap on A, wait for B to appear on screen etc.

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

How to show exit confirm dialog when user clicks Home button?

I need to show the exit confirm dialog when user pressing the Home button. If yes, need to exit the application.
Is it possible to show when pressing the Home button?
This would probably cause your app to be rejected
From the Apple HIG:
Always Be Prepared to Stop
iOS apps stop when people press the Home button to open a different app or use a device feature, such as the phone. In particular, people don’t tap an app close button or select Quit from a menu. To provide a good stopping experience, an iOS app should:
Save user data as soon as possible and as often as reasonable because an exit or terminate notification can arrive at any time.
Save the current state when stopping, at the finest level of detail possible so that people don’t lose their context when they start the app again. For example, if your app displays scrolling data, save the current scroll position. To learn more about efficient ways to preserve and restore your app’s state, see “State Preservation and Restoration”.
I'm not sure you can stop the app from terminating or going into the background. You can tell it is about to go background through the app delegate applicationWilResignActive or be terminated by applicationWillTerminate.

Launch image re-appear after hitting the "Home" button and reopening the app several consecutive times

If I press the home button and then re-launch the app, after around 10 times, the application showing splash screen and stuck for a few seconds or even crash.
There's a reason that could happen?
(The app is configured to background)
I found the problem.
I use mbprogresshud's third-party code.
And I found a mistake, this code include registration to UIApplicationBecomeActiveNotification
and this registration happens again whenever this notification recieved.
so, Caused stack over flow after several time that application move to the background and reopen.
Thanks about your answers.

Sending user to nested view

When a user shuts down my app, I'd like to send them back to where they left off. The app starts on a tableview, the user drills down to another tableview and then clicks a row for a detail view. When they startup the app again, I have two choices:
1.) Display options (alertview) for returning to the previous location or cancelling and remaining on the start view.
2.) Immediately jet them over to the detail view.
I don't like either option. (1) gets to be nagging if you must go through it on every startup. (2) could be confusing and I'm not sure technically how that works.
Any suggestions on the above or something different?
But 2) is the preferred way according to Apple's HIG:
Even though your application does not run in the background when the user switches to
another application, you are encouraged to make it appear as if that is the case. When your
application quits, you should save out information about your application’s current state in
addition to any unsaved data. At launch time, you should look for this state information and
use it to restore your application to the state it was in when it was last used. Doing so
provides a more consistent user experience by putting the user right back where they were
when they last used your application. Saving the user’s place in this way also saves time by
potentially eliminating the need to navigate back through multiple screens’ worth of
information each time an application is launched.
As far as the technical implementation, it's exactly the same: push your subviews onto the navigation controller. The only thing I'd do differently is not animate the 'drilling down.'
When your app starts up, it has an initial 'look', screen, view, whatever.
When it starts back up and has a previous context, add a link or button naming the previous context that allows returning there.