StampCollectionHeaderView.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // StampCollectionHeaderView.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 StampCollectionHeaderView: UICollectionReusableView {
  14. var textLabel: UILabel?
  15. override init(frame: CGRect) {
  16. super.init(frame: frame)
  17. backgroundColor = UIColor(red: 248.0/255.0, green: 248.0/255.0, blue: 248.0/255.0, alpha: 1.0)
  18. textLabel = UILabel()
  19. textLabel?.textColor = UIColor(red: 36.0/255.0, green: 36.0/255.0, blue: 36.0/255.0, alpha: 1.0)
  20. textLabel?.font = UIFont.systemFont(ofSize: 14.0)
  21. if textLabel != nil {
  22. addSubview(textLabel!)
  23. }
  24. }
  25. required init?(coder: NSCoder) {
  26. super.init(coder: coder)
  27. }
  28. override func layoutSubviews() {
  29. super.layoutSubviews()
  30. textLabel?.frame = CGRect(x: 10, y: 0, width: bounds.size.width-20, height: 20)
  31. }
  32. }