From a1102fd0b1a50eac2c0a196e4be4932009c757a4 Mon Sep 17 00:00:00 2001 From: gme_2 Date: Wed, 5 Sep 2018 13:57:58 +0900 Subject: [PATCH] added shadow --- GMERemittance.xcodeproj/project.pbxproj | 4 ++++ .../Extension/CALayerExtension.swift | 20 +++++++++++++++++++ GMERemittance/Extension/UIViewExtension.swift | 2 -- GMERemittance/Library/CountryInfo.swift | 4 +--- ...ndMoenyPaymentModeCollectionViewCell.swift | 5 +++++ 5 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 GMERemittance/Extension/CALayerExtension.swift diff --git a/GMERemittance.xcodeproj/project.pbxproj b/GMERemittance.xcodeproj/project.pbxproj index 68bbb249..2eaf3311 100644 --- a/GMERemittance.xcodeproj/project.pbxproj +++ b/GMERemittance.xcodeproj/project.pbxproj @@ -327,6 +327,7 @@ D95B5E4721314A3C000C0B33 /* GmeContactsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95B5E4621314A3B000C0B33 /* GmeContactsTableViewCell.swift */; }; D95B5E4921314D31000C0B33 /* GmeContacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95B5E4821314D31000C0B33 /* GmeContacts.swift */; }; D95B5E4B21315C57000C0B33 /* EmptyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95B5E4A21315C57000C0B33 /* EmptyTableViewCell.swift */; }; + D95B7043213F9A2C0053CC3D /* CALayerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95B7042213F9A2C0053CC3D /* CALayerExtension.swift */; }; D962230C212BD7A100B7A115 /* ArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D962230B212BD7A100B7A115 /* ArrayExtension.swift */; }; D9622316212BE3DC00B7A115 /* TablePickerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9622312212BE3DB00B7A115 /* TablePickerTableViewCell.swift */; }; D9622317212BE3DC00B7A115 /* TableViewPicker.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9622313212BE3DB00B7A115 /* TableViewPicker.storyboard */; }; @@ -728,6 +729,7 @@ D95B5E4621314A3B000C0B33 /* GmeContactsTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GmeContactsTableViewCell.swift; sourceTree = ""; }; D95B5E4821314D31000C0B33 /* GmeContacts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GmeContacts.swift; sourceTree = ""; }; D95B5E4A21315C57000C0B33 /* EmptyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyTableViewCell.swift; sourceTree = ""; }; + D95B7042213F9A2C0053CC3D /* CALayerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CALayerExtension.swift; sourceTree = ""; }; D962230B212BD7A100B7A115 /* ArrayExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtension.swift; sourceTree = ""; }; D9622312212BE3DB00B7A115 /* TablePickerTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TablePickerTableViewCell.swift; sourceTree = ""; }; D9622313212BE3DB00B7A115 /* TableViewPicker.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = TableViewPicker.storyboard; sourceTree = ""; }; @@ -908,6 +910,7 @@ D962230B212BD7A100B7A115 /* ArrayExtension.swift */, D96848C6212D3A7400EF12B1 /* DataRequestExtension.swift */, D96848C8212D3AEB00EF12B1 /* ExtensionJSON.swift */, + D95B7042213F9A2C0053CC3D /* CALayerExtension.swift */, ); path = Extension; sourceTree = ""; @@ -2810,6 +2813,7 @@ A2B6CF19201469C800151863 /* EditCommentViewController.swift in Sources */, D90D55CC21327CD600EEEE04 /* AddReciepientServiceType.swift in Sources */, D9DAFE2C21354D8900483E71 /* SendMoenyPaymentModeCollectionViewCell.swift in Sources */, + D95B7043213F9A2C0053CC3D /* CALayerExtension.swift in Sources */, A25CF60920467BA40029BC12 /* InviteViewController.swift in Sources */, D922D9AD21351B7400D43053 /* SendMoneyVerificationPresenter.swift in Sources */, A25A6C092029ADA80024CDFB /* TranscationStatementViewController.swift in Sources */, diff --git a/GMERemittance/Extension/CALayerExtension.swift b/GMERemittance/Extension/CALayerExtension.swift new file mode 100644 index 00000000..f80c5e1b --- /dev/null +++ b/GMERemittance/Extension/CALayerExtension.swift @@ -0,0 +1,20 @@ +// +// CALayerExtension.swift +// GMERemittance +// +// Created by gme_2 on 05/09/2018. +// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation + + +extension CALayer { + func addShadow(with color: UIColor) { + self.shadowOffset = .zero + self.shadowOpacity = 0.37 + self.shadowRadius = 2 + self.shadowColor = color.cgColor + self.masksToBounds = false + } +} diff --git a/GMERemittance/Extension/UIViewExtension.swift b/GMERemittance/Extension/UIViewExtension.swift index 9ce2a958..08011ceb 100644 --- a/GMERemittance/Extension/UIViewExtension.swift +++ b/GMERemittance/Extension/UIViewExtension.swift @@ -41,5 +41,3 @@ extension UIView { } - - diff --git a/GMERemittance/Library/CountryInfo.swift b/GMERemittance/Library/CountryInfo.swift index 741b5d96..3da97dd5 100644 --- a/GMERemittance/Library/CountryInfo.swift +++ b/GMERemittance/Library/CountryInfo.swift @@ -43,9 +43,7 @@ class CountryInfo { "tj" : #imageLiteral(resourceName: "flag_tajikistan"), // tajikistan "ae" : #imageLiteral(resourceName: "flag_uae"), // uae "uz" : #imageLiteral(resourceName: "flag_uzbekistn"), // uzbekistn - "by" : #imageLiteral(resourceName: "flag_belarus") // belarus - - + "by" : #imageLiteral(resourceName: "flag_belarus") // belarus ] var defaultCountries = ["Nepal", "Cambodia", "Philipinnes", "Sri Lanka", "Vietnam", "India", "Pakistan"] diff --git a/GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/Cells/SendMoenyPaymentModeCollectionViewCell.swift b/GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/Cells/SendMoenyPaymentModeCollectionViewCell.swift index 86e5c1a8..9e87fbdc 100644 --- a/GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/Cells/SendMoenyPaymentModeCollectionViewCell.swift +++ b/GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/Cells/SendMoenyPaymentModeCollectionViewCell.swift @@ -19,6 +19,7 @@ class SendMoenyPaymentModeCollectionViewCell: UICollectionViewCell { var paymentServiceMethod: SendMoneyPayoutMode? func setup() { + self.imageview.image = image self.paymentLabel.text = paymentServiceMethod?.mode @@ -31,10 +32,14 @@ class SendMoenyPaymentModeCollectionViewCell: UICollectionViewCell { private func showBorderColor() { self.cellBackgroundview.layer.borderWidth = 1 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) } } + +