Created
September 24, 2015 12:11
-
-
Save ymkjp/89fd7cb76c95f36a9e77 to your computer and use it in GitHub Desktop.
NewsPlayer/ViewController.swift
This file contains hidden or 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
| diff --git a/NewsPlayer/ViewController.swift b/NewsPlayer/ViewController.swift | |
| index 55fe627..ecdcd7e 100644 | |
| --- a/NewsPlayer/ViewController.swift | |
| +++ b/NewsPlayer/ViewController.swift | |
| @@ -205,9 +205,13 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega | |
| } | |
| func initVideoCell(indexPath: NSIndexPath) -> VideoTableViewCell { | |
| - videoTable.registerNib(UINib(nibName: cellName, bundle:nil), forCellReuseIdentifier:cellName) | |
| - return videoTable.dequeueReusableCellWithIdentifier( | |
| - cellName, forIndexPath: indexPath) as! VideoTableViewCell | |
| + if let _ = videoTable.dequeueReusableCellWithIdentifier(cellName) { | |
| + return videoTable.dequeueReusableCellWithIdentifier( | |
| + cellName, forIndexPath: indexPath) as! VideoTableViewCell | |
| + } else { | |
| + videoTable.registerNib(UINib(nibName: cellName, bundle:nil), forCellReuseIdentifier:cellName) | |
| + return initVideoCell(indexPath) | |
| + } | |
| } | |
| func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment