Я пытаюсь сделать простое приложение, отображающее данные из сети в таблицу.Но сайт требует авторизации OAuth 2.0 и получения токена.Хотел программно показать представление с WKWebView для этого.Я делаю это:
import UIKit
import WebKit
class TableViewController: UITableViewController, WKUIDelegate {
var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: CGRect(x: 0.0, y: 0.0, width: tableView.bounds.width, height: tableView.bounds.height), configuration: webConfiguration)
webView.uiDelegate = self
tableView.addSubview(webView)
let myRequest = URLRequest(url: URL(string: "https://www.google.ru/")!)
webView.load(myRequest)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "idFriendCell", for: indexPath)
cell.textLabel?.text = String(indexPath.row)
return cell
}
}
но разделители TableView перекрывают мой WebView: Как это сделать правильно?