146 questions
0 votes
2 answers
76 views
Button Tap - ShareSheet rootViewController Issue
I'm having issues when tapping buttons that either open the share sheet or email. Behavior - Does not work when app is launched after install. Works fine after restarting app. UIApplication.shared....
0 votes
1 answer
43 views
How do i set/change the Root ViewController as a UINavigationController when the user opens the app a second time in swift?
i have an app where the user sets a username in the WelcomeViewController the first time he launches the app. This Username gets stored in Firestore. I want to change the ViewController that gets ...
12 votes
2 answers
3k views
How to pass rootViewController to Google sign-in in SwiftUi?
This is my first question here after years of finding every answer I needed. I have coded some apps for iPhone in IOS, I'm not always sure of what I'm doing but they work! They use Google sign in and ...
2 votes
1 answer
167 views
How to detect if button was pressed after app restart in swift?
I am trying to determine if user selected the "reset" button after the app restarts. With this code, it will go back to the root controller when the app is open or in the background. Once I ...
0 votes
1 answer
263 views
"Cancel" button (UIBarButtonItem) not working in iOS view controller
I am trying to add a "Cancel" button in my viewcontroller's navigation bar programmatically. The sole purpose of the button is to dismiss the current viewcontroller and go back to the root ...
1 vote
1 answer
2k views
SwiftUI [ShareSheet] connection invalidated. Attempt to present which is already presenting
I'm trying to create a share button in my app. App on SwiftUi, Xcode version 13.2.1, iPhone 15.2 If I use this code: let url = URL(string: "https://example.com") let activityController = ...
3 votes
3 answers
2k views
when need to switch the rootViewController
I've been working on a Swift project and I have two view controllers, the login view controller & the home view controller. When a user launches the app, I want to display the login view ...
2 votes
1 answer
94 views
SignUp Button Not Working While Handling RootViewController?
I'm building an iOS app using a Storyboard. The root view controller is a Home View Controller. I'm creating the login/logout process, and it's mostly working fine, but I've got a few issues. I need ...
5 votes
3 answers
10k views
How to get rid of message " 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead" with AdMob banner?
I want to get rid of the " 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead" message in my function (my function works very well by the way.)...
0 votes
2 answers
408 views
viewWillAppear not being called after popToRootViewController
This is the flow: VC1 ->(PUSH)-> VC2 ->(PUSH) -> VC3 When clicking a button in VC3 I am calling the method below and it works properly - taking me back to VC1: self.navigationController?....
-2 votes
1 answer
95 views
getting bugs with viewController instantiation from SceneDelegate
So my goal is to be able to show the right vc without any bugs. There's actually multiple bugs with this issue. First it would make sense to show the block of code and explain it first so you can get ...
0 votes
1 answer
587 views
If i logout and login then unable to login for the first time, why? in swift
my app flow like below uinavigationcontroller(is initial viewcontroller) -> loginVC -> homeVC i am having SceneDelegate in project, ...
0 votes
2 answers
87 views
(Objective-C) Difference between accessing the navigation stack through the window.rootView and keyWindow
Does anyone know what the difference is between TabBarController* tabBar = (TabBarController *)_window.rootViewController; UINavigationController* navigationController = tabBar.selectedViewController; ...
1 vote
2 answers
1k views
How to do signin / signup and logout navigation using userdefaults in swift?
i have scenedelegate, appdelegate, signinVC, signupVC, and homeVC viewcontroller flow like below UINavigationController(initialVC) ->SigninVC (signin and signup buttons) -> homeVC(...
1 vote
0 answers
25 views
why i am not able to move from loginpage in swift?
I have Registration, Login and Home viewcontrollers my app flow is 1) if i register with name password then i need to go home page and in home page if i tap logout i need to go login page 2) after ...