Skip to content

Commit 06218b0

Browse files
authored
Merge pull request #1 from sabrinaip/master
add bug fix for UIToolbarContentView for iOS 11.2
2 parents 214cbee + 7c02cfe commit 06218b0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Source/SLKTextInputbar.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ - (void)layoutIfNeeded
111111
[super layoutIfNeeded];
112112
}
113113

114+
// Compensate for toolbarContentView layout bug in iOS 11.2
115+
// https://github.com/slackhq/SlackTextViewController/issues/604
116+
- (void)layoutSubviews
117+
{
118+
[super layoutSubviews];
119+
120+
static BOOL toolbarContentViewEnabled = YES;
121+
122+
if (toolbarContentViewEnabled) {
123+
for (id view in self.subviews) {
124+
if ([view isKindOfClass:(NSClassFromString(@"_UIToolbarContentView"))]) {
125+
UIView *toolbarContentView = view;
126+
toolbarContentView.userInteractionEnabled = NO;
127+
}
128+
}
129+
toolbarContentViewEnabled = NO;
130+
}
131+
}
132+
114133
- (CGSize)intrinsicContentSize
115134
{
116135
return CGSizeMake(UIViewNoIntrinsicMetric, [self minimumInputbarHeight]);

0 commit comments

Comments
 (0)