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)
}
Post
Replies
Boosts
Views
Activity
My action buttons stopped working after Xcode update (Xcode 12). When I clicked the buttons, I saw that the functions did not working (like there is no button in there). I could not understand why. How can I fix these functions?
Here my action button function:
	 @objc func addAction(sender: UIButton) {
			 let indexPath = IndexPath(row: sender.tag, section: 0)
			 let cell = tableView.cellForRow(at: indexPath) as! customCell
			 cell.count += 1
			 cell.countBasketLabel.text = "x\(cell.count)"
			
			 let detailGelen = detailsModel[indexPath.row]
			 selectedItemName.append(detailGelen.itemDetailName!)
			 selectedItemPrice.append(detailGelen.itemDetailPrice!)
			 UserDefaults.standard.set(selectedItemName, forKey: "urunadi")
			 UserDefaults.standard.set(selectedItemPrice, forKey: "urunfiyat")
			 tableView.reloadData()
	 }
Here my button code:	 let addButton: UIButton = {
let button = UIButton(type: .system)
button.setImage(UIImage(named: "add"), for: .normal)
button.tintColor = .black
button.layer.cornerRadius = 5
button.addTarget(self, action: #selector(testdetail.addAction(sender:)), for: .touchUpInside)
return button
}()
I have tableview cell with textfield in it. User can enter a values and add new row of the table. In this point, when tableview become long and some textfields disappeared from screen, this textfield's values deleted. I already tried prepareforreuse but it wasn't work. Textfield delegate methods working but I can't get deleted values again. How can I get these values?extension taslakOlusturmaController: UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return taskArrForRead.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "taslakCell", for: indexPath) as! taslakDuzenlemeCell
cell.taslakTextField.text = taskArrForRead[indexPath.item]
cell.taslakTextField.delegate = self
return cell
}
func textFieldDidEndEditing(_ textField: UITextField) {
print(textField.text!)
self.arrayOfNames.append(textField.text!)
}
func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
let cell = tableView.dequeueReusableCell(withIdentifier: "taslakCell", for: indexPath) as! taslakDuzenlemeCell
cell.taslakTextField.text = taskArrForRead[indexPath.item]
print(arrayOfNames[indexPath.item])
}
}Here my tableview delegate functions. This taskArrForRead array hold my datas. Last two methods writing for get all elements in textfields for writing to database. Please help me. I have to solve.
Hi,I have problem about Legal - Intellectual Property. I made lyrics app for IOS. I use Genius API which is totally free to use. I use that api and reach some datas about songs and singers after that I make simple request to genius.com to get songs lyrics for showing in my app. (that song lyrics link also get from genuis api). Everybody can reach that lyrics from website, I just want to make it more easy and simple but in return I get this:Your app includes third-party lyrics and/or sheet music without the necessary authorization. The use of third-party copyrighted materials requires documented evidence of your right to use such content in your app.So, how can I solve this issue? If I add some source from genius.com in my application, can solve it? (I can give a link or navigate to link etc.)Regards.