Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

SSPullToRefresh does not work correctly on ios11 if it's compiled with xCode9 #65

Open
avshiyanov opened this issue Aug 19, 2017 · 11 comments

Comments

@avshiyanov
Copy link

No description provided.

@enzosterro
Copy link

@avshiyanov, could you provide more details, please?

@avshiyanov
Copy link
Author

@enzosterro I think this problems appears only after making a new build project in new xCode 9, this problem is related to content inset of UITableView and pull to refresh looks wired - for some cases it's under navigation bar and don't disappears after making "pull to refresh"

@enzosterro
Copy link

@avshiyanov, it's interesting. I've got no problems that you've described.

@avshiyanov
Copy link
Author

layout

@enzosterro It happen after building project on xCode9

@avshiyanov
Copy link
Author

@enzosterro I think problem inside of SSPullToRefresh, I tried another pulls to refresh and it works but with not similar UI . I think you need test this control under XCode 9 with different simulators and you will see that it's broken, please look on screenshot

@avshiyanov avshiyanov changed the title SSPullToRefresh does not work correctly on ios11 SSPullToRefresh does not work correctly on ios11 if it's compiled with xCode9 Oct 4, 2017
@ScottRobbins
Copy link

ScottRobbins commented Oct 10, 2017

I also have the same issue. Haven't had time to dig into the code to see why. Perhaps changes to the behavior of content insets of tableviews.

And to be clear, it's not just an issue on the iPhone X, but also the iPhone 8 simulators.

@avshiyanov
Copy link
Author

avshiyanov commented Oct 11, 2017

@ScottRobbins Yes it's contentInset issue, I was able to fix on client, but think best place to fix it in the library @enzosterro . Not sure if best solution is hardcode top inset for iPhoneX, but it works for me for all iOS and deviceTypes
add adjustPullToRefreshDefaultInset in the end of layoutSubviews:

  • (void)adjustPullToRefreshDefaultInset
    {
    UIEdgeInsets inset = self.scrollView.contentInset;
    if (@available(iOS 11.0, *)) {
    inset.top = 0;

     inset = self.scrollView.safeAreaInsets;
    

    } else {
    inset = self.scrollView.contentInset;
    }

    self.defaultContentInset = inset;
    }

Also In initWithScrollView method:
if (@available(iOS 11.0, *)) {
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}

@enzosterro
Copy link

@avshiyanov, sorry, but it's not mine library. And yes, after I've built project in xCode 9, I've stuck with same problems.

@avshiyanov
Copy link
Author

avshiyanov commented Oct 11, 2017

@enzosterro I see, I did't say that its your

@pjechris
Copy link

I do have kind of the same issue, but on Xcode8/iOS 10.
After a pull to refresh top of my tableview is hidden. Seems like contentInset is miscalculated.
My hierarchy: NavigationController -> Tabbarcontroller -> UIViewController -> UIView -> UITableView

@avshiyanov
Copy link
Author

@pjechris Hi, I fixed it at https://github.com/avshiyanov/SSPullToRefresh

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

No branches or pull requests

4 participants