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.
 
 
 
 

43 lines
1.3 KiB

//
// CollectionViewCell.swift
// GMERemittance
//
// Created by shishir sapkota on 8/21/18.
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
//
import UIKit
class ExchangeRateCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageview: UIImageView!
@IBOutlet weak var cellBackgroundview: UIView!
@IBOutlet weak var paymentLabel: UILabel!
@IBOutlet weak var subtitleLabel: UILabel!
var cellSelected = false
var image: UIImage?
var paymentServiceMethod: PaymentServiceType?
func setup() {
self.imageview.image = image
self.paymentLabel.text = paymentServiceMethod?.type
self.subtitleLabel.text = paymentServiceMethod?.subtitle
cellBackgroundview.layer.cornerRadius = 10
cellSelected ? showBorderColor() : hideBorderColor()
}
private func showBorderColor() {
self.cellBackgroundview.layer.borderWidth = 0.3
self.cellBackgroundview.layer.borderColor = UIColor.red.cgColor
self.layer.addShadow(with: UIColor.red)
}
private func hideBorderColor() {
cellBackgroundview.layer.borderWidth = 0
cellBackgroundview.layer.borderColor = UIColor.clear.cgColor
self.layer.addShadow(with: UIColor.clear)
}
}