Posts

Post not yet marked as solved
3 Replies
2.7k Views
In my Swift 5 app, I have a view controller embedded in a navigation controller. The navigation bar has a search bar. The view controller has a table view. Selecting the table view cells, pushes a new view controller which also has a search bar in its navigation bar.If I try to swipe back on the second view controller to pop it, the search bar abruptly vanishes instead of animating and hiding.https://gifyu.com/image/EYqHAlso, notice that when swipe back is cancelled (swipe left and then right) the search bar finally reappears with a line on top of it.I tried to debug the view hierarchy to find that the unwanted line is _UIBarBackground’s UIImageView of height 0.5. I have no idea why this appeared.This is how I’m using the search controller in the second VC:Inside the VC’s viewDidLoad:Everything is working fine for the search bar of the first VC. The code for seach bar inside the viewDidLoad of first VC is also same as above. This is how the search bar animated and hides when swiped back on the first VC:https://gifyu.com/image/EYqcI do not understand where I’m going wrong. Any suggestions/help would be appreciated. Thanks in advance.
Posted Last updated
.