Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Conversation

@dzenbot
Copy link

@dzenbot dzenbot commented Aug 12, 2015

@aryaxt: I've made some improvements and refactorings to your original PR in #229:

  • Renamed hideInputBar:animated: to setTextInputbarHidden:animated:
  • Dismissed the keyboard and the auto-completion view right after hiding the textInputBar
  • Fixed cases where hiding the textInputBar wouldn't be possible when the keyboard was up
  • Avoided hiding the textInputBar with alpha, instead fixed some auto-layout constraints so the textView would follow the dismissal animation

Known bugs:

  • when rotating the device, the scrollView's wouldn't extend to the bottom of the screen when the textInputBar is hidden.

Please try pulling this branch. Thanks for this great improvement!

Copy link
Contributor

Choose a reason for hiding this comment

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

This logic is not needed anymore, duration would always be 0.25

Copy link
Author

Choose a reason for hiding this comment

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

Well, this is to avoid calling the logic in. UIView animation block if the textInputBat should be hidden without animation.

Copy link
Author

Choose a reason for hiding this comment

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

Oh, my bad. You're right!
I'll fix it in this branch.

@aryaxt
Copy link
Contributor

aryaxt commented Aug 12, 2015

@dzenbot Thanks for the quick response, I made a comment and already pulled the changes. Would you like me to update that line of code in my branch?

@aryaxt
Copy link
Contributor

aryaxt commented Aug 13, 2015

@dzenbot This branch is broken, the bar disappears as soon as textfield becomes first response.

@dzenbot dzenbot changed the title Adds the ability to show/hide input bar. Closes #203 Adds the ability to show/hide input bar. Closes #203. Closes #209 Aug 13, 2015
@dzenbot dzenbot changed the title Adds the ability to show/hide input bar. Closes #203. Closes #209 Adds the ability to show/hide input bar. Closes #203. Closes #229 Aug 13, 2015
@dzenbot
Copy link
Author

dzenbot commented Aug 13, 2015

Would appreciate more context about the issue you're facing.
It behaves just great on the sample project.

@aryaxt
Copy link
Contributor

aryaxt commented Aug 13, 2015

I was ending up with this state, will do more testing on this today and comment back.

ios simulator screen shot aug 12 2015 5 05 17 pm

@dzenbot
Copy link
Author

dzenbot commented Aug 13, 2015

I noticed that you have a subview above your cells. Is that a section header view? Or a custom subview?

Can you repro on the sample project?

@aryaxt
Copy link
Contributor

aryaxt commented Aug 13, 2015

That's just a UIView added on top of the main tableView.
I had to release a new version, so I checked out 1.5.1 and added the code in my original PR.

I'll update to that branch again sometimes today or tomorrow, and will report back.

Thanks

@aryaxt
Copy link
Contributor

aryaxt commented Aug 16, 2015

Investigated this, and it seem like the issue is not related to this branch. This issue was introduced in 1.6.
Switching to 1.5.2 resolves the issue.

textview becomes first responder but the toolbar doesn't appear. It looks like it's hidden behind another view, because as I'm scrolling down and dismissing the keyboard interactively I can see parts of the toolbar animating down along with the keyboard

screen shot 2015-08-16 at 10 01 01 am

ios simulator screen shot aug 16 2015 10 08 18 am

Here is the viewHierarchy when the toolbar is hidden:

po [self.view recursiveDescription]
<UIView: 0x7fac1d8c5280; frame = (0 0; 375 667); autoresize = W+H; layer = <CALayer: 0x7fac1d849790>>
   | <UITableView: 0x7fac1d065800; frame = (0 64; 375 301); gestureRecognizers = <NSArray: 0x7fac1d8661d0>; layer = <CALayer: 0x7fac1d807290>; contentOffset: {0, 0}; contentSize: {375, 236}>
   |    | <UITableViewWrapperView: 0x7fac1d886480; frame = (0 0; 375 301); gestureRecognizers = <NSArray: 0x7fac1d83a250>; layer = <CALayer: 0x7fac1d838180>; contentOffset: {0, 0}; contentSize: {375, 301}>
   |    |    | <CSConversationMessageTableViewCell: 0x7fac1dcb8150; baseClass = UITableViewCell; frame = (0 177; 375 59); autoresize = W; layer = <CALayer: 0x7fac1dcb7990>>
   |    |    |    | <UITableViewCellContentView: 0x7fac1dcb7e20; frame = (0 0; 375 59); opaque = NO; gestureRecognizers = <NSArray: 0x7fac1dcc2550>; layer = <CALayer: 0x7fac1dcb7ef0>>
   |    |    |    |    | <UIImageView: 0x7fac1dcb8460; frame = (15 15; 40 40); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dcb7f10>>
   |    |    |    |    | <UITextView: 0x7fac1b85fc00; frame = (70 15; 290 34); text = 'sdfsdf
Jul 28 • 11:20 AM'; clipsToBounds = YES; autoresize = W+RM+BM; gestureRecognizers = <NSArray: 0x7fac1dcb9730>; layer = <CALayer: 0x7fac1dcb85e0>; contentOffset: {0, 0}; contentSize: {290, 34}>
   |    |    |    |    |    | <<_UITextContainerView: 0x7fac1dcba430; frame = (0 0; 290 34); layer = <_UITextTiledLayer: 0x7fac1dcba560>> minSize = {290, 34}, maxSize = {290, 34}, textContainer = <NSTextContainer: 0x7fac1dcb9c10 size = (290.000000,34.000000); widthTracksTextView = YES; heightTracksTextView = YES>; exclusionPaths = 0x0; lineBreakMode = 0>
   |    |    |    |    |    | <UIImageView: 0x7fac1dcb8ab0; frame = (52 31.5; 240.5 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dcb8c50>>
   |    |    |    |    |    | <UIImageView: 0x7fac1dcc0b00; frame = (287.5 5; 2.5 28); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dcc2d80>>
   |    |    |    | <_UITableViewCellSeparatorView: 0x7fac1dcc1f80; frame = (15 66; 305 1); layer = <CALayer: 0x7fac1dcc2070>>
   |    |    | <CSConversationMessageTableViewCell: 0x7fac1dc67020; baseClass = UITableViewCell; frame = (0 118; 375 59); autoresize = W; layer = <CALayer: 0x7fac1dc67330>>
   |    |    |    | <UITableViewCellContentView: 0x7fac1dc23f00; frame = (0 0; 375 59); opaque = NO; gestureRecognizers = <NSArray: 0x7fac1dcb4d10>; layer = <CALayer: 0x7fac1dc67350>>
   |    |    |    |    | <UIImageView: 0x7fac1dc23fd0; frame = (15 15; 40 40); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc67370>>
   |    |    |    |    | <UITextView: 0x7fac1b88c400; frame = (70 15; 290 34); text = 'sdfsdf
Jul 28 • 11:19 AM'; clipsToBounds = YES; autoresize = W+RM+BM; gestureRecognizers = <NSArray: 0x7fac1dc752f0>; layer = <CALayer: 0x7fac1dc24160>; contentOffset: {0, 0}; contentSize: {290, 34}>
   |    |    |    |    |    | <<_UITextContainerView: 0x7fac1dc907e0; frame = (0 0; 290 34); layer = <_UITextTiledLayer: 0x7fac1dc75ff0>> minSize = {290, 34}, maxSize = {290, 34}, textContainer = <NSTextContainer: 0x7fac1dc757d0 size = (290.000000,34.000000); widthTracksTextView = YES; heightTracksTextView = YES>; exclusionPaths = 0x0; lineBreakMode = 0>
   |    |    |    |    |    | <UIImageView: 0x7fac1dc8dd30; frame = (52 31.5; 240.5 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc7e0f0>>
   |    |    |    |    |    | <UIImageView: 0x7fac1dcb3bf0; frame = (287.5 5; 2.5 28); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dcb3bb0>>
   |    |    |    | <_UITableViewCellSeparatorView: 0x7fac1dcb4740; frame = (15 66; 305 1); layer = <CALayer: 0x7fac1dcb4830>>
   |    |    | <CSConversationMessageTableViewCell: 0x7fac1dc26e80; baseClass = UITableViewCell; frame = (0 59; 375 59); autoresize = W; layer = <CALayer: 0x7fac1dc36b80>>
   |    |    |    | <UITableViewCellContentView: 0x7fac1dc8bdc0; frame = (0 0; 375 59); opaque = NO; gestureRecognizers = <NSArray: 0x7fac1dc8c8d0>; layer = <CALayer: 0x7fac1dc36ba0>>
   |    |    |    |    | <UIImageView: 0x7fac1dc29f90; frame = (15 15; 40 40); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc36bc0>>
   |    |    |    |    | <UITextView: 0x7fac1b8a7800; frame = (70 15; 290 34); text = 'sdfsdfsdf
Jul 28 • 11:19 ...'; clipsToBounds = YES; autoresize = W+RM+BM; gestureRecognizers = <NSArray: 0x7fac1dc28c90>; layer = <CALayer: 0x7fac1dc8bef0>; contentOffset: {0, 0}; contentSize: {290, 34}>
   |    |    |    |    |    | <<_UITextContainerView: 0x7fac1dc364f0; frame = (0 0; 290 34); layer = <_UITextTiledLayer: 0x7fac1dc1cd50>> minSize = {290, 34}, maxSize = {290, 34}, textContainer = <NSTextContainer: 0x7fac1dc2e2d0 size = (290.000000,34.000000); widthTracksTextView = YES; heightTracksTextView = YES>; exclusionPaths = 0x0; lineBreakMode = 0>
   |    |    |    |    |    | <UIImageView: 0x7fac1dcaa460; frame = (52 31.5; 240.5 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc12f50>>
   |    |    |    |    |    | <UIImageView: 0x7fac1dc77d00; frame = (287.5 5; 2.5 28); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc77cc0>>
   |    |    |    | <_UITableViewCellSeparatorView: 0x7fac1dc7c4e0; frame = (15 66; 305 1); layer = <CALayer: 0x7fac1dc7ba30>>
   |    |    | <CSConversationMessageTableViewCell: 0x7fac1dc1c890; baseClass = UITableViewCell; frame = (0 0; 375 59); autoresize = W; layer = <CALayer: 0x7fac1dc563b0>>
   |    |    |    | <UITableViewCellContentView: 0x7fac1dc6fc60; frame = (0 0; 375 59); opaque = NO; gestureRecognizers = <NSArray: 0x7fac1dcb11b0>; layer = <CALayer: 0x7fac1dc5a3e0>>
   |    |    |    |    | <UIImageView: 0x7fac1dc8c970; frame = (15 15; 40 40); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc61380>>
   |    |    |    |    | <UITextView: 0x7fac1b88b600; frame = (70 15; 290 34); text = 'test
Jul 28 • 11:19 AM'; clipsToBounds = YES; autoresize = W+RM+BM; gestureRecognizers = <NSArray: 0x7fac1dc10470>; layer = <CALayer: 0x7fac1dc211a0>; contentOffset: {0, 0}; contentSize: {290, 34}>
   |    |    |    |    |    | <<_UITextContainerView: 0x7fac1dc6ee40; frame = (0 0; 290 34); layer = <_UITextTiledLayer: 0x7fac1dcae830>> minSize = {290, 34}, maxSize = {290, 34}, textContainer = <NSTextContainer: 0x7fac1dc1a9a0 size = (290.000000,34.000000); widthTracksTextView = YES; heightTracksTextView = YES>; exclusionPaths = 0x0; lineBreakMode = 0>
   |    |    |    |    |    | <UIImageView: 0x7fac1dc62f80; frame = (52 31.5; 240.5 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dcacc90>>
   |    |    |    |    |    | <UIImageView: 0x7fac1dc5d3c0; frame = (287.5 5; 2.5 28); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1dc24e00>>
   |    |    |    | <_UITableViewCellSeparatorView: 0x7fac1dc5e680; frame = (15 66; 305 1); layer = <CALayer: 0x7fac1dc9bcb0>>
   |    | <UIImageView: 0x7fac1f815c90; frame = (0 298.5; 375 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f815c70>>
   |    | <UIImageView: 0x7fac1f8164a0; frame = (372.5 616; 2.5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f816480>>
   | <UITableView: 0x7fac1d0b3200; frame = (0 365; 375 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7fac1d8c5990>; layer = <CALayer: 0x7fac1d8b6c90>; contentOffset: {0, 0}; contentSize: {375, 0}>
   |    | <UITableViewWrapperView: 0x7fac1d8c5ff0; frame = (0 0; 375 0); gestureRecognizers = <NSArray: 0x7fac1d8c63e0>; layer = <CALayer: 0x7fac1d8b62a0>; contentOffset: {0, 0}; contentSize: {375, 0}>
   |    | <UIView: 0x7fac1d8c6950; frame = (0 0; 750 0.5); autoresize = W; layer = <CALayer: 0x7fac1d8c6a20>>
   |    | <UIImageView: 0x7fac1f8171b0; frame = (0 -2.5; 375 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f817190>>
   |    | <UIImageView: 0x7fac1f8179c0; frame = (372.5 -36; 2.5 36); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f8179a0>>
   | <SLKTypingIndicatorView: 0x7fac1d8c6b20; frame = (0 365; 375 0); hidden = YES; layer = <CALayer: 0x7fac1d8c6c60>>
   |    | <UILabel: 0x7fac1d8c6d60; frame = (40 0; 325 0); userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8c6ec0>>
   |    |    | <_UILabelContentLayer: 0x7fac1f802c70> (layer)
   | <SLKTextInputbar: 0x7fac1d8c7dc0; baseClass = UIToolbar; frame = (0 365; 375 44); clipsToBounds = YES; layer = <CALayer: 0x7fac1d8c8000>>
   |    | <_UIToolbarBackground: 0x7fac1d8f8980; frame = (0 0; 375 44); userInteractionEnabled = NO; layer = <CALayer: 0x7fac1d8f8a90>>
   |    |    | <_UIBackdropView: 0x7fac1acb3290; frame = (0 0; 375 44); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <_UIBackdropViewLayer: 0x7fac1acb3500>>
   |    |    |    | <_UIBackdropEffectView: 0x7fac1df1f820; frame = (0 0; 375 44); clipsToBounds = YES; opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CABackdropLayer: 0x7fac1df10df0>>
   |    |    |    | <UIView: 0x7fac1df04020; frame = (0 0; 375 44); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1df16740>>
   |    |    |    | <UIView: 0x7fac1df040f0; frame = (0 0; 375 44); alpha = 0.85; opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1acbbd20>>
   |    | <UIView: 0x7fac1d8d05e0; frame = (0 0; 375 0); clipsToBounds = YES; hidden = YES; layer = <CALayer: 0x7fac1d8d06b0>>
   |    |    | <UILabel: 0x7fac1d8d06d0; frame = (76 0; 223 0); text = 'Editing Message'; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8d0830>>
   |    |    | <UIButton: 0x7fac1d8d1100; frame = (8 0; 60 0); opaque = NO; layer = <CALayer: 0x7fac1d8d12e0>>
   |    |    |    | <UIButtonLabel: 0x7fac1d8d1380; frame = (0 -9; 48 18); text = 'Cancel'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8d14f0>>
   |    |    | <UIButton: 0x7fac1d8d2cc0; frame = (307 0; 60 0); opaque = NO; layer = <CALayer: 0x7fac1d8d2ea0>>
   |    |    |    | <UIButtonLabel: 0x7fac1d8d2f40; frame = (25 -9; 35 18); text = 'Save'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8d30b0>>
   |    | <UIButton: 0x7fac1d8d5470; frame = (8 2; 30 40); opaque = NO; layer = <CALayer: 0x7fac1d8d4d00>>
   |    |    | <UIImageView: 0x7fac1d8dbac0; frame = (0 0; 30 40); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1d8dba50>>
   |    |    | <UIButtonLabel: 0x7fac1d8d5650; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8d5170>>
   |    |    |    | <_UILabelContentLayer: 0x7fac1d8e03f0> (layer)
   |    | <UIButton: 0x7fac1d8c8020; frame = (375 7; 0 30); opaque = NO; layer = <CALayer: 0x7fac1d8c8200>>
   |    |    | <UIButtonLabel: 0x7fac1d8c8260; frame = (0 6; 0 18); text = 'Send'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8c83d0>>
   |    | <SLKTextView: 0x7fac1d0b3a00; baseClass = UITextView; frame = (46 5; 321 34); text = ''; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7fac1d8ca640>; layer = <CALayer: 0x7fac1d8c8490>; contentOffset: {0, 0}; contentSize: {321, 34}>
   |    |    | <UILabel: 0x7fac1d8cdb30; frame = (9 8; 118 18); text = 'Write a message...'; autoresizesSubviews = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8cda70>>
   |    |    | <<_UITextContainerView: 0x7fac1d8cb340; frame = (0 0; 321 34); layer = <_UITextTiledLayer: 0x7fac1d8cb470>> minSize = {321, 0}, maxSize = {3.4028234663852886e+38, 3.4028234663852886e+38}, textContainer = <NSTextContainer: 0x7fac1d8cab20 size = (317.000000,inf); widthTracksTextView = YES; heightTracksTextView = NO>; exclusionPaths = 0x0; lineBreakMode = 0>
   |    |    |    | <_UITileLayer: 0x7fac1acec4e0> (layer)
   |    |    |    | <_UITileLayer: 0x7fac1d8f93f0> (layer)
   |    |    |    | <_UITileLayer: 0x7fac1d8f93d0> (layer)
   |    |    |    | <UITextSelectionView: 0x7fac1d8ccdf0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x7fac1d8ccf10>>
   |    |    |    |    | <UIView: 0x7fac1acea050; frame = (8 7; 2 19.5); userInteractionEnabled = NO; animations = { opacity=<CABasicAnimation: 0x7fac1dd511e0>; }; layer = <CALayer: 0x7fac1ace9ff0>>
   |    |    | <UIImageView: 0x7fac1f820340; frame = (0 31.5; 359 2.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f820320>>
   |    |    | <UIImageView: 0x7fac1f820b50; frame = (318.5 -2; 2.5 36); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1f820b30>>
   |    | <UILabel: 0x7fac1d8d6eb0; frame = (367 5; 0 0); userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fac1d8d7010>>
   |    |    | <_UILabelContentLayer: 0x7fac1d8f8e60> (layer)
   |    | <UIImageView: 0x7fac1d8f8b60; frame = (0 -0.5; 375 0.5); autoresize = W+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7fac1d8f8c60>>
   |    | <CALayer: 0x7fac1ac9a9c0> (layer)
   | <UIView: 0x7fac1dd79f60; frame = (0 64; 375 0); clipsToBounds = YES; layer = <CALayer: 0x7fac1de092e0>>

@aryaxt
Copy link
Contributor

aryaxt commented Aug 16, 2015

Maybe the SLKInputAccessoryView is covering the input bar?

aryaxt and others added 4 commits August 21, 2015 18:39
- Dismiss the keyboard and the auto-completion view right after hiding the textInputBar
- Fixes cases where hiding the textInputBar wouldn't be possible when the keyboard was up
- Avoids hidding the textInputBar with alpha, instead fixed some auto-layout constraints so the textView would follow the dismissal animation
@dzenbot
Copy link
Author

dzenbot commented Aug 21, 2015

So far, this branch behaves great. I haven't found any apparent bugs. The one about auto-rotation seems fixed now.

@aryaxt Since the issue you're experiencing isn't related to this branch, let's open it in a new issue. I haven't been able to repro so far tho.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this block-based approach to handle the case with and without animations. Much cleaner than calling a separate method or duplicating the code.

fyaqub added a commit that referenced this pull request Aug 25, 2015
Adds the ability to show/hide input bar. Closes #203. Closes #229
@fyaqub fyaqub merged commit 5a44225 into master Aug 25, 2015
@fyaqub
Copy link
Contributor

fyaqub commented Aug 25, 2015

Awesome work guys!

@laeroah laeroah mentioned this pull request Sep 18, 2017
6 tasks
@josepbordesjove josepbordesjove mentioned this pull request Oct 16, 2017
6 tasks
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.

4 participants