Skip to content

Instantly share code, notes, and snippets.

@jimmythai
Created June 19, 2018 05:46
Show Gist options
  • Select an option

  • Save jimmythai/cf94a9f714975a4eb24788354a58a0a1 to your computer and use it in GitHub Desktop.

Select an option

Save jimmythai/cf94a9f714975a4eb24788354a58a0a1 to your computer and use it in GitHub Desktop.
protocol Reusable: class {
static var reusableIdentifier: String { get }
}
extension Reusable {
static var reusableIdentifier: String {
return String(describing: self)
}
}
protocol NibReusable: Reusable {
static var nib: UINib { get }
}
extension NibReusable {
static var nib: UINib {
let nibName = String(describing: self)
return UINib(nibName: nibName, bundle: Bundle(for: self))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment