https://github.com/casatwy/HandyAutoLayout
handy categories for generate NSLayoutConstraint programmatically, and layout your Frame easy
https://github.com/casatwy/HandyAutoLayout
Last synced: 3 months ago
JSON representation
handy categories for generate NSLayoutConstraint programmatically, and layout your Frame easy
- Host: GitHub
- URL: https://github.com/casatwy/HandyAutoLayout
- Owner: casatwy
- License: other
- Created: 2014-08-28T07:56:26.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-28T14:29:54.000Z (about 7 years ago)
- Last Synced: 2025-04-09T19:42:54.396Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 35.2 KB
- Stars: 1,264
- Watchers: 51
- Forks: 248
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HandyAutoLayout
[](https://cocoapods.org) [](http:// opensource.org/licenses/MIT)
`HandyAutoLayout` are handy categories for generate NSLayoutConstraint programatically.
# New features
## Add new methods for 1.1.0
```objective-c
- (void)fromTheTop:(CGFloat)distance ofView:(UIView *)view;
- (void)fromTheBottom:(CGFloat)distance ofView:(UIView *)view;
- (void)fromTheLeft:(CGFloat)distance ofView:(UIView *)view;
- (void)fromTheRight:(CGFloat)distance ofView:(UIView *)view;
```
# Installif you are using AutoLayout:
```
pod 'HandyAutoLayout'
```if you are using Frame:
```
pod 'HandyFrame'
```# Examples
for auto layout:
```objective-c
[self.view addConstraint:[self.tableView constraintCenterXEqualToView:self.view]];
[self.view addConstraint:[self.tableView constraintWidthEqualToView:self.view]];[self.view addConstraints:[self.nextStepButton constraintsSize:CGSizeMake(300.0f, 40.0f)]];
[self.view addConstraint:[self.nextStepButton constraintCenterXEqualToView:self.view]];
```
for frame:```objective-c
[self.subtitleLabel leftEqualToView:self.titleLabel];
[self.subtitleLabel top:14 FromView:self.timeLabel];[self.createPost centerXEqualToView:self.view];
[self.createPost bottomInContainer:19.0f shouldResize:NO];
```