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.

45 lines
1.3 KiB

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