Last active
February 17, 2017 18:59
-
-
Save dornad/d2cff3394153ac281b2f31324340c3c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MovieTableViewController : UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
tableView.register(MovieCell.self, forCellReuseIdentifier: "MovieCell") | |
} | |
} | |
extension MovieTableViewController { | |
override func numberOfSections(in tableView: UITableView) -> Int { | |
return 0 | |
} | |
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return 0 | |
} | |
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
let cell = tableView.dequeueReusableCell(withIdentifier: "MovieCell", for: indexPath) as! MovieCell | |
return cell | |
} | |
} | |
class MovieCell : UITableViewCell { | |
} | |
// JSON Structure | |
let json = { | |
[ | |
{ | |
"poster_path": "/tvSlBzAdRE29bZe5yYWrJ2ds137.jpg", | |
"release_date": "1977-05-25", | |
"id": 11, | |
"title": "Star Wars", | |
}, | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment