Прошу помощи в реализации перехода на сайт.
Создал webView в первом ViewController
подключил - все работает - сайт работает.
Второй ViewController является слайдером -где есть определенные значения. Хотел реализовать следующее - при нажатии хотел ,чтобы сразу открывалась определенная страничка сайта. Например: нажимаю на “Главная” - переходит по ссылке http://www.site.com/home
Код: webView:
@IBOutlet weak var webView: UIWebView!
let odessaquest = URL(string: "http://www.oqrooms.com.ua")
let odessaquestURL = URLRequest(url: odessaquest!)
webView.loadRequest(odessaquestURL)
код слайдера:
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 9
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as UITableViewCell
if indexPath.row == 0 {
cell.textLabel?.text = "Главная"
} else if indexPath.row == 1 {
cell.textLabel?.text = "Личный кабинет"
} else if indexPath.row == 2 {
cell.textLabel?.text = "Акции"
} else if indexPath.row == 3 {
cell.textLabel?.text = "Об игре"
} else if indexPath.row == 4 {
cell.textLabel?.text = "Оплата"
} else if indexPath.row == 5 {
cell.textLabel?.text = "Отзывы"
} else if indexPath.row == 6 {
cell.textLabel?.text = "Новости"
} else if indexPath.row == 7 {
cell.textLabel?.text = "Обратная связь"
} else if indexPath.row == 8 {
cell.textLabel?.text = "Связь с нами"
}
return cell
}