While SFSafariViewController is loading, we need to indicate to the user a website is loading in the ViewController we've just pushed.
The simplest idea is to turn on the network activity indicator before pushing the new SFSafariViewController and to turn it off in the delegate method once we know the website has loaded. However. when the SFSafariViewController slides in the UINavigationController, it slides over the app, which is fine, but the network activity indicator is not turned on anymore.
No network activity indicator is visible, so we can't communicate to the user that a website is being loaded. We need a way to communicate to the user that a website is being loaded in SFSafariViewController.
I think it's a bug! of iOS 9.
If anybody faced the same issue please tell me how to resolve.
The progress view in the SFSafariViewController is the indicator for a user to know that a website is loading and that is already built in, why would you need another one? If the progress view is hidden because you're pushing add this line to your code, so that you hide the navigation bar:
self.navigationController.navigationBarHidden = YES;
Related
Chase bank's iOS app is showing blank view hiding apps details when double tap the home button from the app. And when you login inside the app and touchID alert appears the apps view is not hidden by blank view.
So far I can hide app details by showing image loaded on applicationWillResignActive but it makes app hide it's details while touchID alert comes up.
I've checked similar questions on SO like this or this. Also here. But there is no answer to my question. How to replicate Chase bank's app behavior? How not to hide app details with touchID alert, but have them hidden when double tapped the home button?
I know it's an old question but couldn't find a valid answer to this exact question. So here's my solution.
steps:
create a instance variable for blocker view
init blocker view only once when it's necessary (I did it on applicationWillResignActive)
add blocker view as subview to the window at applicationDidEnterBackground
remove blocker view at applicationWillEnterForeground
The app delegate's applicationWillResignActive is the right place where you put a black or whatever view you want to show when the app is being moved to background. You need to add the desired UIView on Window object. Also you need to remove that view when the app becomes active again.
I have "Tinder" like swipping view that is located in a CardViewController. The card View Controller is accessed by moving through two other view controllers. i.e. Load App -> FirstViewController -> SecondViewController - > CardViewController.
When I am in the Card ViewController and I go into background mode, the app launches on the FirstViewController and on going to the cards, they are loaded from the first card in a stack of about 10?
Is there anyway to load the app from the last Card I had swipped and in the CardViewController without having to navigate from the FirstView Controller again?
I would really appreciate the help as it's horribly affecting some of my users.
An example of a Tinder like card view is shown!
The problem, from the sound of it, is not what happens when the app goes into the background — that would leave it in exactly the same state when it reactivates. The problem is what happens when the app goes into the background and quits. Your app is then relaunched from scratch, which is why you find yourself in the first view controller. What's upsetting you is the difference between the app's behavior in these two situations.
Apple provides a solution to this situation: UIViewController, along with the App Delegate, has methods permitting you to save and restore state. When the app goes into the background, the current configuration (what view controller's view is showing) is saved. That way, even when the app quits, when it relaunches it can get back to that configuration before it appears to the user. Thus, coming back from background-and-quit looks just like coming back from mere backgrounding.
For full details, see Apple's documentation. This is a good place to start:
https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/PreservingandRestoringState.html
I have a controller with a webview that loads some links. If the link takes some time to load, the webview shows a loading indicator (I don't do it, it is done automatically). If the link does not load, and the user goes back, while he goes to the previous controller, the webview's loading indicator is still active. Any suggestions on how to hide it?
EDIT: image of the indicator I mean:
Indicator
I assume you are referring to the indicator in the status bar that shows when there is network activity. If so, this indicator is controlled by calling
[[UIApplication sharedApplication].networkActivityIndicator=YES|NO;
Applications need to manage the indicator. UIWebView nor the URL loading components of iOS will do this for you.
You should stop a UIWebView instance from continuing to load its view by calling stopLoading.
I have an application (App1) where there is a simple page, whenever there is an incoming call the status bar shows on the top.
I want to make it shift the application down instead of showing it on the application top.
I created one app(App2) sometime back and in that the status bar pushes the view down but I am not able to understand why it does not happen for the new application(App1) I created. I am sure I did not write any code in the application(App2) to handle such scenarios or to listen such notifications. Both the apps are for ios7 and use XIBs. The App2 has a login page and then it shows Tab Bar, for both the pages the view is shifted down whenever there is a call in progress.
Any idea what is going wrong ?
I have an app that needs to fetch some remote configuration files before it starts or after it has been idle for some time in the background. I use a loader view controller to do the job while displaying a splash screen with a loading indicator.
What would be the best way to display the loader (assuming I also want to refresh the whole app after idle time in background):
Display as a modal view controller and dismiss when finished
Set the loader as root view controller and set back the original root when the loader finish (this method triggers a dealloc for the original root and creates it from scratch)
Go with option 1. I've used it many times and it works brilliantly. The best thing about using a modal view controller is that you can smoothly transition when you dismiss it, and you can just present it un-animated on applicationDidFinishLaunch so that it's there instantly for the user to see.
Display as a modal view controller and dismiss when finished.
This option will be more feasible when your app will starts from background state. You can show this with no animation show it will feel like splash and you can fetch remote configuration files.