Hi Everyone I'm Experiencing 2 errors when I'm running my app with a slide out menu
class ViewController: UIViewController {
@IBOutlet var open: UIBarButtonItem!
@IBOutlet var label: UILabel!
var varView = Int()
override func viewDidAppear(_ animated: Bool) {
open.target = revealViewController()
open.action = #selector(SWRevealViewController.revealToggle(_:))
_ = UIStoryboard(name: "Main", bundle: nil)
let vc = (storyboard?.instantiateViewController(withIdentifier: "mainpullout"))! as UIViewController
present(vc, animated: true, completion: nil)
}
@IBAction func toMain(_ sender: AnyObject?) {
_ = UIStoryboard(name: "Main", bundle: nil)
}
}
here is my class for my slide out controller that controls all the views in the table
class BackTableVC: UITableViewController {
var TableArray = [String]()
override func viewDidLoad() {
TableArray = ["Camps","Lessons","Staff","Classes","Calendar","News","Forums","Locations","Services","Home"]
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return TableArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: TableArray[indexPath.row], for: indexPath) as UITableViewCell
cell.textLabel?.text = TableArray[indexPath.row]
return cell
}
}
i feel like I'm doing something wrong but when i run my app it the view where the button is to open the slide out menu just bounces up and down a million times heres one of the error messages
Presenting view controllers on detached view controllers is discouraged
UITableViewin Swift - JuicyFruitlet cell = tableView.dequeueReusableCell(withIdentifier: TableArray[indexPath.row], for: indexPath) as UITableViewCellis wrong, checkUITableViewtutorials about what cell id is - JuicyFruit