NibLoadable.swift 359 B

123456789101112131415161718192021
  1. //
  2. // NibLoadable.swift
  3. //
  4. // Created by Nate Racklyeft on 7/2/16.
  5. // Copyright © 2016 Nathan Racklyeft. All rights reserved.
  6. //
  7. import UIKit
  8. protocol NibLoadable: IdentifiableClass {
  9. static func nib() -> UINib
  10. }
  11. extension NibLoadable {
  12. static func nib() -> UINib {
  13. return UINib(nibName: className, bundle: Bundle(for: self))
  14. }
  15. }