How to reduce a gap betweeen UISearchController and UITableViewHeader?

I have a UILabel as a UITableView header. Plus I have a UISearchController above it.

I can't figure out how to reduce the space between:

  • UITableView header and a UISearchController
  • UITableView header and a first cell in the section.

Here is how it looks like in Simulator: https://cln.sh/22Rqcz

Here is my Storyboard hierarchy: https://cln.sh/7s2IcB

Answered by artexhibit in 705447022

Hei, MobileTen. Thank you for the kind reply.

I found a way to reduce a space between UITableView header and a UISearchController as:

tableView.contentInset = UIEdgeInsets(top: -10, left: 0, bottom: 0, right: 0)

You can't.

Accepted Answer

Hei, MobileTen. Thank you for the kind reply.

I found a way to reduce a space between UITableView header and a UISearchController as:

tableView.contentInset = UIEdgeInsets(top: -10, left: 0, bottom: 0, right: 0)

How to reduce a gap betweeen UISearchController and UITableViewHeader?
 
 
Q