Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert not showing #42

Closed
Mar-k opened this issue Jan 12, 2017 · 3 comments
Closed

Alert not showing #42

Mar-k opened this issue Jan 12, 2017 · 3 comments

Comments

@Mar-k
Copy link

Mar-k commented Jan 12, 2017

I am using the latest pod version of FCAlertView

The alert view is not showing for me, the first few times.

This is the code I use to show the FCAlertView (Method 1):
let alert = FCAlertView() alert.makeAlertTypeWarning() alert.blurBackground = true alert.showAlert(withTitle: nil, withSubtitle: withText.localized, withCustomImage: nil, withDoneButtonTitle: nil, andButtons: nil)

Or this way (Method 2):

let alert = FCAlertView() alert.colorScheme = "#8DCA63".hexColor alert.blurBackground = true alert.dismissOnOutsideTouch = true alert.avoidCustomImageTint = true alert.delegate = self alert.showAlert(withTitle: nil, withSubtitle: "String", withCustomImage: UIImage(named: "image") , withDoneButtonTitle: "String", andButtons: ["String"])

But it only shows when I call it the way I showed above in a certain view controller.

Let's say we have VC1, VC2 and VC3

I call the Method 2 in VC1 and it doesn't show an alert, then I call the Method 1 in VC2 and it doesn't show an alert, then in VC3 I call Method 2 and it shows an alert. After it shows up the first time it shows up on every VC.

Maybe I am doing something stupid or wrong, but I've tried everything and I can't get it to work...

I hope someone haves a solution

@Mar-k
Copy link
Author

Mar-k commented Jan 12, 2017

@nimati

@Mar-k
Copy link
Author

Mar-k commented Jan 13, 2017

I made such a stupid mistake. Sorry for the hassle. I was calling the second method from a seperate class and not directly on a viewcontroller. Then I noticed that there was also this method:

alert.showAlert(inView: <#T##UIViewController!#>, withTitle: <#T##String!#>, withSubtitle: <#T##String!#>, withCustomImage: <#T##UIImage!#>, withDoneButtonTitle: <#T##String!#>, andButtons: <#T##[Any]!#>)

So I passed the view and it worked. Again sorry :)

@Mar-k Mar-k closed this as completed Jan 13, 2017
@nimati
Copy link
Owner

nimati commented Jan 18, 2017

@Mar-k No worries, and no hassle at all! Glad you got it solved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants