I'm trying to close alert when the alert is present with back key press, else the page will be navigated to another page. I've tried alert.dismiss() in ionViewDidLeave & WillLeave but its not triggering in the back button.It's navigating back page still alert or ion-select options are present in the other page.Please help me to come out from this problem.
Related
whenever user click the back button on homepage, it takes him back to the login page when I use persistent_bottom_nav_bar how could I prevent that ?
I am trying to prevent logout when user clicks back button
I created a sign up screen and I used a pageview in it. That page view has a controller and that controller also works with a smooth page indicator I added. The page view is also connected to a button I created using a container I designed wrapped in a gesture detector. The page changes to the next when the button is pressed and finally on the last page the button signs up the user. I want the button to be inactive and designed differently on all pages until the condition are met.
The first page requires an email
The second page requires a password
The third page is to confirm the password
You can set the onPressed Callback of a button to null and the button will be disabled.
...
onPressed: condition_is_met ? (){} : null,
...
I created a login screen using SwiftUI.
When I press a login button (after the validation of email and password), it navigates to a ViewController.
Login state is stored in a userDefault Boolean for use later when the app is launched again.
In SceneDelegate, userDefault is checked--if it istrue, the main screen is shown; otherwise the login screen is shown.
In a View Controller I created a itemBar Logout button which navigates back to the login screen when it is pressed.
I managed to implement the above logic.
The problem happens when I successfully log in then close the app in a simulator and open again.
When I press the Logout Bar item, the app isn't responsive and does not navigate back to the Login screen.
I tried to use the Coordinator pattern without success. Any help is appreciated!
I am presenting a view controller as a page sheet. On this page sheet one of the buttons sends the user to a website using SFSafariViewController. When I select done in the SFSafariViewController the previous VC displays fullscreen and then snaps back to page sheet. How can I make it remain as a page sheet when the SFSafariVC is closed?
Page Sheet before SFSafariVC called
Immediately after clicking "done" in SFSafariVC
Here's the deal:
I have a navigation-based project with a menu screen as the root view. When I tap a button on the menu screen, the navigation controller pops a KalViewController onto the stack (kal calendar).
The calendar appears, and for about a 6 second period the calendar is downloading JSON data from the internet to populate the calendar with events. However, if the user taps Back (to go back to the main menu) during this time, the app crashes or the calendar continues to load the data even when I am on the main screen. (evidenced by the network activity indicator continuing to spin)
1-- I was wondering if there is any way, when I tap the Back button, to cancel that download process so that my objects will release properly? (maybe using threads??)
OR
2-- Somehow prevent the user from tapping the back button while the data is still downloading. (Similar to how a UIAlertView prevents a user from clicking anything on the screen except for 'OK' to dismiss the alert message)
PLEASE help! Thank you very much in advance!