Advertisement
Guest User

Untitled

a guest
Feb 8th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import UIKit
  2.  
  3. class SomeTableViewController: UITableViewController {
  4.    
  5.     var currentResponse:NSArray!
  6.    
  7.    
  8.     override func viewDidLoad() {
  9.         super.viewDidLoad()
  10.  
  11.     }
  12.    
  13.     override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  14.         return currentResponse.count;
  15.     }
  16.    
  17.     override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {      
  18.         println(currentResponse[indexPath.row])
  19.     }
  20.    
  21.     override func didReceiveMemoryWarning() {
  22.         super.didReceiveMemoryWarning()
  23.         // Dispose of any resources that can be recreated.
  24.     }
  25.  
  26.     // MARK: - Navigation
  27.    
  28.     // In a storyboard-based application, you will often want to do a little preparation before navigation
  29.     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
  30.     if segue.identifier == "toRestaurant"{
  31.         let navigationController = segue.destinationViewController as UINavigationController
  32.         let vc = navigationController.topViewController as RestaurantViewController
  33.         vc.data = currentResponse[index!.row]
  34.      }
  35.     }
  36.    
  37.    
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement