Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. protocol Reusable: class {
  2. static func reuseIdentifier(_ addOn: String?) -> String
  3. }
  4.  
  5. extension Reusable {
  6. static func reuseIdentifier(_ addOn: String? = nil) -> String {
  7. if let addOn = addOn {
  8. return "\(String(describing: self))-\(addOn)"
  9. }
  10.  
  11. return String(describing: self)
  12. }
  13. }
  14.  
  15. extension UICollectionViewCell: Reusable {}
  16. extension UITableViewCell: Reusable {}
  17. extension UITableViewHeaderFooterView: Reusable {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement