When I there is a mistake while authorizing up an individual utilizing Firebase, I am utilizing speedy 4 and also I am attempting to produce an alertView. I have an IBAction for the join switch which will certainly authorize the customer up utilizing message from 2 textfields, one for e-mail and also one for password.

I am primarily attempting to reveal an alertview when there is a mistake with the join procedure, for instance there is a vacant textfield.

*

I have actually affixed a screenshot of the feature to where that is taking place. Since the print declaration outputs a mistake if there is one, I understand that I am in reality obtaining a mistake.

No matter if there is a mistake or otherwise, there is no sharp sight appearing as well as the application does the segue no matter.

This is the outcome that I am obtaining for the alertview currently revealing up.I have actually considered all the various other blog posts regarding this exact same problem however none appear to function.


ios swift firebase swift4 uialertview
Share
Comply with
modified Jan 16 "19 at 8:00
*

Kaushik Makwana
1,29522 gold badges1212 silver badges2424 bronze badges
asked Jan 16 "19 at 2:53
*

Steve SahayadarlinSteve Sahayadarlin
1,15833 gold badges1515 silver badges3131 bronze badges
2
Include a remark|

4 Responses 4


Energetic Oldest Votes
27
This problem takes place as a result of your sight pecking order.

You require to discover what is your Current/Topmost sight controller in sight power structure as well as existing your alert over it.

To figure out upper sight controller usage complying with code:

func getTopMostViewController() -> UIViewController? var topMostViewController = UIApplication.shared.keyWindow?. rootViewController while allow presentedViewController = topMostViewController?. presentedViewController topMostViewController = presentedViewController return topMostViewController Due to the fact that closures might have functioning on an additional string, and also existing your alert over upper sight controller and also usage primary string to offer a sharp.

DispatchQueue.main.async getTopMostViewController()?. existing(alertController, computer animated: real, conclusion: nil) Please describe this pile response: Swift 3 Effort to existing whose sight is not in the home window power structure


Share
Comply with
modified Mar 19 "20 at 9:14
responded to Jan 16 "19 at 6:08
*

Jarvis The AvengerJarvis The Avenger
2,36811 gold badge1616 silver badges3030 bronze badges
6
|Program 1 even more remark
3
Attempt making use of ViewDidAppear as opposed to Sight did Lots.

override func viewDidAppear(_ computer animated: Bool)
Share
Comply with
modified Jan 16 "19 at 6:33

*

Kaushik Makwana
1,29522 gold badges1212 silver badges2424 bronze badges
addressed Jan 16 "19 at 3:48
*

Nishant PathaniaNishant Pathania
34311 silver badge1212 bronze badges
1
Include a remark|
2
You can obtain the leading most check out controller and also have that sight controller existing the alert. So as opposed to self.present usage this strategy as well as see if it functions:

allow topViewController = UIApplication.shared.keyWindow?. rootViewControllertopViewController?. existing(alertController, computer animated: real, conclusion: nil)Additionally attempt offering on the primary string, considering that you"re attempting to reveal the alert in createUser conclusion trainer:

DispatchQueue.main.async
Share
Comply with
modified Jan 16 "19 at 3:13
responded to Jan 16 "19 at 3:09
M RezaM Reza
14.7 k1313 gold badges5656 silver badges6464 bronze badges
8
|Program 3 a lot more remarks
-1
Inspect if you have "dual faucet" concern:

You double touch switch accidentallysignUpBtnPressed is called twiceFirst demand is carried out properly, therefore introducing the segue, as well as the mistake is nilSecond demand returns mistake like "customer currently exists", then attempting to reveal sharp from existing controller, yet segue is currently introduced as well as following controller is currently offered

This is dealt with by utilizing loader with UI barring (as an example SVProgressHUD) - begin loader at the start of the technique as well as reject it in callback.


Share
Comply with
addressed Jan 16 "19 at 3:39
medvedNickmedvedNick
4,42244 gold badges3030 silver badges5050 bronze badges
Include a remark|

Your Response


Many thanks for adding a response to Pile Overflow!

Please make certain to respond to the concern Supply information and also share your study!

However stay clear of ...

Requesting assistance, explanation, or replying to various other answers.Making declarations based upon viewpoint; back them up with recommendations or individual experience.

For more information, see our ideas on composing wonderful solutions.


Draft conserved
Draft threw out

Subscribe or visit


Subscribe utilizing Google
Subscribe making use of Facebook
Join making use of Email as well as Password
Send

Message as a visitor


Call
Email Required, yet never ever revealed


Article as a visitor


Call
Email

Called for, yet never ever revealed


Message Your Solution Discard

By clicking "Blog post Your Solution", you accept our regards to solution, personal privacy plan as well as cookie plan


Not the solution you'& #x 27; re trying to find? Search various other concerns labelled ios swift firebase swift4 uialertview or ask your very own concern.


Google Cloud
Cumulative
Discover more regarding Collectives on Heap Overflow
The Overflow Blog site
Included on Meta
Connected
11
iphone UISearchController accident: Application attempted to existing modal sight controller on itself
9
Are conclusion trainer closures constantly running in the history string?
5
Swift 3 Effort to existing whose sight is not in the home window pecking order
1
AlertController sight is not in the home window power structure
-1
Alert popup Existing not operating in feature
0
Google Check in revealing empty display in iphone
Associated
634
Try to existing UIViewController on UIViewController whose sight is not in the home window power structure
326
Instantiate as well as Existing a viewController in Swift
1
Existing *. viewController on PFLogInViewController whose sight is not in the home window power structure
1
Try to offer on firstController whose sight is not in the home window pecking order
1
Try to existing UIAlertController on UITabBarController whose sight is not in the home window pecking order
5
Swift 3 Effort to existing whose sight is not in the home window pecking order
2
Try to existing UIAlertController whose sight is not in the home window pecking order - Swift Mistake
0
Try to provide ... on ... whose sight is not in the home window pecking order
Warm Network Questions much more warm inquiries

Concern feed
Register for RSS
Inquiry feed To register for this RSS feed, duplicate and also paste this link right into your RSS viewers.


lang-swift
Pile Overflow
Products
Firm
Heap Exchange Network
website layout/ logo design © © 2021 Heap Exchange Inc; customer payments certified under cc by-sa. rev2021.9.16.40224


Pile Overflow functions ideal with JavaScript allowed
*

Your personal privacy

By clicking "Approve all cookies", you concur Heap Exchange can keep cookies on your gadget and also reveal details according to our Cookie Plan.