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

Get the currentTitle of UIButton from the titleLabel #33

Merged
merged 1 commit into from
Feb 6, 2017

Conversation

rdougan
Copy link
Contributor

@rdougan rdougan commented Feb 5, 2017

I noticed that if I directly added a icon via SwiftIconButton Icon @IBInspectable and did not set a title, I would get an optional not found error. This was due to self.currentTitle being nil when parseIcon was executed.

I changed the code to use self.titleLabel.text, which is what the @IBInspectable sets. I also wrapped it in the guard statement so it's safer.

@segecey
Copy link
Owner

segecey commented Feb 6, 2017

Thanks for this pr

@segecey segecey merged commit 739c096 into segecey:master Feb 6, 2017
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

Successfully merging this pull request may close these issues.

2 participants