I have a navigation bar with a table view controller that display 4 images (4 cells). I have 4 viewControllers that I need to show when the user clicks on the cell ( each image show a specific VC ) ??
any ideas would be much appreciated
here is my code :
class MenuTable: UITableViewController {
@IBOutlet weak var imgtable: UITableView!
var menuImage: [UIImage] = [
UIImage(named: "image1")!,
UIImage(named: "image2")!,
UIImage(named: "image3")!,
UIImage(named: "image4")!
]
override func viewDidLoad() {
super.viewDidLoad()
imgtable.dataSource = self
imgtable.delegate = self
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return menuImage.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("menucell") as! Menucell
cell!.imageview.image = menuImage[indexPath.row]
return cell
}
}