Use CocoaPods.
In your Podfile
pod 'Dinas'
Or download and copy Dinas
to your project
It will be very simple for you if you used Masnory.
UIView *head = [[UIView alloc] init];
head.backgroundColor = [UIColor blackColor];
[self.view addSubview:head];
[head din_makeStructures:^(DINStructureMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalToSuperview().offset(100);
make.size.din_equalTo(CGSizeMake(200, 200));
}];
Before din_makeStructures..
must has superview