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

PermissionButton improvements #94

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add explicit update method to PermissionButton
Jeehut committed Sep 14, 2017

Verified

This commit was signed with the committer’s verified signature.
commit 972ce1d8177e3087f8b5bac2511d5aac47575a2c
10 changes: 9 additions & 1 deletion Source/PermissionButton.swift
Original file line number Diff line number Diff line change
@@ -450,7 +450,15 @@ open class PermissionButton: UIButton {
Tells the view that its superview changed.
*/
open override func didMoveToSuperview() {
render(.normal)
update()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use render() here please? I prefer to keep update() solely as a public interface.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, just updated this.

}

/**
Tells the view that it needs to update.
Use this then an app comes to foreground and you have a PermissionButton on screen.
*/
public func update() {
render()
}
}