Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iOSHCX opened this issue Jun 15, 2020 · 2 comments

Comments

@iOSHCX
Copy link

iOSHCX commented Jun 15, 2020

No description provided.

@iOSHCX
Copy link
Author

iOSHCX commented Jun 15, 2020

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

@cntrump
Copy link
Contributor

cntrump commented Jun 1, 2021

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
}];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants