Ad

Our DNA is written in Swift
Jump

Radar: Search Bar jumps around and disappears

iOS 8 might be around the corner and things like this are probably fixed. Still, that does not mean you shouldn’t file your grievences. On this Radar Apple is getting two bug reports for the price of one.

Filed as rdar://16938543 and on Open Radar.

Summary

When implementing a search display controller + search bar via Storyboard the search bar jumps around if there is no navigation bar. It also disappears if the developer does not change the ordering.

Steps to Reproduce

  1. Create a single view app from template
  2. Replace the view controller with a UITableViewController
  3. In IB, drag a “Search Bar and Search Display Controller” onto the table view
  4. Run the app

Expected Results

  • The search bar should be below the status bar area
  • On hitting the Cancel button next to the search text field it should remain visible

Actual Results

  • The search bar underlaps the status bar area
  • Starting to type a search query makes it jump down to be below the status bar area
  • Hitting Cancel makes it disappear

Notes

The positioning problem only shows if there is no navigation bar. The disappearing problem can be worked around by changing the order of the Search Bar and prototype cell so that the search bar is above it in the list of Table View subviews.

As a developer I expect to be able to use a search display controller and table view without having to have a navigation bar. A developer would also not suspect that the order of items in IB would matter since prototype cells are not actually subviews of the table view. iOS should be smart enough to position the search bar correctly and prevent it from disappearing at all cost.

Search Bar Bugs


Categories: Bug Reports

Leave a Comment