jessesquires / JSQMessagesViewController

An elegant messages UI library for iOS
https://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/
Other
11.14k stars 2.81k forks source link

TopContentAdditionalInset has no effect #589

Closed turley closed 10 years ago

turley commented 10 years ago

https://github.com/jessesquires/JSQMessagesViewController/blob/develop/JSQMessagesViewController/Controllers/JSQMessagesViewController.m

I've noticed that jsq_configureMessagesViewController sets the topContentAdditionalInset property to 0 right before calling [self jsq_updateCollectionViewInsets].

As a consequence, if I (in my subclass) set the property to a non-zero value before calling [super viewDidLoad], the value is changed back to 0, and if I set it after, jsq_updateCollectionViewInsets isn't called again to update the view insets (at least not until another event triggers it).

To clarify - the additional inset is applied after an event like tapping in the text area, but I would expect it to take effect initially (if set) on viewDidLoad.

Maybe a custom setter for topContentAdditionalInset could call jsq_updateCollectionViewInsets, or a public method could be exposed to force an update of the view insets. What do you think?

jessesquires commented 10 years ago

thanks @turley ! good catch. I'll get this fixed for 6.0