Browse Source

indonesian currency 1m krw fixed

pull/1/head
Swift Technology 6 years ago
parent
commit
58f9bb0997
  1. 4
      GMERemittance/Library/CountryInfo.swift
  2. 45
      GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift
  3. 35
      GMERemittance/_Home/_Home.storyboard

4
GMERemittance/Library/CountryInfo.swift

@ -260,7 +260,7 @@ class CountryInfo {
]
var defaultCountries = ["Nepal", "Cambodia", "Philipinnes", "Sri Lanka", "Vietnam", "India", "Pakistan", "azerbaijan", "Bangladesh", "Belarus", "Georgia", "Indonesia", "Kazakhstan", "Kyrgyzstan", "Malaysia", "Moldova", "Mongolia", "Myanmar", "Russian Federation", "Singapore", "Tajikistan", "Thailand", "Uzbekistan"]
var defaultCountryCodes = ["np", "kh", "ph", "lk", "vn", "in", "pk", "az", "bd", "by", "ge", "id", "kz", "kg", "my", "md", "mn", "mm", "ru", "sg", "tj", "th", "uz", "en"]
var defaultCountryCodes = ["np", "kh", "ph", "lk", "vn", "in", "pk", "az", "bd", "by", "ge", "kz", "kg", "my", "md", "mn", "mm", "ru", "sg", "tj", "th", "uz", "en"]
private var defaultSendingAmount: [String: String] =
[
@ -275,7 +275,7 @@ class CountryInfo {
"bd" : "100000", // Bangladesh
"by" : "1000", // Belarus
"ge" : "1000", // Georgia
"id" : "1000000", // indonesia
// "id" : "1000000", // indonesia
"kz" : "1000", // Kazakhstan
"kg" : "1000", // Kyrgyzstan
"my" : "10000", // Malaysia

45
GMERemittance/Module/ExchangeRates/User Interface/View/ExchangeRatesViewController.swift

@ -105,7 +105,7 @@ class ExchangeRatesViewController: UIViewController {
}
} else {
self.setDefaultValuesForCountriesNotHavingDefaultValue()
self.setDefaultValuesForCountriesNotHavingDefaultValueFirsttime()
showPaymentModeView()
}
}
@ -244,6 +244,32 @@ class ExchangeRatesViewController: UIViewController {
guard let recievingCountryId = exchangeModel.countryId else {return}
guard let paymentMethod = exchangeModel.availableServices?.elementAt(index: selectedPaymentIndex.row) else {return}
/*
if let _ = CountryInfo().defaultCountryCodes.filter({$0.lowercased() == (self.nativeCountryCode ?? "").lowercased()}).first {
if let defaultExchangeRate = self.exchangeRateModels?.filter({
($0.countryCode ?? "").lowercased() == (self.nativeCountryCode ?? "").lowercased()
}).first {
// there is native country, defaultExchangeRate is the information for that country
self.setCountryFlag(countryCode: defaultExchangeRate.countryCode ?? "")
self.setCurrencyLabel(currency: defaultExchangeRate.currency ?? "")
// set the default amount for this country. there are some default values in CountryInfo
self.selectedExchageRateModel = defaultExchangeRate
self.collectionView.reloadData()
showPaymentModeView()
self.populateDefaultAmounts()
}
} else {
self.setDefaultValuesForCountriesNotHavingDefaultValue()
showPaymentModeView()
}
*/
guard let _ = CountryInfo().defaultCountryCodes.filter({$0.lowercased() == (self.selectedExchageRateModel?.countryCode ?? "").lowercased()}).first else {
self.setDefaultValuesForCountriesNotHavingDefaultValueAfterCountrySelection()
return
}
if let recievingAmount = CountryInfo().getDefaultSendingAmount(for: selectedExchageRateModel?.countryCode ?? "") {
if CountryInfo().doesCountryCodeHasDefined(country: exchangeModel.countryCode ?? "", currency: exchangeModel.currency ?? "") {
if let recievingCurrency = CountryInfo().getDefaultSendingCurrency(for: exchangeModel.countryCode ?? "")
@ -329,7 +355,22 @@ class ExchangeRatesViewController: UIViewController {
}
private func setDefaultValuesForCountriesNotHavingDefaultValue() {
private func setDefaultValuesForCountriesNotHavingDefaultValueAfterCountrySelection() {
// self.selectedExchageRateModel = self.exchangeRateModels?.first
let senderAmount = CountryInfo().getDefaultSendingMoneyInKoreanWon()
self.senderTextField.text = Utility.getCommaSeperatedStringWithDecimal(numberString: senderAmount ?? "")
let senderCurrency = "KWR"
let recieverCurrency = self.selectedExchageRateModel?.currency
let recieverCountryId = self.selectedExchageRateModel?.countryId
let paymentMethod = self.selectedExchageRateModel?.availableServices?.elementAt(index: selectedPaymentIndex.row)
let reciepientCountryName = self.selectedExchageRateModel?.country ?? ""
let calcBy = "c"
let senderCountryName = "KOREA"
self.calculate(senderAmt: senderAmount, senderCurrency: senderCurrency, recieverAmt: nil, recieverCurrency: recieverCurrency, recieverCountryName: reciepientCountryName, recieverCountryId: recieverCountryId, paymentMethod: paymentMethod?.id, calcBy: calcBy, shouldShowLoading: false)
}
private func setDefaultValuesForCountriesNotHavingDefaultValueFirsttime() {
self.selectedExchageRateModel = self.exchangeRateModels?.first
let senderAmount = CountryInfo().getDefaultSendingMoneyInKoreanWon()
self.senderTextField.text = Utility.getCommaSeperatedStringWithDecimal(numberString: senderAmount ?? "")

35
GMERemittance/_Home/_Home.storyboard

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="8fJ-Pa-ik8">
<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="8fJ-Pa-ik8">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<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>
@ -1558,7 +1558,7 @@
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Nsx-vg-leO">
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r2N-Br-Xar">
<rect key="frame" x="0.0" y="0.0" width="375" height="116"/>
@ -1578,33 +1578,33 @@
<rect key="frame" x="105.5" y="148.5" width="164" height="69"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yzM-dm-RaX">
<rect key="frame" x="34" y="245.5" width="307" height="140"/>
<rect key="frame" x="34" y="245.5" width="307" height="129"/>
<string key="text">We are licensed by Ministry of Strategy &amp; Finance to operate as the first Non-Bank Remittance Service providers in South Korea. Meeting all compliance regulations set forward by the regulators was a tough journey but today we feel proud about what we have achieved and how robust our operations are as a result of the hard work completed earlier. We are now ready with a 100% compliant and secured system that guarantees your money will arrive safely in right hands every single time.</string>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U5C-wr-wOP" userLabel="Border">
<rect key="frame" x="0.0" y="406" width="375" height="0.5"/>
<rect key="frame" x="0.0" y="395" width="375" height="0.5"/>
<color key="backgroundColor" red="0.78431372549019607" green="0.7803921568627451" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="fjE-Zn-57C"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="App Version" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hwz-3v-OeA">
<rect key="frame" x="34" y="419.5" width="84" height="14"/>
<rect key="frame" x="34" y="408.5" width="84" height="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="12"/>
<color key="textColor" red="0.92549019607843142" green="0.10980392156862745" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1.0.1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QUF-Ty-ZUz">
<rect key="frame" x="34" y="440.5" width="84" height="14"/>
<rect key="frame" x="34" y="429.5" width="84" height="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iGc-ym-o0t" userLabel="Border">
<rect key="frame" x="0.0" y="478" width="375" height="0.5"/>
<rect key="frame" x="0.0" y="467" width="375" height="0.5"/>
<color key="backgroundColor" red="0.7843137255" green="0.78039215689999997" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="0.5" id="Hsd-YX-SlO"/>
@ -1612,13 +1612,13 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Follow us on" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gLa-zv-E4X">
<rect key="frame" x="34" y="489.5" width="84" height="14"/>
<rect key="frame" x="34" y="478.5" width="84" height="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="12"/>
<color key="textColor" red="0.92549019607843142" green="0.10980392156862745" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mGa-9R-111">
<rect key="frame" x="240" y="437.5" width="117" height="25"/>
<rect key="frame" x="240" y="426.5" width="117" height="25"/>
<color key="backgroundColor" red="0.90588235294117647" green="0.92941176470588238" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="OXu-a3-lux"/>
@ -1638,14 +1638,14 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6s2-2Y-UWG">
<rect key="frame" x="34" y="514.5" width="25" height="25"/>
<rect key="frame" x="34" y="503.5" width="25" height="25"/>
<state key="normal" image="settingsFacebook"/>
<connections>
<action selector="openFacebook:" destination="klE-Na-LMr" eventType="touchUpInside" id="9VB-y9-tAE"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="D1w-nM-BV3">
<rect key="frame" x="65.5" y="514.5" width="25" height="25"/>
<rect key="frame" x="65.5" y="503.5" width="25" height="25"/>
<state key="normal" image="settingsLinkedin"/>
<connections>
<action selector="openLinkedIn:" destination="klE-Na-LMr" eventType="touchUpInside" id="ZLa-M4-Ed4"/>
@ -1689,18 +1689,17 @@
<constraints>
<constraint firstItem="Nsx-vg-leO" firstAttribute="leading" secondItem="aCO-XK-hLy" secondAttribute="leading" id="0ZA-Sy-41V"/>
<constraint firstAttribute="bottom" secondItem="Nsx-vg-leO" secondAttribute="bottom" id="R1H-ME-n2O"/>
<constraint firstItem="Nsx-vg-leO" firstAttribute="height" secondItem="aCO-XK-hLy" secondAttribute="height" id="Rib-SR-GhF"/>
<constraint firstAttribute="trailing" secondItem="Nsx-vg-leO" secondAttribute="trailing" id="Ttk-cg-iXv"/>
<constraint firstItem="Nsx-vg-leO" firstAttribute="top" secondItem="aCO-XK-hLy" secondAttribute="top" id="fqJ-SJ-562"/>
<constraint firstItem="Nsx-vg-leO" firstAttribute="width" secondItem="aCO-XK-hLy" secondAttribute="width" id="ztV-uf-hwj"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="aCO-XK-hLy" firstAttribute="top" secondItem="5hX-ff-mE5" secondAttribute="top" id="3ko-nl-9Vr"/>
<constraint firstItem="Nsx-vg-leO" firstAttribute="width" secondItem="dBi-kH-CVB" secondAttribute="width" id="KSh-pA-892"/>
<constraint firstItem="Nsx-vg-leO" firstAttribute="height" secondItem="dBi-kH-CVB" secondAttribute="height" priority="250" id="c4w-yG-Dp0"/>
<constraint firstItem="aCO-XK-hLy" firstAttribute="leading" secondItem="5hX-ff-mE5" secondAttribute="leading" id="kIM-M2-S1z"/>
<constraint firstItem="aCO-XK-hLy" firstAttribute="width" secondItem="dBi-kH-CVB" secondAttribute="width" id="pNO-TK-4y7"/>
<constraint firstItem="5hX-ff-mE5" firstAttribute="bottom" secondItem="aCO-XK-hLy" secondAttribute="bottom" id="ptQ-4D-o9V"/>
<constraint firstItem="5hX-ff-mE5" firstAttribute="trailing" secondItem="aCO-XK-hLy" secondAttribute="trailing" id="rF9-Df-Cwp"/>
</constraints>
@ -1772,7 +1771,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2mins" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0EH-X8-aNW">
<rect key="frame" x="321" y="21" width="34" height="17"/>
<rect key="frame" x="322.5" y="21" width="32.5" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="YKo-4d-R2g"/>
</constraints>
@ -1822,7 +1821,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x2Q-k4-CnY">
<rect key="frame" x="44" y="349" width="47" height="13"/>
<rect key="frame" x="44" y="349" width="53" height="13"/>
<constraints>
<constraint firstAttribute="height" constant="13" id="GVA-JU-K08"/>
</constraints>
@ -1832,7 +1831,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KIV-Lo-m2o">
<rect key="frame" x="106" y="347" width="99" height="17"/>
<rect key="frame" x="112" y="347" width="105" height="17"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<state key="normal" title=" 3 Comments" image="ic_comments">
<color key="titleColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>

Loading…
Cancel
Save