I have UISearchBar, when I run from xCode placeholder and icon is working well but when i run from simulator or testflight placeholder and icon is dissappear. How can I solve it?
Here my code:
view:
private lazy var searchBar: UISearchBar = {
let view = UISearchBar()
view.delegate = self
view.barTintColor = UIColor.clear
view.backgroundColor = UIColor.clear
view.isTranslucent = true
view.setBackgroundImage(UIImage(), for: .any, barMetrics: .default)
view.placeholder = "Search"
return view
}()
setup method:
view.addSubview(searchBar)
view.addSubview(collectionView)
searchBar.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide).inset(17)
make.leading.trailing.equalToSuperview().inset(6)
make.height.equalTo(40)
}