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

"String" is not convertible to "String?" #8

Closed
Andriyas123 opened this issue Feb 28, 2017 · 6 comments
Closed

"String" is not convertible to "String?" #8

Andriyas123 opened this issue Feb 28, 2017 · 6 comments

Comments

@Andriyas123
Copy link

I get an error in my title - "String" is not convertible to "String?" on this line:

            let alertController = PCLBlurEffectAlert.Controller(title: "Uh-Oh!", message: error?.localizedDescription, effect: UIBlurEffect, style: .alert)

Would be glad to hear any of your ideas, tried to attach a screenshot here, but GitHub experiences some problems...

@hryk224
Copy link
Owner

hryk224 commented Feb 28, 2017

Hi @Andriyas123

Thank you for asking.

I get an error in my title - "String" is not convertible to "String?" on this line:

There is an error in the argument of effect.

Please write as follows.

let alertController = PCLBlurEffectAlert.Controller(title: "Uh-Oh!", message: error?.localizedDescription, effect: UIBlurEffect(style: .extraLight), style: .alert)

Also, it can be omitted if UIBlurEffect (style: .extraLight) is used.

let alertController = PCLBlurEffectAlert.Controller(title: "Uh-Oh!", message: error?.localizedDescription, style: .alert)

@Andriyas123
Copy link
Author

That helped! Thank you!

One more question - by default I hide status bar using the following code:

override var prefersStatusBarHidden: Bool { return true }

However, as soon as an alert pops up, black status bar appears. How do I still hide it?

@hryk224 hryk224 closed this as completed in 65cca57 Mar 1, 2017
hryk224 added a commit that referenced this issue Mar 1, 2017
@hryk224 hryk224 reopened this Mar 1, 2017
@hryk224
Copy link
Owner

hryk224 commented Mar 1, 2017

@Andriyas123
Fixed it! #9
I released v2.1.1.
Please $ pod update.

@Andriyas123
Copy link
Author

You are the best, thank you!

P.S. One more thing, I am so sorry... It seems that I can't change button text colour, it stays blue by default. In the previous version I was able to change it to white. I use .cancel

Changing this doesn't help...:

fileprivate var buttonTextColor: [PCLBlurEffectAlert.ActionStyle : UIColor] = [ .default: .black, .cancel: .black, .destructive: .red

I also wanted it to be bold, so I did this in my VC:

alertController.configure(buttonFont: [.cancel: UIFont.boldSystemFont(ofSize: 20)])

But how do I change the colour and why is it blue?...

Thank you, hryk224!

@hryk224
Copy link
Owner

hryk224 commented Mar 1, 2017

@Andriyas123

Please write as follows.

alertController.configure(buttonTextColor: [.cancel:. black])

When changing together font.

alertController.configure(buttonFont: [.cancel: UIFont.boldSystemFont(ofSize: 20)],
                          buttonTextColor: [.cancel:. black])

If changing .default .cancel .destructive

alertController.configure(buttonTextColor: [.default: .black,
                                            .cancel: .black,
                                            .destructive: . red])

Please try it!

@Andriyas123
Copy link
Author

hryk224,

It, indeed, worked like a charm. Thank you!!!

@hryk224 hryk224 closed this as completed Mar 1, 2017
This issue was closed.
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