diff --git a/Classes/Notifications/NotificationsViewController.swift b/Classes/Notifications/NotificationsViewController.swift index 342fb942..2db8ed9d 100644 --- a/Classes/Notifications/NotificationsViewController.swift +++ b/Classes/Notifications/NotificationsViewController.swift @@ -226,8 +226,10 @@ TabNavRootViewControllerType { } if object === searchKey { - let searchBarHeight = 44 + 2*Styles.Sizes.rowSpacing - return SearchBarSectionController(placeholder: NSLocalizedString("Search notifications", comment: ""), delegate: self, height: searchBarHeight) + return SearchBarSectionController( + placeholder: Strings.search, + delegate: self + ) } switch object { diff --git a/Classes/Section Controllers/SearchBar/SearchBarCell.swift b/Classes/Section Controllers/SearchBar/SearchBarCell.swift index 1c5c864c..c6c13462 100644 --- a/Classes/Section Controllers/SearchBar/SearchBarCell.swift +++ b/Classes/Section Controllers/SearchBar/SearchBarCell.swift @@ -29,6 +29,7 @@ final class SearchBarCell: UICollectionViewCell, UISearchBarDelegate { contentView.backgroundColor = .white + searchBar.searchBarStyle = .minimal searchBar.delegate = self searchBar.tintColor = Styles.Colors.Blue.medium.color contentView.addSubview(searchBar) diff --git a/Classes/Section Controllers/SearchBar/SearchBarSectionController.swift b/Classes/Section Controllers/SearchBar/SearchBarSectionController.swift index fb2b8db1..813d372e 100644 --- a/Classes/Section Controllers/SearchBar/SearchBarSectionController.swift +++ b/Classes/Section Controllers/SearchBar/SearchBarSectionController.swift @@ -16,21 +16,18 @@ protocol SearchBarSectionControllerDelegate: class { final class SearchBarSectionController: ListSectionController, SearchBarCellDelegate { private weak var delegate: SearchBarSectionControllerDelegate? = nil - private let height: CGFloat private let placeholder: String - init(placeholder: String, delegate: SearchBarSectionControllerDelegate?, height: CGFloat) { + init(placeholder: String, delegate: SearchBarSectionControllerDelegate) { self.delegate = delegate - self.height = height self.placeholder = placeholder super.init() } override func sizeForItem(at index: Int) -> CGSize { guard let context = collectionContext else { fatalError("Collection context must be set") } - // 28 is the default height of UISegmentedControl - let height = 28 + 2*Styles.Sizes.rowSpacing - return CGSize(width: context.containerSize.width, height: height) + // hardcoded size of UISearchBar on iOS 11 + return CGSize(width: context.containerSize.width, height: 56) } override func cellForItem(at index: Int) -> UICollectionViewCell { diff --git a/Classes/Views/Strings.swift b/Classes/Views/Strings.swift index f0c2bbba..28e77ffa 100644 --- a/Classes/Views/Strings.swift +++ b/Classes/Views/Strings.swift @@ -27,5 +27,6 @@ enum Strings { static let newIssue = NSLocalizedString("New Issue", comment: "") static let bullet = "\u{2022}" static let bulletHollow = "\u{25E6}" + static let search = NSLocalizedString("Search", comment: "") } diff --git a/Resources/Info.plist b/Resources/Info.plist index 4dd2d73b..7776ced0 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 2012 + 2016 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes