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

Is it good idea to change layout/appearance attributes in -drawRect? #157

Open
grigorye opened this issue Jun 15, 2019 · 0 comments
Open

Comments

@grigorye
Copy link

- (void)drawButton {

I'm trying to integrate DLRadioButton in our project and I'm adding snapshot tests for a view containing the button. I face the issue with snapshot not accounting the radio icon and etc.. After studying the sources I believe that the current implementation of -drawButton: just schedules the changes in the appearance/layout vs. result in the real icon rendered, that sounds like misuse of API (-drawRect:).

I tried to solve the issue by moving the code to -layoutSubviews and that kind of eliminated the problem with snapshot/made the whole thing behave as expected. I had to disable check for accessibilityIdentifier though - if somebody could clarify the rationale for the check that would be great.

Would you mind PR addressing this problem?

@grigorye grigorye changed the title Is it good idea to change layout attributes in -drawRect? Is it good idea to change layout/appearance attributes in -drawRect? Jun 15, 2019
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

1 participant