Skip to content

Commit

Permalink
Merge pull request #46 from kaandedeoglu/master
Browse files Browse the repository at this point in the history
Remove sizeThatFits - should fix most autolayout and sizing errors.
  • Loading branch information
polqf committed Mar 11, 2016
2 parents 8d539e1 + 64e07a1 commit 2954215
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions ActiveLabel/ActiveLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,7 @@ public protocol ActiveLabelDelegate: class {
layoutManager.drawBackgroundForGlyphRange(range, atPoint: newOrigin)
layoutManager.drawGlyphsForGlyphRange(range, atPoint: newOrigin)
}

public override func sizeThatFits(size: CGSize) -> CGSize {
let currentSize = textContainer.size
defer {
textContainer.size = currentSize
}

textContainer.size = size
return layoutManager.usedRectForTextContainer(textContainer).size
}


// MARK: - touch events
func onTouch(touch: UITouch) -> Bool {
let location = touch.locationInView(self)
Expand Down

0 comments on commit 2954215

Please sign in to comment.