CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2015 |
Maintained by Andy LaVoy.
FMFrameMaker is an Objective-C library for simplifying, encapsulating, and optimizing view layout logic into a single block for each view.
CGRect
frames are based upon the top left corner (origin
) and the width and height (size
). If you want to layout from the right, you have to do math. If you want to center, you have to do math. If you want to inset from the edges, you have to do math. With FrameMaker, you can forget about the math. You just specify the pieces you want to anchor, and FrameMaker figures out the rest.
-setFrame:
to minimize laying out the view hierarchyThis library was inspired by Masonry, but without the AutoLayout.
#import "FMFrameMaker.h"
Center a sized view
[view fm_makeFrame:^(FMFrameMaker *frameMaker) {
frameMaker.size = CGSizeMake(100, 100);
frameMaker.centered = YES;
}];
Show a sized view 10 points from the bottom right corner
[view fm_makeFrame:^(FMFrameMaker *frameMaker) {
frameMaker.size = CGSizeMake(100, 100);
frameMaker.bottom = 10;
frameMaker.right = 10;
}];
Show a view sized inset 20 points vertically and horizontally
[view fm_makeFrame:^(FMFrameMaker *frameMaker) {
frameMaker.size = CGSizeMake(100, 100);
frameMaker.horizontalOffset = 20;
frameMaker.verticalOffset = 20;
}];
Check out the demo project for more examples.
FrameMaker uses simple APIs and is compatible all the way back to iOS 2.0.
Yuuuup!
FrameMaker is available under the MIT license.