Skip to content

Commit

Permalink
Refactor: support iOS8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuChuanRui committed Nov 14, 2016
1 parent 143d761 commit d8841ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Example/Example/CRTagsLabel/CRTagsLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ - (void)setupTagsLabel {
- (void)layoutSubviews {
[super layoutSubviews];

[self updateTagsLabelHeight];
}

#pragma mark - helper
- (void)updateTagsLabelHeight {
CGFloat height = self.frame.size.height;
if (height == currentHeight) {
return;
Expand Down Expand Up @@ -94,6 +99,11 @@ - (void)setTags:(NSArray *)tags {
if (self.updateTags) {
self.attributedText = self.updateTags();
}

[self setNeedsLayout];
[self layoutIfNeeded];

[self updateTagsLabelHeight];
}


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ tagsLabel.tags = tags;
}];
```
## Requirements
* iOS 8.0+
* ARC
## TODO
* add to CocoaPods
Expand Down

0 comments on commit d8841ca

Please sign in to comment.