//==============================
__weak __typeof (self) weakSelf = self;
UIView *redView = [[UIView alloc]init];
[self.view addSubview:redView];
[redView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(weakSelf.view.mas_topMargin);
make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(0);
make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(0);
make.bottom.mas_equalTo(weakSelf.view.mas_bottomMargin);
}];
redView.backgroundColor = [UIColor redColor];
报错
-[UIView mas_topMargin]: unrecognized selector sent to instance
解决方法,在pod
中修改Masonry
最低支持版本为iOS 8.0即可,
运行成功,