Browse Source

change ui

pull/1/head
james 5 years ago
parent
commit
bed506121f
  1. BIN
      .DS_Store
  2. 90
      GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
  3. 13
      GMERemittance/Utility/HotLine/Application Logic/Interactor/HotLineInteractor.swift
  4. 85
      GMERemittance/Utility/HotLine/User Interface/View/Cell/HotLineCell.swift
  5. 163
      GMERemittance/Utility/HotLine/User Interface/View/HotLine.storyboard
  6. 14
      GMERemittance/Utility/HotLine/User Interface/View/HotLineViewController.swift

BIN
.DS_Store

90
GMERemittance/Module/Home/User Interface/View/HomeViewController.swift

@ -117,31 +117,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
super.viewDidAppear(animated)
if KeyChain.shared.get(key: .biometricAuth) == nil {
// new page
BiometricAuthenticationNotificationWireframe().openMainView(source: self)
// alert
// self.alertWithOkCancel(
// message: "(manual: Settings -> Use FaceID & TouchID)",
// title: "Do you want to use your FaceID & TouchID\nto log in and send money?",
// okTitle: "Use",
// style: .alert,
// cancelTitle: "Don't use",
// OkStyle: .default,
// cancelStyle: .destructive,
// okAction: {
// BiometricAuthenticationWireframe().showBiometricAuthentication() { error in
// if error != nil {
// KeyChain.shared.save(data: "0", key: .biometricAuth)
// } else {
// KeyChain.shared.save(data: "1", key: .biometricAuth)
// }
// }
// },
// cancelAction: {
// KeyChain.shared.save(data: "0", key: .biometricAuth)
// }
// )
}
}
// MARK: IBActions
@ -308,38 +284,40 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
}
@objc func showSupport() {
let alert = UIAlertController(title:nil, message:"help_you_text".localized(), preferredStyle: .actionSheet)
// alert.view.subviews.last?.subviews.last?.backgroundColor = UIColor.darkGray
let liveChat = UIAlertAction(title: "Live Chat", style: .default) {
UIAlertAction in
}
let contactNumber = UIAlertAction(title: userHotLine?.remitPhone ?? "1588 6864", style: .default) {
UIAlertAction in
self.startCall(contactNumber: self.userHotLine?.remitPhone ?? "1588 6864")
}
let supportEmail = UIAlertAction(title: "support@gmeremit.com", style: .default) {
UIAlertAction in
let storyboard = UIStoryboard.init(name: "MessageCompose", bundle: Bundle.main)
if let messageViewController = storyboard.instantiateViewController(withIdentifier: "message") as? MessageComposeViewController {
self.navigationController!.pushViewController(messageViewController, animated: true)
}
}
liveChat.setValue(UIImage(named:"ic_live_chat")?.withRenderingMode(.alwaysOriginal),forKey:"image")
contactNumber.setValue(UIImage(named:"ic_call")?.withRenderingMode(.alwaysOriginal),forKey:"image")
supportEmail.setValue(UIImage(named:"ic_email")?.withRenderingMode(.alwaysOriginal),forKey:"image")
// TODO: have to enable when zendesk is provided
// alert.addAction(liveChat)
alert.addAction(contactNumber)
// alert.addAction(supportEmail)
alert.view.tintColor = UIColor.darkGray
// alert.view.subviews.last?.subviews.last?.layer.cornerRadius = 10
alert.addAction(UIAlertAction(title: "cancel_text".localized(), style: UIAlertActionStyle.cancel, handler: nil))
present(alert, animated: true, completion: nil)
// let alert = UIAlertController(title:nil, message:"help_you_text".localized(), preferredStyle: .actionSheet)
//// alert.view.subviews.last?.subviews.last?.backgroundColor = UIColor.darkGray
//
// let liveChat = UIAlertAction(title: "Live Chat", style: .default) {
// UIAlertAction in
// }
// let contactNumber = UIAlertAction(title: userHotLine?.remitPhone ?? "1588 6864", style: .default) {
// UIAlertAction in
// self.startCall(contactNumber: self.userHotLine?.remitPhone ?? "1588 6864")
// }
// let supportEmail = UIAlertAction(title: "support@gmeremit.com", style: .default) {
// UIAlertAction in
// let storyboard = UIStoryboard.init(name: "MessageCompose", bundle: Bundle.main)
// if let messageViewController = storyboard.instantiateViewController(withIdentifier: "message") as? MessageComposeViewController {
// self.navigationController!.pushViewController(messageViewController, animated: true)
// }
// }
//
// liveChat.setValue(UIImage(named:"ic_live_chat")?.withRenderingMode(.alwaysOriginal),forKey:"image")
// contactNumber.setValue(UIImage(named:"ic_call")?.withRenderingMode(.alwaysOriginal),forKey:"image")
// supportEmail.setValue(UIImage(named:"ic_email")?.withRenderingMode(.alwaysOriginal),forKey:"image")
//
// // TODO: have to enable when zendesk is provided
// // alert.addAction(liveChat)
// alert.addAction(contactNumber)
//// alert.addAction(supportEmail)
// alert.view.tintColor = UIColor.darkGray
//
//// alert.view.subviews.last?.subviews.last?.layer.cornerRadius = 10
//
// alert.addAction(UIAlertAction(title: "cancel_text".localized(), style: UIAlertActionStyle.cancel, handler: nil))
// present(alert, animated: true, completion: nil)
HotLineWireframe().openHotLineUsingPanModal(in: self)
}

