Skip to content

Commit ed3c8ac

Browse files
committed
So block the iOS 13 hack on iOS <13 by returning early, everything good?
Not quite - try tapping into the search bar and then canceling the search on iOS 12. Why does this happen?
1 parent bd686be commit ed3c8ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

SearchController/ViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class ViewController: UITableViewController {
2828
// the system animation of the search bar to complete properly.
2929
private var lastContentOffset: CGFloat = 0
3030
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
31+
guard #available(iOS 13, *) else { return }
3132
let searchBar = searchController.searchBar
3233

3334
if lastContentOffset > scrollView.contentOffset.y {

0 commit comments

Comments
 (0)