You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.
I love classy, thank you for this awesome framework.
Changing a style class at runtime is very known from web applications. Like expand collapse cases for example.
Question:
Example use case.
I want to add some class on a button after it was clicked.
So in my View I do something like that:
[self.myButton cas_addStyleClass:@"expanded"];
Then I remove the style class if its clicked again.
[self.myButton cas_removeStyleClass:@"expanded"];
Is that a feasible way to use classy?
Do I need to call something else to update the view hierarchy?
While that in general works, it is not supporting any animations inside the animation block.
[UIView animateWithDuration:defaultAnimationDuration
animations:^{
So I dont know what exactly I need to do to perform this style class change as an animation.
The text was updated successfully, but these errors were encountered:
You may need to force an update of styles. Since classy tries to schedule updates in order to group styling updates into one call. to force the change to happen during your animation block try adding
It worked out! It tried it before but it was only on the parent component, thats why overlooked.
I applied it now to each element that has a style change it and works.
I think this technique is so powerful you should mention it in the documentation.
Hi cloudkite,
I love classy, thank you for this awesome framework.
Changing a style class at runtime is very known from web applications. Like expand collapse cases for example.
Question:
Example use case.
I want to add some class on a button after it was clicked.
So in my View I do something like that:
[self.myButton cas_addStyleClass:@"expanded"];
Then I remove the style class if its clicked again.
[self.myButton cas_removeStyleClass:@"expanded"];
Is that a feasible way to use classy?
Do I need to call something else to update the view hierarchy?
While that in general works, it is not supporting any animations inside the animation block.
[UIView animateWithDuration:defaultAnimationDuration
animations:^{
So I dont know what exactly I need to do to perform this style class change as an animation.
The text was updated successfully, but these errors were encountered: