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.

41 lines
1.2 KiB

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 image: UIImage?
  16. var paymentServiceMethod: PaymentServiceType?
  17. func setup() {
  18. self.imageview.image = image
  19. self.paymentLabel.text = paymentServiceMethod?.type
  20. self.subtitleLabel.text = paymentServiceMethod?.subtitle
  21. cellBackgroundview.layer.cornerRadius = 10
  22. cellSelected ? showBorderColor() : hideBorderColor()
  23. }
  24. private func showBorderColor() {
  25. self.cellBackgroundview.layer.borderWidth = 1
  26. self.cellBackgroundview.layer.borderColor = UIColor.red.cgColor
  27. }
  28. private func hideBorderColor() {
  29. cellBackgroundview.layer.borderWidth = 0
  30. cellBackgroundview.layer.borderColor = UIColor.clear.cgColor
  31. }
  32. }