13
GMERemittance/Utility/HotLine/Application Logic/Interactor/HotLineInteractor.swift

@ -29,7 +29,18 @@ extension HotLineInteractor: HotLineInteractorInput {
func fetchHotLines() {
service.fetchHotLines(
success: {
self.output?.setHotLine(with: $0)
let userCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet)
guard
let userHotLine = $0?.filter({ $0.countryCode == userCountry }),
let anotherHotLines = $0?.filter ({ $0.countryCode != userCountry })
else {
self.output?.setHotLine(with: $0)
return
}
let restoredHotLines = userHotLine + anotherHotLines
self.output?.setHotLine(with: restoredHotLines)
},
failure: {
self.output?.setError(with: $0)

85
GMERemittance/Utility/HotLine/User Interface/View/Cell/HotLineCell.swift

@ -9,16 +9,81 @@
import UIKit
class HotLineCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
@IBOutlet weak var flagImageView: UIImageView!
private var remitPhoneNunmber: String?
private var remitFacebookURL: String?
private var loanPhoneNumber: String?
private var loanFacebookUrl: String?
private var countryName: String?
private var coutryFlag: UIImage? {
didSet {
flagImageView.image = coutryFlag
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
@IBAction func touchButtons(_ sender: UIButton) {
switch sender.tag {
case 0:
guard let phone = remitPhoneNunmber
else {
return
}
startCall(contactNumber: phone)
case 1:
guard let url = remitFacebookURL
else {
return
}
UIApplication.tryURL(url: url)
case 2:
guard let phone = remitPhoneNunmber
else {
return
}
startCall(contactNumber: phone)
case 3:
guard let url = remitFacebookURL
else {
return
}
UIApplication.tryURL(url: url)
default:
break
}
}
func setModel(_ model: HotLine?){
remitPhoneNunmber = model?.remitPhone
remitFacebookURL = model?.remitFacebook
loanPhoneNumber = model?.loanPhone
loanFacebookUrl = model?.loanFacebook
countryName = model?.country
coutryFlag = CountryInfo().getFlag(for: model?.countryCode ?? "")
}
private func startCall(contactNumber: String){
if let url = URL(string: "tel://\(contactNumber.removeWhitespacesInBetween())"), UIApplication.shared.canOpenURL(url) {
if #available(iOS 10, *) {
UIApplication.shared.open(url)
} else {
UIApplication.shared.openURL(url)
}
}
}
}

163
GMERemittance/Utility/HotLine/User Interface/View/HotLine.storyboard

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
@ -17,11 +18,7 @@
<!--HotLine-->
<scene sceneID="R60-Pu-Hpy">
<objects>
<viewController storyboardIdentifier="HotLineViewController" title="HotLine" id="HSb-ou-7T5" customClass="HotLineViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y1H-iV-BwG"/>
<viewControllerLayoutGuide type="bottom" id="PYB-Kq-ghm"/>
</layoutGuides>
<viewController storyboardIdentifier="HotLineViewController" title="HotLine" id="HSb-ou-7T5" customClass="HotLineViewController" customModule="GME_Remit" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="9Uc-9s-KgO">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@ -30,139 +27,119 @@
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="HotLineCell" rowHeight="180" id="qcc-ox-s5M" customClass="HotLineCell" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="180"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="HotLineCell" rowHeight="100" id="WUU-iJ-aZ4" customClass="HotLineCell" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="qcc-ox-s5M" id="Bha-GS-0lr">
<rect key="frame" x="0.0" y="0.0" width="375" height="179.5"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="WUU-iJ-aZ4" id="Ky0-Um-vZx">
<rect key="frame" x="0.0" y="0.0" width="375" height="99.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="g1n-lr-7hs">
<rect key="frame" x="5" y="5" width="365" height="169.5"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U5m-7u-HAT">
<rect key="frame" x="5" y="5" width="365" height="89.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="juS-fY-yy2">
<rect key="frame" x="0.0" y="0.0" width="178.5" height="169.5"/>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="VFv-gQ-X6F">
<rect key="frame" x="5" y="5" width="355" height="79.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="flag_cambodia" translatesAutoresizingMaskIntoConstraints="NO" id="5ZC-ee-1vY">
<rect key="frame" x="46.5" y="20" width="86" height="47"/>
<constraints>
<constraint firstAttribute="width" constant="86" id="ICJ-6K-byj"/>
<constraint firstAttribute="height" constant="47" id="NK8-zv-GMV"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="B3n-QO-Fn2">
<rect key="frame" x="20" y="75" width="138.5" height="74.5"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="zQs-eU-4g9">
<rect key="frame" x="0.0" y="12.5" width="118.5" height="55"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cambodia" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="itE-VH-W3e">
<rect key="frame" x="32" y="0.0" width="74.5" height="19.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remittance" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5fw-Fv-ris">
<rect key="frame" x="27" y="27.5" width="84.5" height="19.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" text="Remittance" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vKr-7n-GAF">
<rect key="frame" x="17" y="0.0" width="84.5" height="25"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<nil key="textColor"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="0RE-6C-Rzd">
<rect key="frame" x="43" y="55" width="53" height="19.5"/>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="9hu-js-YNc">
<rect key="frame" x="31.5" y="30" width="55" height="25"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="59m-Y7-qhb">
<rect key="frame" x="0.0" y="0.0" width="20" height="19.5"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mTd-3t-MEt">
<rect key="frame" x="0.0" y="0.0" width="25" height="25"/>
<state key="normal" image="ic_call"/>
<connections>
<action selector="touchButtons:" destination="WUU-iJ-aZ4" eventType="touchUpInside" id="g5g-87-YKJ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="R4Y-Rh-5gZ">
<rect key="frame" x="28" y="0.0" width="25" height="19.5"/>
<button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NCh-op-vBX">
<rect key="frame" x="30" y="0.0" width="25" height="25"/>
<state key="normal" image="settingsFacebook"/>
<connections>
<action selector="touchButtons:" destination="WUU-iJ-aZ4" eventType="touchUpInside" id="d7X-9e-mYL"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="B3n-QO-Fn2" secondAttribute="trailing" constant="20" id="8Xf-a1-Xrw"/>
<constraint firstItem="B3n-QO-Fn2" firstAttribute="top" secondItem="5ZC-ee-1vY" secondAttribute="bottom" constant="8" id="ClS-ms-p3O"/>
<constraint firstItem="5ZC-ee-1vY" firstAttribute="centerX" secondItem="juS-fY-yy2" secondAttribute="centerX" id="cIr-Sx-oWf"/>
<constraint firstItem="5ZC-ee-1vY" firstAttribute="top" secondItem="juS-fY-yy2" secondAttribute="top" constant="20" id="fng-2L-K1s"/>
<constraint firstItem="B3n-QO-Fn2" firstAttribute="leading" secondItem="juS-fY-yy2" secondAttribute="leading" constant="20" id="l38-is-N7c"/>
<constraint firstAttribute="bottom" secondItem="B3n-QO-Fn2" secondAttribute="bottom" constant="20" id="skh-eF-iKO"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FXy-vu-7pW">
<rect key="frame" x="186.5" y="0.0" width="178.5" height="169.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="flag_cambodia" translatesAutoresizingMaskIntoConstraints="NO" id="ciH-Zq-8ma">
<rect key="frame" x="46.5" y="20" width="86" height="47"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="flag_india" translatesAutoresizingMaskIntoConstraints="NO" id="jyB-qm-a7d">
<rect key="frame" x="118.5" y="15" width="118" height="50"/>
<constraints>
<constraint firstAttribute="width" constant="86" id="45v-cn-6E2"/>
<constraint firstAttribute="height" constant="47" id="G8S-g7-tc0"/>
<constraint firstAttribute="height" constant="50" id="w9l-Qs-DVj"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="40C-dX-Dde">
<rect key="frame" x="20" y="75" width="138.5" height="74.5"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="vF1-iq-TZE">
<rect key="frame" x="236.5" y="14" width="118.5" height="52"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cambodia" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bMM-5j-sXy">
<rect key="frame" x="32" y="0.0" width="74.5" height="19.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loan" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bc0-vY-sfb">
<rect key="frame" x="51.5" y="27.5" width="36" height="19.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loan" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J9n-M4-C7V">
<rect key="frame" x="41.5" y="0.0" width="36" height="25"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<nil key="textColor"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="sKS-AN-hQr">
<rect key="frame" x="43" y="55" width="53" height="19.5"/>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="sV8-xh-2Ut">
<rect key="frame" x="32" y="27" width="55" height="25"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b8Z-ka-Lak">
<rect key="frame" x="0.0" y="0.0" width="20" height="19.5"/>
<button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s7d-ch-cec">
<rect key="frame" x="0.0" y="0.0" width="25" height="25"/>
<state key="normal" image="ic_call"/>
<connections>
<action selector="touchButtons:" destination="WUU-iJ-aZ4" eventType="touchUpInside" id="tOq-0d-NJC"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x2P-eV-GpZ">
<rect key="frame" x="28" y="0.0" width="25" height="19.5"/>
<button opaque="NO" tag="3" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tbU-xa-5US">
<rect key="frame" x="30" y="0.0" width="25" height="25"/>
<state key="normal" image="settingsFacebook"/>
<connections>
<action selector="touchButtons:" destination="WUU-iJ-aZ4" eventType="touchUpInside" id="uow-i1-Uwz"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="40C-dX-Dde" secondAttribute="trailing" constant="20" id="24B-6P-9ms"/>
<constraint firstItem="40C-dX-Dde" firstAttribute="leading" secondItem="FXy-vu-7pW" secondAttribute="leading" constant="20" id="8lO-Lj-Ucg"/>
<constraint firstItem="ciH-Zq-8ma" firstAttribute="top" secondItem="FXy-vu-7pW" secondAttribute="top" constant="20" id="Hcf-cK-J1t"/>
<constraint firstItem="40C-dX-Dde" firstAttribute="top" secondItem="ciH-Zq-8ma" secondAttribute="bottom" constant="8" id="cKu-m3-ZGd"/>
<constraint firstItem="ciH-Zq-8ma" firstAttribute="centerX" secondItem="FXy-vu-7pW" secondAttribute="centerX" id="usT-f7-pza"/>
<constraint firstAttribute="bottom" secondItem="40C-dX-Dde" secondAttribute="bottom" constant="20" id="zYz-H7-7wF"/>
</constraints>
</view>
</stackView>
</subviews>
</stackView>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="VFv-gQ-X6F" firstAttribute="leading" secondItem="U5m-7u-HAT" secondAttribute="leading" constant="5" id="9cY-WT-KuU"/>
<constraint firstAttribute="bottom" secondItem="VFv-gQ-X6F" secondAttribute="bottom" constant="5" id="NmF-DK-ke9"/>
<constraint firstItem="VFv-gQ-X6F" firstAttribute="top" secondItem="U5m-7u-HAT" secondAttribute="top" constant="5" id="QKQ-Cc-v3g"/>
<constraint firstAttribute="trailing" secondItem="VFv-gQ-X6F" secondAttribute="trailing" constant="5" id="ndZ-tV-Bpf"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="g1n-lr-7hs" firstAttribute="leading" secondItem="Bha-GS-0lr" secondAttribute="leading" constant="5" id="9eg-2c-a0X"/>
<constraint firstAttribute="bottom" secondItem="g1n-lr-7hs" secondAttribute="bottom" constant="5" id="LYk-15-AcL"/>
<constraint firstAttribute="trailing" secondItem="g1n-lr-7hs" secondAttribute="trailing" constant="5" id="bNw-LW-Wty"/>
<constraint firstItem="g1n-lr-7hs" firstAttribute="top" secondItem="Bha-GS-0lr" secondAttribute="top" constant="5" id="gn3-Qu-uIg"/>
<constraint firstItem="U5m-7u-HAT" firstAttribute="leading" secondItem="Ky0-Um-vZx" secondAttribute="leading" constant="5" id="1mj-VO-d4M"/>
<constraint firstAttribute="bottom" secondItem="U5m-7u-HAT" secondAttribute="bottom" constant="5" id="2in-Ya-O2m"/>
<constraint firstAttribute="trailing" secondItem="U5m-7u-HAT" secondAttribute="trailing" constant="5" id="aw2-7q-NtF"/>
<constraint firstItem="U5m-7u-HAT" firstAttribute="top" secondItem="Ky0-Um-vZx" secondAttribute="top" constant="5" id="ot6-JY-G8m"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="flagImageView" destination="jyB-qm-a7d" id="TVa-EM-mOf"/>
</connections>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="X4Y-Ao-bhe" secondAttribute="trailing" id="AKn-4B-nTc"/>
<constraint firstItem="PYB-Kq-ghm" firstAttribute="top" secondItem="X4Y-Ao-bhe" secondAttribute="bottom" id="CTV-7r-mVc"/>
<constraint firstItem="X4Y-Ao-bhe" firstAttribute="top" secondItem="y1H-iV-BwG" secondAttribute="bottom" id="DvA-cy-6Sy"/>
<constraint firstItem="X4Y-Ao-bhe" firstAttribute="leading" secondItem="9Uc-9s-KgO" secondAttribute="leading" id="F7g-aO-giq"/>
<constraint firstItem="vEJ-D7-JSF" firstAttribute="trailing" secondItem="X4Y-Ao-bhe" secondAttribute="trailing" id="AKn-4B-nTc"/>
<constraint firstItem="vEJ-D7-JSF" firstAttribute="bottom" secondItem="X4Y-Ao-bhe" secondAttribute="bottom" id="CTV-7r-mVc"/>
<constraint firstItem="X4Y-Ao-bhe" firstAttribute="top" secondItem="vEJ-D7-JSF" secondAttribute="top" id="DvA-cy-6Sy"/>
<constraint firstItem="X4Y-Ao-bhe" firstAttribute="leading" secondItem="vEJ-D7-JSF" secondAttribute="leading" id="F7g-aO-giq"/>
</constraints>
<viewLayoutGuide key="safeArea" id="vEJ-D7-JSF"/>
</view>
<connections>
<outlet property="tableView" destination="X4Y-Ao-bhe" id="GRx-f9-rnM"/>
@ -174,7 +151,7 @@
</scene>
</scenes>
<resources>
<image name="flag_cambodia" width="512" height="512"/>
<image name="flag_india" width="512" height="512"/>
<image name="ic_call" width="20" height="20"/>
<image name="settingsFacebook" width="25" height="25"/>
</resources>

14
GMERemittance/Utility/HotLine/User Interface/View/HotLineViewController.swift

@ -15,7 +15,7 @@ class HotLineViewController: UIViewController {
var presenter: HotLineModuleInterface?
let CellHeight: CGFloat = 180.0
let CellHeight: CGFloat = 100.0
// MARK: Computed Properties
@ -45,11 +45,11 @@ class HotLineViewController: UIViewController {
// MARK: HotLineViewInterface
extension HotLineViewController: HotLineViewInterface {
func setHotLine(with model: [HotLine]?) {
hotLines = model
}
func setError(with error: Error) {
alert(message: error.localizedDescription)
}
}
@ -57,6 +57,8 @@ extension HotLineViewController: HotLineViewInterface {
extension HotLineViewController {
private func setup() {
// all setup should be done here
tableView.dataSource = self
presenter?.fetchHotLines()
}
}
@ -72,6 +74,8 @@ extension HotLineViewController: UITableViewDataSource {
return UITableViewCell()
}
cell.setModel(hotLines?[indexPath.row])
return cell
}
@ -87,6 +91,10 @@ extension HotLineViewController: PanModalPresentable {
return self.tableView
}
var shortFormHeight: PanModalHeight {
return .contentHeight(CellHeight)
}
var longFormHeight: PanModalHeight {
return .maxHeight
}

Loading…
Cancel
Save