BaseCollectionViewCell.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*****************************************************************************
  2. * BaseCollectionViewCell.Swift
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2018 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Carola Nitz <nitz.carola # googlemail.com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import Foundation
  13. class BaseCollectionViewCell: UICollectionViewCell {
  14. static var defaultReuseIdentifier: String {
  15. return NSStringFromClass(self)
  16. }
  17. class var nibName: String {
  18. return String(describing:self)
  19. }
  20. var media: VLCMLObject?
  21. class func numberOfColumns(for width: CGFloat) -> CGFloat {
  22. return CGFloat.zero
  23. }
  24. class func cellSizeForWidth(_ width: CGFloat) -> CGSize {
  25. return CGSize.zero
  26. }
  27. class var edgePadding: CGFloat {
  28. return 15
  29. }
  30. class var interItemPadding: CGFloat {
  31. return 5
  32. }
  33. }
  34. enum DeviceWidth: CGFloat {
  35. case iPhonePortrait = 414
  36. case iPhoneLandscape = 896
  37. case iPadLandscape = 1024
  38. }