AutocompleteViewController: adjust insets on keyboard appearance
This commit is contained in:
@@ -32,8 +32,6 @@ class AutocompleteViewController: UIViewController, UICollectionViewDelegate
|
||||
override var canBecomeFirstResponder: Bool { true }
|
||||
|
||||
public let collectionView: UICollectionView
|
||||
|
||||
private let autocompleteView: AutocompleteView
|
||||
private let dataSource: UICollectionViewDiffableDataSource<Section, HistoryItem>
|
||||
|
||||
init() {
|
||||
@@ -53,8 +51,6 @@ class AutocompleteViewController: UIViewController, UICollectionViewDelegate
|
||||
collectionView.dequeueConfiguredReusableCell(using: cellRegistry, for: indexPath, item: item)
|
||||
})
|
||||
|
||||
autocompleteView = AutocompleteView(collectionView: collectionView)
|
||||
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
|
||||
collectionView.delegate = self
|
||||
@@ -64,7 +60,7 @@ class AutocompleteViewController: UIViewController, UICollectionViewDelegate
|
||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
||||
|
||||
override func loadView() {
|
||||
self.view = autocompleteView
|
||||
self.view = collectionView
|
||||
}
|
||||
|
||||
override var keyCommands: [UIKeyCommand]? {
|
||||
@@ -123,24 +119,4 @@ class AutocompleteViewController: UIViewController, UICollectionViewDelegate
|
||||
delegate?.autocompleteController(self, didSelectHistoryItem: item)
|
||||
}
|
||||
}
|
||||
|
||||
private class AutocompleteView: UIView {
|
||||
let collectionView: UICollectionView
|
||||
|
||||
init(collectionView: UICollectionView) {
|
||||
self.collectionView = collectionView
|
||||
super.init(frame: .zero)
|
||||
|
||||
addSubview(collectionView)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
collectionView.frame = bounds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user