Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe Area vs Top Layout Guide #5

Open
onedv opened this issue Jan 26, 2018 · 1 comment
Open

Safe Area vs Top Layout Guide #5

onedv opened this issue Jan 26, 2018 · 1 comment

Comments

@onedv
Copy link

onedv commented Jan 26, 2018

Hi! Thanks a lot for this cool library :)

I use Swift 4 with latest Xcode 9 and want to embed a table in the view of my main view controller, which I embedded in a navigation controller via the storyboard in interface builder, looks quite similar to the cupcake demo. Now on newer projects, I do not have the top and bottom layout guides, as they are deprecated, only the safe area. When I add a GroupTable to my main view now, the navigation item / bar on top overlays the group table I created. I have to add it with e.g. addTo(self.view, 60, 0, 0, 0) in setupUI so that the table is rendered below the navigation bar. If I run the same code on iOS 9.3 devices (with 60
top), this adds a not so nice margin between the header and the table, meaning I have to use different parameters for addTo for iOS 9.3 and iOS 11
to get the same result. Do you know if this needs a fix in the library or is the problem somewhere else / can be fixed otherwise?

Thanks a lot for your support!
Cheers

@nerdycat
Copy link
Owner

nerdycat commented Feb 2, 2018

Sorry for taking so long to reply.
Unfortunately, Cupcake have not any knowledge of layout guides and safe area. Since it is written before iOS 11 and layout guides are view controller things.

I don't know why automatic adjusts insets act different betweens iOS 9 and iOS 11. In my test, you have to manually setting tableView.contentInsetAdjustmentBehavior to .automatic in order to fix overlay problem.

Nevertheless, Cupcake do support layout margin which work well as safe area:
GroupTable(...).embedIn(self.view, "0", 0, 0, 0)

Thanks for the long post ^^

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

No branches or pull requests

2 participants