SnapKit/Masonry

Add Hugging and CompressionResistance Please

Open

#344 geöffnet am 18. Mai 2016

Auf GitHub ansehen
 (9 Kommentare) (16 Reaktionen) (0 zugewiesene Personen)Objective-C (3.153 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (18.166 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

I want to add hugging constraint to a view now, but it is not elegant code to write so

[self.footTitleSignBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.equalTo(self.footView);
    make.centerY.equalTo(self.footView.mas_centerY).offset(0);
}];
[self.footTitleSignBackgroundView setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
[self.footTitleSignBackgroundView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];

I think you should add this syntax into Masonry

make.horizontal.huggingRequired()
make.horizontal.huggingHigh()
make.horizontal.huggingFittingSizeLevel()
make.horizontal.huggingLow()
make.vertical...
make.horizontal.compressionResistance...
make.vertical.compressionResistance...

Contributor Guide