You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // CollectionViewCell.swift
  3. // GMERemittance
  4. //
  5. // Created by shishir sapkota on 8/21/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class ExchangeRateCollectionViewCell: UICollectionViewCell {
  10. @IBOutlet weak var imageview: UIImageView!
  11. @IBOutlet weak var cellBackgroundview: UIView!
  12. @IBOutlet weak var paymentLabel: UILabel!
  13. @IBOutlet weak var subtitleLabel: UILabel!
  14. var cellSelected = false
  15. var title: String?
  16. var subtitle: String?
  17. var image: UIImage?
  18. var paymentMode: PaymentMode?
  19. func setup() {
  20. self.imageview.image = image
  21. self.paymentLabel.text = "Cash Payment"
  22. cellBackgroundview.layer.cornerRadius = 10
  23. cellSelected ? showBorderColor() : hideBorderColor()
  24. }
  25. private func showBorderColor() {
  26. self.cellBackgroundview.layer.borderWidth = 1
  27. self.cellBackgroundview.layer.borderColor = UIColor.red.cgColor
  28. }
  29. private func hideBorderColor() {
  30. cellBackgroundview.layer.borderWidth = 0
  31. cellBackgroundview.layer.borderColor = UIColor.clear.cgColor
  32. }
  33. }