Last active
December 7, 2016 15:33
-
-
Save dgyesbreghs/35597fff8b42282a1b453d60f7033748 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
import UIKit | |
extension UIView { | |
class func newAutoLayoutView() -> Self { | |
let view = self.init() | |
view.translatesAutoresizingMaskIntoConstraints = false | |
return view | |
} | |
class var reuseIdentifier : String { | |
return String(describing: self) | |
} | |
} | |
extension UITableView { | |
func registerClass(cellClass: AnyClass) { | |
self.register(cellClass, forCellReuseIdentifier: cellClass.reuseIdentifier) | |
} | |
func registerNib(nibName: String) { | |
self.register(UINib(nibName: nibName, bundle: nil), forCellReuseIdentifier: nibName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment