slackhq / SlackTextViewController

⛔️**DEPRECATED** ⛔️ A drop-in UIViewController subclass with a growing text input view and other useful messaging features
https://slack.com/
MIT License
8.32k stars 1.08k forks source link

iOS 11 offset in tableView #630

Closed josepbordesjove closed 7 years ago

josepbordesjove commented 7 years ago

Description

With the brand new iOS 11, there appears an offset on the table view of the SlackTextViewController.

Reproducible in:

Steps to reproduce:

  1. Download the sample project.
  2. Run it with the iOS 11 simulator and iOS 10.3 simulator (using Xcode 9)

Expected result:

The table should appear without any content offset (iPhone 7 Plus, iOS 10.3.1)

iPhone 7 Plus iOS 10.3.1

Actual result:

The table has offset (iPhone 7 Plus, iOS 11)

iPhone 7 Plus iOS 11

Thank you for your help!

Josep

hipwelljo commented 7 years ago

I imagine this is because of the change in iOS 11 where it no longer automatically adjusts the scroll view's content inset to accommodate top/bottom bars, by default.

josepbordesjove commented 7 years ago

Thank you, that solved my problem! For others trying to solve the same issue, I found the solution on the wwdc video, https://developer.apple.com/videos/play/wwdc2017/204/.

 if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = .never
}
dzenbot commented 7 years ago

It seems like a better fix is automaticallyAdjustsScrollViewInsets = false which is backwards compatible, being discussed in https://github.com/slackhq/SlackTextViewController/pull/531

@josepbordesjove mind try that up, and maybe push a PR fixing it for both, iOS 11 and iOS 10?

josepbordesjove commented 7 years ago

@dzenbot, thank you, I am gooing to do that and make a PR!

dilizarov commented 7 years ago

@josepbordesjove's solution above works. Using automaticallyAdjustsScrollViewInsets = false as @dzenbot suggests does not work for me.

yarodevuci commented 7 years ago

does not work for me either

josepbordesjove commented 7 years ago

@yarodevuci it should be solved because the PR is already merged, if not, maybe your problem is different, anyways try to upload your pods.

yarodevuci commented 7 years ago

@josepbordesjove in version: 1.9.6?

josepbordesjove commented 7 years ago

@yarodevuci yes!

yarodevuci commented 7 years ago

@josepbordesjove I am updated, but I still have the issue, any ideas what else to check?

josepbordesjove commented 7 years ago

@yarodevuci Can you upload a screenshot of the issue? But I'd copy the code into the viewDidLoad, if the new release does not solve your problems. Also I'd try to delete the Pods and Podfile.lock and install them again.