Skip to content

Commit

Permalink
Implement sizeThatFits
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Jun 7, 2018
1 parent a169872 commit eb54068
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WSTagsField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ open class WSTagsField: UIScrollView {
height: min(maxHeight, maxHeightBasedOnNumberOfLines, calculateContentHeight(layoutWidth: preferredMaxLayoutWidth) + contentInset.top + contentInset.bottom))
}

open override func sizeThatFits(_ size: CGSize) -> CGSize {
return .init(width: size.width, height: calculateContentHeight(layoutWidth: size.width) + contentInset.top + contentInset.bottom)
}

// MARK: -
public override init(frame: CGRect) {
super.init(frame: frame)
Expand Down

0 comments on commit eb54068

Please sign in to comment.