Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class SomeTableViewController: UITableViewController {
- var currentResponse:NSArray!
- override func viewDidLoad() {
- super.viewDidLoad()
- }
- override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return currentResponse.count;
- }
- override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
- println(currentResponse[indexPath.row])
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- // MARK: - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
- if segue.identifier == "toRestaurant"{
- let navigationController = segue.destinationViewController as UINavigationController
- let vc = navigationController.topViewController as RestaurantViewController
- vc.data = currentResponse[index!.row]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement