From 4ee595ae12e1854e6c3fe5eab346f78338f6a1e3 Mon Sep 17 00:00:00 2001 From: Ryan Romanchuk Date: Fri, 17 Aug 2018 22:40:12 -0700 Subject: [PATCH 1/2] provide a warning if the implementor is using a container view which may cuase SLKTextViewController to calculate incorrect bottom margin calculations. https://github.com/slackhq/SlackTextViewController/issues/668 --- Source/SLKTextViewController.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/SLKTextViewController.m b/Source/SLKTextViewController.m index 6636d0fb..2feb45ef 100644 --- a/Source/SLKTextViewController.m +++ b/Source/SLKTextViewController.m @@ -431,6 +431,9 @@ - (CGFloat)slk_appropriateBottomMargin // Considers the bottom tab bar, unless it will be hidden if (tabBar && !tabBar.hidden && !self.hidesBottomBarWhenPushed) { + if (self.parentController && self.parentController.hidesBottomBarWhenPushed != self.hidesBottomBarWhenPushed) { + NSLog(@"WARNING!!!: Your SLKTextViewController is inside a UIContainerView that has a different setting for hidesBottomBarWhenPushed. If unintended, this will lead to incorrect bottom margin calculations."); + } return CGRectGetHeight(tabBar.frame); } } From e564e35a8535fcdc68588a968e665c4baf9b448e Mon Sep 17 00:00:00 2001 From: Ryan Romanchuk Date: Fri, 17 Aug 2018 22:48:27 -0700 Subject: [PATCH 2/2] update changelog, use correct nomenclature for container view --- CHANGELOG.md | 1 + Source/SLKTextViewController.m | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d2ab34..cd1e3b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [Version 1.9.7](https://github.com/slackhq/SlackTextViewController/releases/tag/v1.9.7) +- Add a warning to console about potential configuration issues when embedding SlackTextViewController into a UIContainerView when there is a configuration mismatch between SlackTextViewController and parent. By @rromanchuk (#668) #### Features: diff --git a/Source/SLKTextViewController.m b/Source/SLKTextViewController.m index 2feb45ef..3bd1a7b4 100644 --- a/Source/SLKTextViewController.m +++ b/Source/SLKTextViewController.m @@ -432,7 +432,7 @@ - (CGFloat)slk_appropriateBottomMargin // Considers the bottom tab bar, unless it will be hidden if (tabBar && !tabBar.hidden && !self.hidesBottomBarWhenPushed) { if (self.parentController && self.parentController.hidesBottomBarWhenPushed != self.hidesBottomBarWhenPushed) { - NSLog(@"WARNING!!!: Your SLKTextViewController is inside a UIContainerView that has a different setting for hidesBottomBarWhenPushed. If unintended, this will lead to incorrect bottom margin calculations."); + NSLog(@"WARNING!!!: Your SLKTextViewController is inside a Container View that has a different setting for hidesBottomBarWhenPushed. If unintended, this will lead to incorrect bottom margin calculations."); } return CGRectGetHeight(tabBar.frame); }