tristanhimmelman / THContactPicker

An iOS view used for selecting contacts. This view is inspired by the contact selection in the iOS Mail and Messages apps
MIT License
663 stars 173 forks source link

TextView view frame not changing with autoLayout #53

Open cloudjanak opened 8 years ago

crrobinson14 commented 8 years ago

Confirmed here. Anybody have any workarounds? Nothing I'm trying is working here either.

tristanhimmelman commented 8 years ago

My best guess would be to call layoutSubviews on THContactPickerView

romanzes commented 8 years ago

Workaround which worked for me:

@IBOutlet weak var buddyPicker: THContactPickerView!
@IBOutlet weak var contactPickerHeight: NSLayoutConstraint!

func contactPickerDidResize(contactPicker: THContactPickerView!) {
    self.contactPickerHeight.constant = contactPicker.frame.height
    UIView.animateWithDuration(0.2) {
        self.view.layoutIfNeeded()
    }
}