Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Conversation

@AnthonyMDev
Copy link

This allows a custom nib to be used with a subclass of JSQMessagesViewController,

By implementing the nibName and nibBundle class methods in the subclass, a user can load a custom nib.

I really needed to use this myself, and I'm hoping it is allowed into the main repository.

If you are not sure why anyone would need to do this, I'm using it to load a subclass of the input toolbar that has different logic for when the send button should be enabled. In my application, I want users to only be able to reply to messages that were sent to them by us, but not initiate a conversation on their own, so I'm disabling the send button if there are no messages in the chat.

jessesquires added a commit that referenced this pull request Oct 20, 2014
jessesquires added a commit that referenced this pull request Oct 20, 2014
@jessesquires
Copy link
Owner

Thanks @AnthonyMDev 👍

I think I've just solved this in an even simpler way. (See the commits above, 02fdee0 and 4554962.)

If you don't mind, checkout the latest from develop and give it a try.

All you need to do is override the following:

 // required
+ (UINib *)nib;

// technically not *required*, but should be overridden for consistency
+ (instancetype)messagesViewController; 

@AnthonyMDev
Copy link
Author

Thanks so much!

@jessesquires
Copy link
Owner

No problem - let me know if there are any issues!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants