-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Live reload possible in some way? #35
Comments
If you are doing your layout in custom UIView subclasses then you can already take advantage of live reload by using Classy to set the constants of your constraints. You would need to turn your constants into properties on your view class. custom UIView subclass:
in classy stylesheet
Let me know how you get on 👍 |
Thats a great idea! Would be nice to be able to use it everywhere (also when not doing subclasses) and without the boilerplate. Maybe I can do categories on UIView and UIControl to give them new margin and size properties that will be stored in an ascociated object and in the setter call -setNeedsDisplay on the super view. I'll try to explore this :) |
Seems to work very well with a UIView category to specify optional size and margin that can be referenced from the mas_updateConstraints method. Check out my example here: https://github.com/olegam/LiveLayoutDemo What do you think of this approach? Something that would be suitable to ship wit Classy? |
Glad it's working for you 👍 Also most of the time I would recommend using a custom UIView subclass so that you keep view logic out of your UIViewControllers. |
Ok cool. And thanks again for the advice. I think I will then make a small pod with the category and write a blog post about the approach. |
Sounds great! Looking forward to it :) |
Looking forward too 👍 please, publish the link here, I love Masonry and is always nice to see how others use it! |
Here's the link to my post: http://codeblog.shape.dk/blog/2013/12/16/live-editing-layout-constants-using-classy/ |
Thanks @olegam! |
Amazing, thanks @olegam! 👍 |
Awesome one, cheers @olegam ! |
Very cool @olegam ! |
After I started using classy.as for my styling I have quickly become addicted to the live reloading feature. I'm thinking if we could somehow do something similar for Masonry it would be awesome. I don't know how this would work thought.
It's mostly my constant numbers I would like to change live. Today I use DCIntrospect (https://github.com/lukaswelte/DCIntrospect-ARC) to adjust frames in the simulator and then I have to remember the new constant values and change them in the code afterwards.
Could we define all constants in a separate file that is watched by Masonry. So that changes in the constant file would be injected into the running simulator?
The text was updated successfully, but these errors were encountered: