CStampCollectionViewCell.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // CStampCollectionViewCell.swift
  3. // ComPDFKit_Tools
  4. //
  5. // Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. import UIKit
  13. class CStampCollectionViewCell: UICollectionViewCell {
  14. var stampImage: UIImageView?
  15. var editing: Bool = false
  16. override init(frame: CGRect) {
  17. super.init(frame: frame)
  18. stampImage = UIImageView()
  19. stampImage?.backgroundColor = UIColor.clear
  20. stampImage?.contentMode = .scaleAspectFit
  21. if stampImage != nil {
  22. contentView.addSubview(stampImage!)
  23. }
  24. contentView.layer.borderWidth = 0.5
  25. contentView.layer.borderColor = UIColor.lightGray.cgColor
  26. }
  27. override func layoutSubviews() {
  28. super.layoutSubviews()
  29. stampImage?.frame = CGRect(x: 10, y: (contentView.bounds.size.height - 50)/2, width: contentView.bounds.size.width - 20, height: 50)
  30. }
  31. required init?(coder aDecoder: NSCoder) {
  32. fatalError("init(coder:) has not been implemented")
  33. }
  34. }