|
@ -32,13 +32,15 @@ class HomeExchangeRateView: UIView { |
|
|
flowlayout.collectionView?.showsHorizontalScrollIndicator = false |
|
|
flowlayout.collectionView?.showsHorizontalScrollIndicator = false |
|
|
flowlayout.collectionView?.showsVerticalScrollIndicator = false |
|
|
flowlayout.collectionView?.showsVerticalScrollIndicator = false |
|
|
|
|
|
|
|
|
let view = UICollectionView(frame: CGRect.zero, collectionViewLayout: flowlayout) |
|
|
|
|
|
view.translatesAutoresizingMaskIntoConstraints = false |
|
|
|
|
|
view.register(HomeExchangeRateCollectionViewCell.self, forCellWithReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier) |
|
|
|
|
|
view.backgroundColor = .white |
|
|
|
|
|
view.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 8, right: 0) |
|
|
|
|
|
view.showsHorizontalScrollIndicator = false |
|
|
|
|
|
return view |
|
|
|
|
|
|
|
|
let colView = UICollectionView(frame: CGRect.zero, collectionViewLayout: flowlayout) |
|
|
|
|
|
colView.translatesAutoresizingMaskIntoConstraints = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
colView.register(HomeExchangeRateCollectionViewCell.self, forCellWithReuseIdentifier: "HomeExchangeRateCollectionViewCell") |
|
|
|
|
|
colView.backgroundColor = .white |
|
|
|
|
|
colView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 8, right: 0) |
|
|
|
|
|
colView.showsHorizontalScrollIndicator = false |
|
|
|
|
|
return colView |
|
|
}() |
|
|
}() |
|
|
|
|
|
|
|
|
private let transferFeeIncludedImageView: UIImageView = { |
|
|
private let transferFeeIncludedImageView: UIImageView = { |
|
@ -361,9 +363,9 @@ class HomeExchangeRateView: UIView { |
|
|
recivedMoneyView.updatedText = defaultAmount.likeCommaMoney() |
|
|
recivedMoneyView.updatedText = defaultAmount.likeCommaMoney() |
|
|
|
|
|
|
|
|
calculateExchangeRate() |
|
|
calculateExchangeRate() |
|
|
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { |
|
|
|
|
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { |
|
|
self.collectionView.reloadData() |
|
|
self.collectionView.reloadData() |
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@objc func calculateExchangeRate() { |
|
|
@objc func calculateExchangeRate() { |
|
@ -380,6 +382,9 @@ class HomeExchangeRateView: UIView { |
|
|
.elementAt(index: selectedPaymentModeIndex)?.id ?? "", |
|
|
.elementAt(index: selectedPaymentModeIndex)?.id ?? "", |
|
|
calcBy: calcBy |
|
|
calcBy: calcBy |
|
|
) |
|
|
) |
|
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { |
|
|
|
|
|
self.collectionView.reloadData() |
|
|
|
|
|
} |
|
|
self.tappedCalculateExchangeRate?(model) |
|
|
self.tappedCalculateExchangeRate?(model) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -425,12 +430,10 @@ extension HomeExchangeRateView: UICollectionViewDelegate, |
|
|
collectionView: UICollectionView, |
|
|
collectionView: UICollectionView, |
|
|
indexPath: IndexPath |
|
|
indexPath: IndexPath |
|
|
) -> UICollectionViewCell { |
|
|
) -> UICollectionViewCell { |
|
|
guard let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier, |
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: "HomeExchangeRateCollectionViewCell", |
|
|
for: indexPath |
|
|
for: indexPath |
|
|
) as? HomeExchangeRateCollectionViewCell else { |
|
|
|
|
|
return UICollectionViewCell() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
) as! HomeExchangeRateCollectionViewCell |
|
|
|
|
|
|
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
index: indexPath.row |
|
|
index: indexPath.row |
|
@ -445,12 +448,10 @@ extension HomeExchangeRateView: UICollectionViewDelegate, |
|
|
collectionView: UICollectionView, |
|
|
collectionView: UICollectionView, |
|
|
indexPath: IndexPath |
|
|
indexPath: IndexPath |
|
|
) -> UICollectionViewCell { |
|
|
) -> UICollectionViewCell { |
|
|
guard let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier, |
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: "HomeExchangeRateCollectionViewCell", |
|
|
for: indexPath |
|
|
for: indexPath |
|
|
) as? HomeExchangeRateCollectionViewCell else { |
|
|
|
|
|
return UICollectionViewCell() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
) as! HomeExchangeRateCollectionViewCell |
|
|
|
|
|
|
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
index: indexPath.row |
|
|
index: indexPath.row |
|
@ -465,12 +466,10 @@ extension HomeExchangeRateView: UICollectionViewDelegate, |
|
|
collectionView: UICollectionView, |
|
|
collectionView: UICollectionView, |
|
|
indexPath: IndexPath |
|
|
indexPath: IndexPath |
|
|
) -> UICollectionViewCell { |
|
|
) -> UICollectionViewCell { |
|
|
guard let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier, |
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: "HomeExchangeRateCollectionViewCell", |
|
|
for: indexPath |
|
|
for: indexPath |
|
|
) as? HomeExchangeRateCollectionViewCell else { |
|
|
|
|
|
return UICollectionViewCell() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
) as! HomeExchangeRateCollectionViewCell |
|
|
|
|
|
|
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
index: indexPath.row |
|
|
index: indexPath.row |
|
@ -485,12 +484,10 @@ extension HomeExchangeRateView: UICollectionViewDelegate, |
|
|
collectionView: UICollectionView, |
|
|
collectionView: UICollectionView, |
|
|
indexPath: IndexPath |
|
|
indexPath: IndexPath |
|
|
) -> UICollectionViewCell { |
|
|
) -> UICollectionViewCell { |
|
|
guard let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier, |
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: "HomeExchangeRateCollectionViewCell", |
|
|
for: indexPath |
|
|
for: indexPath |
|
|
) as? HomeExchangeRateCollectionViewCell else { |
|
|
|
|
|
return UICollectionViewCell() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
) as! HomeExchangeRateCollectionViewCell |
|
|
|
|
|
|
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
index: indexPath.row |
|
|
index: indexPath.row |
|
@ -504,12 +501,10 @@ extension HomeExchangeRateView: UICollectionViewDelegate, |
|
|
collectionView: UICollectionView, |
|
|
collectionView: UICollectionView, |
|
|
indexPath: IndexPath |
|
|
indexPath: IndexPath |
|
|
) -> UICollectionViewCell { |
|
|
) -> UICollectionViewCell { |
|
|
guard let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: HomeExchangeRateCollectionViewCell.identifier, |
|
|
|
|
|
|
|
|
let cell = collectionView.dequeueReusableCell( |
|
|
|
|
|
withReuseIdentifier: "HomeExchangeRateCollectionViewCell", |
|
|
for: indexPath |
|
|
for: indexPath |
|
|
) as? HomeExchangeRateCollectionViewCell else { |
|
|
|
|
|
return UICollectionViewCell() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
) as! HomeExchangeRateCollectionViewCell |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
cell.paymentServiceMethod = self.selectedExchangeRateModel?.availableServices?.elementAt( |
|
|
index: indexPath.row |
|
|
index: indexPath.row |
|
|
) |
|
|
) |
|
|