How to stop segue from automatically unwind - ios

I am working on an app on xcode Version 6.2, it is quite a simple app. You can register and login for now however whenever i try to login with the correct username and password it loads the "protected" page the automatically sends me back to login page showing me this error code:"2015-10-25 23:22:48.254 Test[46561:6996119] Warning: Attempt to present on whose view is not in the window hierarchy!". When i stop building the app and then build it loads the "protected" page and i am signed in and can logout.
I am quite new to xcode and i followed a tutorial on Youtube then tried to modify it.
I am using Parse to store data if that is to any help..
I can provide the view of the different views and code

It is hard to debug without any further info, but my guess is that you are likely trying to present a view controller whose views you are adding into the UIAlertView that pops out that notifies whether your login is successful. So for example, if you are trying to add some views into the UIAlertView after it has been dismissed, this error will show up.
If that is the case, use presentViewController:animated:completion in your login view controller to present the secret page instead.
If that doesn't help, please post the code regarding your login completion block from Parse.

My view hierachy
When i login(purple page), the initial page(green page) is presented before "protected"(red page) is loaded.

Related

Modal window don't work times to times in any browser

I create application on ruby on rails and add modal window for login. I put modal code in partial layouts/header. I expect it must work on every page of my app but not. Modal don't open in home/index. It's start work on home/about. I don't understand why. I'll update my ask If needs code. Can anyone help me understand?
I try to move modal code on another pages but get same effect.
home/index and home/about is URI?
Make sure you use the same layout (header file) and the modal element exist in HTML of home/index (you can use dev tool - f12 for checking)
Please, Does the modal need to be triggered by a button or something?

How to know when a controller unload in Swift

In my iOS application I have a login page that leads to the main pages. You can navigate between these pages with a tab bar. On each of these pages you can log out and return to the login page using the dismiss function. I wanted to know if by doing this I was leaving some controllers in a vacuum without having unloaded them.
For example, if I log in, go to the second tab and log out, will the first tab be unloaded?
And more broadly how does navigation with a tab bar work if it's not a stack?
On successfull login change root of application to TabBarController.When user kill application and launch again then set root according to the login status of a user. And when user logout from application then again change root to login controller.
Please check attached link

Why apple login sheet in iOS 13 shows `null` as the app name

Within the application's webview I open the apple page for login. In the app, the iOS system knows it comes from apple so the action sheet shows up for biometric authentication.
All good and all works fine. I can authenticate myself and I will be successfully logged in. The icon in the action sheet is loaded from the app, but the app name is not present. Instead it shows null.
Currently I tried to
add title to navigation item,
add title to web view controller within the navigation
the webview title however is empty. It is out of my scope to set this up, because the webpage comes from apple.
I added App Name to WKWebView in storyboard (btw, I can't seem to figure out what exactly is App Name in this case as WKWebView doesn't seem to have any reference in the code and no documentation)
As far as I know the icon in the action sheet is loaded from the application, so I would believe the name would also be loaded from the app.
Please see the screen view.

How does iOS 13 Safari link preview work?

In iOS 13 Safari, when you long press on a link, you see a preview of the linked page, along with some menu items. If you tap the preview, you navigate to that page.
Now, I see how to intervene in the long-press-and-preview process. This used to be peek-and-pop, but in iOS 13 that's deprecated and we're supposed to use func webView(_:contextMenuConfigurationForElement:) and so forth. Fine, but how would I imitate what Safari does?
The problem is that as my preview provider I have to supply a view controller. So I'm going to need a different view controller with a web view showing the linked page. Okay, I can do that. But then when the user taps the preview to dismiss it, I want to respond by loading the same linked page into my real web view.
But that's the problem. That loading takes time. In Safari, by contrast, when you tap the preview, boom, there's the same page already loaded. How do they do that? How would I do the same thing? How can I load the page into a different view controller, cache it, and communicate that cached page back to my real web view?

Facebook logout button (iOS SDK) proper segue upon logging out

I have ran into some trouble when using facebooks login framework. Logging in is fine, simple and works. My problem is when I click the FBSK logout button there is a verification (are you sure...) that pops up which stops me from using an action segue - what if the user says no, how can you ensure the segue runs only on confirmation?
So I am puzzled as to how to segue from one controller after the logout is successful because putting code in the viewDidAppear function doesn't work because the view isn't being refreshed, only the label changing from 'logout' to 'login'.
Update: Opted for #IBAction methods and used FBSDKLoginManager.logOut() to logout, however this removes the verification part and also opens the login pop-up straight away.
So I am still open to any suggestions.
The comment on your question is correct, get your view controller to conform to FBSDKLoginButtonDelegate and then control-click it to inspect the header file for your version of the SDK and what methods to implement.
Don't forget to tell your button its delegate is your view controller.

Resources