I keep receiving the error message "'override' can only be specified on class members" in regards to the override func. I have tried inserting a "}" before the override func but received even more errors.
import UIKit
class MainVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableVideo: UITableView!
var partyRocks = [PartyRock]()
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return partyRocks.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
tableView.delegate = self
tableView.dataSource = self
if let cell = tableView.dequeueReusableCell(withIdentifier: "PartyCell", for: indexPath) as? PartyCell {
let partyRock = partyRocks[indexPath.row]
return cell
} else {
return UITableViewCell()
}
override func viewDidLoad() {
super.viewDidLoad()
}
let p1 = PartyRock(imageURL: "https://www.lonelyplanet.com/travel-tips-and-articles/eight-amazing-cities-for-street-art/40625c8c-8a11-5710-a052-1479d276ed25", videoURL: "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/9f31OCHXAsI\" frameborder=\"0\" allowfullscreen></iframe>", videoTitle: "Stephen's Artwork")
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return partyRocks.count
}
}
}