-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from cocoatype/128-search-button-auto-dismiss…
…es-on-ipad Fix dismissal of seek and destroy on iPad
- Loading branch information
Showing
4 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...les/Legacy/Editing/Sources/Editing View/Seek and Destroy/Tablet/TabletSeekSearchBar.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Created by Geoff Pado on 6/24/24. | ||
// Copyright © 2024 Cocoatype, LLC. All rights reserved. | ||
|
||
import UIKit | ||
|
||
class TabletSeekSearchBar: UISearchBar, UISearchTextFieldDelegate { | ||
init() { | ||
super.init(frame: .zero) | ||
searchTextField.delegate = self | ||
returnKeyType = .done | ||
translatesAutoresizingMaskIntoConstraints = false | ||
|
||
searchTextField.addTarget(nil, action: #selector(PhotoEditingViewController.seekBarDidChangeText(_:)), for: .editingChanged) | ||
} | ||
|
||
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | ||
chain(selector: #selector(PhotoEditingViewController.finishSeeking(_:))) | ||
return false | ||
} | ||
|
||
// MARK: Boilerplate | ||
|
||
@available(*, unavailable) | ||
required init(coder: NSCoder) { | ||
let typeName = NSStringFromClass(type(of: self)) | ||
fatalError("\(typeName) does not implement init(coder:)") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters