Explanation:
I am working on an application and had trouble diagnosing the warnings below. I pulled the search bar code out into a separate project, and the warnings still show up. The entire code for the sample project is shown below. The "AddInstanceForFactory", "LoudnessManager", and "NSBundle" warning all show up immediately after tapping the search bar. The "RTIInputSystemClient" warning arises after tapping, dismissing, and re-tapping the search bar.
Any help with resolving these warnings is appreciated!
Warnings:
"-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = , customInfoType = UIEmojiSearchOperations"
"NSBundle file:///Library/Developer/CoreSimulator/Volumes/iOS_22A3351/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2018.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed"
"AddInstanceForFactory: No factory registered for id <CFUUID --------------> -----------------"
"LoudnessManager.mm:709 unable to open stream for LoudnessManager plist"
Code:
import UIKit
class SearchView: UIView {
private lazy var searchBar: UISearchBar = {
let searchBar = UISearchBar()
searchBar.delegate = self
searchBar.translatesAutoresizingMaskIntoConstraints = false
searchBar.placeholder = "Search"
return searchBar
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init() {
super.init(frame: .zero)
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .yellow
addSubview(searchBar)
NSLayoutConstraint.activate([
searchBar.topAnchor.constraint(equalTo: topAnchor, constant: 12),
searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 12),
searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -12),
searchBar.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -12),
])
}
}
extension SearchView: UISearchBarDelegate {
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
print(searchText)
}
}
class ViewController: UIViewController {
private lazy var searchView = SearchView()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
view.addGestureRecognizer(tap)
view.addSubview(searchView)
NSLayoutConstraint.activate([
searchView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
searchView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 24),
searchView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
])
}
@objc func dismissKeyboard() {
view.endEditing(true)
}
}