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

setTitles doesn't work #88

Closed
ysoftware opened this issue Jan 15, 2017 · 3 comments
Closed

setTitles doesn't work #88

ysoftware opened this issue Jan 15, 2017 · 3 comments

Comments

@ysoftware
Copy link

ysoftware commented Jan 15, 2017

Class PermissionButton

I'm not sure what's going on, but in
func setTitles(_ titles: [PermissionStatus: String?], forState state: UIControlState = UIControlState()) the first line is
guard [.highlighted].contains(state) else { return }
which means, with the default value of state you've specified, this function will never run.
Same goes for a few other functions.

I tried to set up my buttons just like in readme and their title is always empty.

ysoftware added a commit to ysoftware/Permission that referenced this issue Jan 15, 2017
and  filled an issue with developer
delba#88
@ysoftware
Copy link
Author

It also seems, you can't set multiple titles for .normal state.
I'm not sure what that guard check was supposed to do, but removing it in my fork solved my problem.

@delba
Copy link
Owner

delba commented Jan 15, 2017

Hey @ysoftware, thanks for the issue.

That's definitely a bug that was introduced during the automatic transition to Swift 3 (1ef678a) and has been fixed here 37c2770.

It also seems, you can't set multiple titles for .normal state.

I'm not sure what you mean (?)

The guard is preventing the user to set titles for states other than .normal or .highlighted. It might be removed completely in the upcoming version of the lib.

Thanks again!

@delba delba closed this as completed Jan 15, 2017
@ysoftware
Copy link
Author

ysoftware commented Jan 15, 2017

I'm not sure what you mean (?)

Since it's only checking for [.highlighted] and not .normal.

Anyway, Thanks for the responce.

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