I added a search bar to my navigation.titleView file
self.navigationItem.titleView = searchBar
There is also a BackBarButtonItem element with the name = ""
self.navigationItem.backBarButtonItem?.title = ""
But then there is a space between the Back Button and SearchBar , for example: 
I think a space appears here because there is room for a title of backBarButtonItem (because my title is null ", but the space is still there)
So, I want to ask how to skip this gap? I want to make my SearchBar closer to my backBarIcon
Thank you very much!
EDIT 1: I'm trying to change the search frame, but it doesn't work
This is my code.
//Change searchBar frame let titleViewFrame = (searchController.searchBar.frame) searchController.searchBar.frame = CGRect(x: titleViewFrame.minX - 20.0, y: titleViewFrame.minY, width: titleViewFrame.width + 20.0, height: titleViewFrame.height)
source share