У меня есть в приложении меню, там пару кнопок, дак вот, как сделать так чтобы по нажатию, открывался сайт?
Я сильно новичок в разработке)))
Переход из приложения на сайт
Maksim
#1
Maksim
#3
я их прописал вот так:
import UIKit
class MenuViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var menuTableView: UITableView!
let Mytitle = [" Обновить", " Проверить соединение", " О программе", " Поддержка", " Выйти из учетной записи"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
menuTableView.delegate = self
menuTableView.dataSource = self
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Mytitle.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = menuTableView.dequeueReusableCell(withIdentifier: "MenuCell") as! MenuTableViewCell
cell.labelText.text = Mytitle[indexPath.row]
return cell
}
}
как мне их по отдельности вынуть и присвоить им действие?
RexHunt
#5
let MyTitle: Dictionary<String, String> = ["Title1": "Url1", "Title2": "Url2", ...]
func tableview(didselectitem) {
let dict = MyTitle[indexPath.row]
let urlString = dict.value
}
Maksim
#6
func tableview(didselectitem) {
тут ошибку показвает
1)Unnamed parameters must be written with the empty name ‘_’
2)Use of undeclared type ‘didselectitem’