Lnpopupcontroller: Bottom layout guide correction doesn't work with UITableViewController

Created on 29 Apr 2016  路  2Comments  路  Source: LeoNatan/LNPopupController

Bottom layout guide correction doesn't work with UITableViewController. If I create storyboard UIViewController with UITableView and it's bottom constraint at bottom layout guide all works fine. However if I create storyboard UITableViewController correction doesn't work after popup bar appears.

Here the screenshots with storyboard and application behavior.
-NMCFriendsVC with list of friends (50 items from 0 to 49) is subclass of UITableViewController.
-NMCSongsVC with list of songs (50 items from 0 to 49) is subclass of UIViewController with custom added UITableView IBOutlet connected to bottom layout guide.

  • All tables are scrolled to the end of list but -NMCFriendsVC display row 50 (friend 49) under popup bar

img_0061
img_0062

2016-04-29 10 39 14
2016-04-29 10 39 36

not a bug question

Most helpful comment

This sounds like the intended behavior. After the controller is presented, the popup presentation will not modify the insets. This is how Apple does it. When you present a popup bar, make sure to update your table view's content and scroll indicator insets. I do the same in my music app in the demo project:

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    let insets = UIEdgeInsetsMake(topLayoutGuide.length, 0, bottomLayoutGuide.length, 0)
    tableView.contentInset = insets
    tableView.scrollIndicatorInsets = insets
}

bottomLayoutGuide is maintained correctly when the popup bar is presented.

All 2 comments

It's not a big problem, I will just replace UITableVCs with UIVCs in my storyboard, but You should know the issue.
You've made really great component, thanks :)

This sounds like the intended behavior. After the controller is presented, the popup presentation will not modify the insets. This is how Apple does it. When you present a popup bar, make sure to update your table view's content and scroll indicator insets. I do the same in my music app in the demo project:

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    let insets = UIEdgeInsetsMake(topLayoutGuide.length, 0, bottomLayoutGuide.length, 0)
    tableView.contentInset = insets
    tableView.scrollIndicatorInsets = insets
}

bottomLayoutGuide is maintained correctly when the popup bar is presented.

Was this page helpful?
0 / 5 - 0 ratings