Created
December 9, 2016 08:21
-
-
Save artemnovichkov/de5bd4daf64441c724a429d1a9b1e26e to your computer and use it in GitHub Desktop.
UItableView dequeueing with Swift magic
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
import UIKit | |
extension UITableView { | |
func dequeueReusableCell<T: UITableViewCell>() -> T { | |
return dequeueReusableCell(withIdentifier: NSStringFromClass(T.self)) as! T | |
} | |
} | |
//using: let cell: ExampleTableViewCell = tableView.dequeueReusableCell() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment