SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 742 forks source link

How to make the controller content ignore the safe area? #449

Closed MojtabaHs closed 3 years ago

MojtabaHs commented 3 years ago

I know we can ignore the safe area inset since v8.0.4. but the content still cares about the safe area:

Screen Shot 2020-12-27 at 11 58 23

Note that little inset below item 3? That is exactly the bottom safe area and it is visible only if the container passed the minimum inset (and not respecting the safe area)

So how can I ignore the safe area for the content too?

wtmoose commented 3 years ago

tableView.contentInsetAdjustmentBehavior = .never

MojtabaHs commented 3 years ago

No luck @wtmoose. I've tested that before, also for the navigation controller, also for a simple view controller, all with no luck It is not the tableView's behavior.

You can see the inset even if you add a simple ViewController.

Screen Shot 2020-12-27 at 20 39 57

302px ≠ 350px

wtmoose commented 3 years ago

Seems to work for me:

Fooo

I had to turn off "Under top bars" on the view controller since turning off automatic insets removes the top inset as well.

In the demo app, go to View Controller | Bottom Card

SwiftMessages-safearea.zip

wtmoose commented 3 years ago

Here's an example with a simple view controller. Just don't constrain content to the safe area guides. This seems trivial, so maybe I'm not understanding your use case?

foooooo

SwiftMessagesTest.zip

MojtabaHs commented 3 years ago

Strange! it is working on both examples you sent but not on the clone of the master.

Can you please share a commit so I can see what are you changing exactly that I'm missing?

wtmoose commented 3 years ago

There's no commit. You can copy the files into your project folder on top of the head of master and you'll see the diffs.