Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inputContainer position when presenting BaseChatViewController as child #338

Merged
merged 2 commits into from
Jul 26, 2017

Conversation

KaterinaPetrova
Copy link
Contributor

When we use BaseChatViewController as childViewController (for example, i need this, as i display chat only on half of the screen, or use it in pager container) check hidesBottomBarWhenPushed == true and navigationController?.viewControllers.last is not working (because last view controller is actually parentVC).
So we need to made this check on controller, which is really in navigation stack.

@@ -186,7 +186,15 @@ open class BaseChatViewController: UIViewController, UICollectionViewDataSource,
// If we have been pushed on nav controller and hidesBottomBarWhenPushed = true, then ignore bottomLayoutMargin
// because it has incorrect value when we actually have a bottom bar (tabbar)

if self.hidesBottomBarWhenPushed && (navigationController?.viewControllers.count ?? 0) > 1 && navigationController?.viewControllers.last == self {
// Also if instance of BaseChatViewController is added as childViewController to another view controller, we had to check all this stuf on parent instance instead of self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KaterinaPetrova Thank you for your changes!

May I ask you to move this code to a separate function setupInputContainerBottomConstraint? This method becomes too big now

Also, can you replace Ctrl with Controller. We are trying to avoid shorthand writing in this repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of coarse, thanks for review. I've put this function near inputContainerBottomConstraint variable declaration, is it okay?

@AntonPalich AntonPalich merged commit 9e8820f into badoo:master Jul 26, 2017
@AntonPalich
Copy link
Contributor

@KaterinaPetrova 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants