Masonry icon indicating copy to clipboard operation
Masonry copied to clipboard

equalTo(@[@10,@30]),What is the meaning of using an array in parentheses of equalTo

Open iOSHCX opened this issue 5 years ago • 2 comments

iOSHCX avatar Jun 15 '20 12:06 iOSHCX

i want to konw In what scene will we use Array in equalTo()

iOSHCX avatar Jun 15 '20 12:06 iOSHCX

Example: redView.height = greenView.height = blueView.height

[greenView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.height.equalTo(redView.mas_height);
    make.height.equalTo(blueView.mas_height);
}];

[redView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.height.equalTo(@[greenView, blueView]); // pass array of views
}];

[blueView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.height.equalTo(@[greenView.mas_height, redView.mas_height]); // pass array of attributes
}];

cntrump avatar Jun 01 '21 16:06 cntrump