Browse Source

adde branch picker

pull/1/head
gme_2 6 years ago
parent
commit
b3083d07c3
  1. 20
      GMERemittance.xcodeproj/project.pbxproj
  2. 267
      GMERemittance/Library/BankBranchPicker/BankBranchPicker.storyboard
  3. 27
      GMERemittance/Library/BankBranchPicker/BankBranchPickerCell.swift
  4. 187
      GMERemittance/Library/BankBranchPicker/BankBranchPickerViewController.swift
  5. 4
      GMERemittance/Model/SendMoneyPaymentModeModel.swift
  6. 18
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift

20
GMERemittance.xcodeproj/project.pbxproj

@ -222,6 +222,9 @@
A2FD3AEF2052568900404EA9 /* NotificationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2FD3AEE2052568900404EA9 /* NotificationViewModel.swift */; };
D907AB9B212AA96A00915A87 /* ExchangeRateViewControllerV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = D907AB9A212AA96A00915A87 /* ExchangeRateViewControllerV2.swift */; };
D907AB9D212AA97500915A87 /* ExchangeRate.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D907AB9C212AA97500915A87 /* ExchangeRate.storyboard */; };
D90A9D5A2136942300A96E45 /* BankBranchPickerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90A9D572136942300A96E45 /* BankBranchPickerCell.swift */; };
D90A9D5B2136942300A96E45 /* BankBranchPicker.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D90A9D582136942300A96E45 /* BankBranchPicker.storyboard */; };
D90A9D5C2136942300A96E45 /* BankBranchPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90A9D592136942300A96E45 /* BankBranchPickerViewController.swift */; };
D90D55B121326DA800EEEE04 /* Reciepient.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90D55B021326DA800EEEE04 /* Reciepient.swift */; };
D90D55B3213270DD00EEEE04 /* ReciepientServcie.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90D55B2213270DD00EEEE04 /* ReciepientServcie.swift */; };
D90D55CB21327CD600EEEE04 /* AddReciepientModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90D55B821327CD600EEEE04 /* AddReciepientModuleInterface.swift */; };
@ -598,6 +601,9 @@
D4CDE25CCDD693C2B892BB26 /* Pods-GMERemittanceUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMERemittanceUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GMERemittanceUITests/Pods-GMERemittanceUITests.debug.xcconfig"; sourceTree = "<group>"; };
D907AB9A212AA96A00915A87 /* ExchangeRateViewControllerV2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateViewControllerV2.swift; sourceTree = "<group>"; };
D907AB9C212AA97500915A87 /* ExchangeRate.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = ExchangeRate.storyboard; sourceTree = "<group>"; };
D90A9D572136942300A96E45 /* BankBranchPickerCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BankBranchPickerCell.swift; sourceTree = "<group>"; };
D90A9D582136942300A96E45 /* BankBranchPicker.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = BankBranchPicker.storyboard; sourceTree = "<group>"; };
D90A9D592136942300A96E45 /* BankBranchPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BankBranchPickerViewController.swift; sourceTree = "<group>"; };
D90D55B021326DA800EEEE04 /* Reciepient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reciepient.swift; sourceTree = "<group>"; };
D90D55B2213270DD00EEEE04 /* ReciepientServcie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReciepientServcie.swift; sourceTree = "<group>"; };
D90D55B821327CD600EEEE04 /* AddReciepientModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddReciepientModuleInterface.swift; sourceTree = "<group>"; };
@ -1264,6 +1270,16 @@
path = Module;
sourceTree = "<group>";
};
D90A9D562136942300A96E45 /* BankBranchPicker */ = {
isa = PBXGroup;
children = (
D90A9D572136942300A96E45 /* BankBranchPickerCell.swift */,
D90A9D582136942300A96E45 /* BankBranchPicker.storyboard */,
D90A9D592136942300A96E45 /* BankBranchPickerViewController.swift */,
);
path = BankBranchPicker;
sourceTree = "<group>";
};
D90D55B621327CD600EEEE04 /* AddReciepient */ = {
isa = PBXGroup;
children = (
@ -1908,6 +1924,7 @@
D96222FF212BD5E700B7A115 /* Library */ = {
isa = PBXGroup;
children = (
D90A9D562136942300A96E45 /* BankBranchPicker */,
D9CB49812132A58C00B7A124 /* ItemPickerView */,
D9CB497A21329DCE00B7A124 /* CountryWithFlagPicker */,
D9622302212BD62F00B7A115 /* CountryWithCurrencyPicker */,
@ -2244,6 +2261,7 @@
D9CB49852132A5F500B7A124 /* ItemsPicker.storyboard in Resources */,
04C6F2402025AF710055B083 /* WalletTransfer.storyboard in Resources */,
A25743B220243E6300727D1F /* Agent.storyboard in Resources */,
D90A9D5B2136942300A96E45 /* BankBranchPicker.storyboard in Resources */,
D90D55D321327CD600EEEE04 /* AddReciepient.storyboard in Resources */,
5565FF2D1FE275E5002934E9 /* SanFranciscoText-MediumItalic.otf in Resources */,
D922D9492135124200D43053 /* SendMoneyPaymentMode.storyboard in Resources */,
@ -2631,6 +2649,7 @@
04B51003206B6E3100B28DFF /* Like.swift in Sources */,
9F02058F20171BBF00F7AE23 /* KYCenum.swift in Sources */,
A248EA882088855B008D28DF /* Currrency.swift in Sources */,
D90A9D5A2136942300A96E45 /* BankBranchPickerCell.swift in Sources */,
04F6C2E820108EAB00C59431 /* PaymentMethodViewModel.swift in Sources */,
55A1FBAD1FDE4D7D00E8D94D /* TransactionCollectionViewCell.swift in Sources */,
D90D55CD21327CD600EEEE04 /* AddReciepientService.swift in Sources */,
@ -2753,6 +2772,7 @@
0428DC6A204910F9008355D7 /* WalletTransactionListViewController.swift in Sources */,
049E61A51FF0AE9D00817C76 /* UrlManager.swift in Sources */,
A25CF60B2046A92C0029BC12 /* ReferringViewController.swift in Sources */,
D90A9D5C2136942300A96E45 /* BankBranchPickerViewController.swift in Sources */,
04B67E9020469ACC000A4248 /* WalletViewModel.swift in Sources */,
D922D9682135145F00D43053 /* SendMoneyParentWireframe.swift in Sources */,
D922D9A821351B7400D43053 /* SendMoneyVerificationModuleInterface.swift in Sources */,

267
GMERemittance/Library/BankBranchPicker/BankBranchPicker.storyboard

@ -0,0 +1,267 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<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">
<array key="Roboto-Medium.ttf">
<string>Roboto-Medium</string>
</array>
<array key="Roboto-MediumItalic.ttf">
<string>Roboto-MediumItalic</string>
</array>
<array key="Roboto-Regular.ttf">
<string>Roboto-Regular</string>
</array>
<array key="SanFranciscoDisplay-Regular.otf">
<string>SanFranciscoDisplay-Regular</string>
</array>
<array key="SanFranciscoDisplay-Semibold.otf">
<string>SanFranciscoDisplay-Semibold</string>
</array>
</customFonts>
<scenes>
<!--Bank Branch Picker View Controller-->
<scene sceneID="fQh-nB-UZK">
<objects>
<viewController storyboardIdentifier="BankBranchPickerViewController" modalTransitionStyle="crossDissolve" modalPresentationStyle="overCurrentContext" id="EJZ-in-h7S" customClass="BankBranchPickerViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Rlr-lh-F8G">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="place not found" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bAs-K2-xyK">
<rect key="frame" x="0.0" y="323.5" width="375" height="20"/>
<fontDescription key="fontDescription" name="Roboto-MediumItalic" family="Roboto" pointSize="17"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hQv-gh-5cz" userLabel="TransparentView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IA2-r7-puo" userLabel="mainView">
<rect key="frame" x="20" y="70" width="335" height="527"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="lkk-y6-gJJ">
<rect key="frame" x="0.0" y="0.0" width="335" height="105.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bm0-Pj-YxX">
<rect key="frame" x="0.0" y="0.0" width="335" height="60"/>
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="0.79871808980000003" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="WcF-Hh-xnF"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hah-kn-87h">
<rect key="frame" x="0.0" y="60" width="335" height="0.5"/>
<color key="backgroundColor" red="0.6705882353" green="0.6705882353" blue="0.6705882353" alpha="0.50572183100000001" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="nKh-k3-LLR"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lpT-m6-5uw">
<rect key="frame" x="0.0" y="60.5" width="335" height="45"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_search" translatesAutoresizingMaskIntoConstraints="NO" id="RIp-kl-uTl">
<rect key="frame" x="0.0" y="0.0" width="40" height="45"/>
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="0.79871808980000003" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="wa4-T1-Y7p"/>
</constraints>
</imageView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Search Country" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Sm6-Yq-rdj" customClass="TextfieldWithSearchIcon" customModule="GMERemittance" customModuleProvider="target">
<rect key="frame" x="40" y="0.0" width="295" height="45"/>
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="0.79871808980000003" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="fPa-KH-52C"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="0.98431372549999996" green="0.98431372549999996" blue="0.98431372549999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</stackView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="hah-kn-87h" secondAttribute="trailing" id="EHx-ff-Z0x"/>
<constraint firstItem="hah-kn-87h" firstAttribute="leading" secondItem="lkk-y6-gJJ" secondAttribute="leading" id="wHZ-GG-RsQ"/>
</constraints>
</stackView>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lZH-8y-Kpf">
<rect key="frame" x="275" y="17.5" width="45" height="29"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="45" id="RUk-Le-ljR"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="14"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Cancel">
<color key="titleColor" red="0.92941176469999998" green="0.1137254902" blue="0.1960784314" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="dismiss:" destination="EJZ-in-h7S" eventType="touchUpInside" id="Rze-aG-qRg"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="asdfasdfasdf" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f7w-QD-1S6">
<rect key="frame" x="115" y="22" width="104.5" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Obx-V3-8rY"/>
</constraints>
<fontDescription key="fontDescription" name="Roboto-Medium" family="Roboto" pointSize="18"/>
<color key="textColor" white="0.3302840011" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" allowsMultipleSelection="YES" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="obU-jk-2i1">
<rect key="frame" x="10" y="105.5" width="315" height="411.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" red="0.87450980389999999" green="0.87450980389999999" blue="0.87450980389999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="BankBranchPickerCell" rowHeight="44" id="Kgd-VJ-6TX" customClass="BankBranchPickerCell" customModule="GMERemittance" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="315" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Kgd-VJ-6TX" id="0jM-Ad-6f3">
<rect key="frame" x="0.0" y="0.0" width="315" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MFk-fP-iQc">
<rect key="frame" x="5" y="5" width="305" height="33"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5cS-2x-QvM">
<rect key="frame" x="40" y="10" width="207" height="14"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="12"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="b4b-um-EnV">
<rect key="frame" x="10" y="1.5" width="30" height="30"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="QnX-N3-4x3"/>
<constraint firstAttribute="width" secondItem="b4b-um-EnV" secondAttribute="height" multiplier="1:1" id="V84-d1-TfH"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="right" translatesAutoresizingMaskIntoConstraints="NO" id="rPa-1k-gJU">
<rect key="frame" x="273" y="6" width="20" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="rPa-1k-gJU" secondAttribute="height" multiplier="1:1" id="JYr-fo-b5x"/>
<constraint firstAttribute="height" constant="20" id="w59-yu-f68"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="rPa-1k-gJU" firstAttribute="leading" secondItem="5cS-2x-QvM" secondAttribute="trailing" constant="26" id="C06-iz-fRk"/>
<constraint firstItem="b4b-um-EnV" firstAttribute="centerY" secondItem="MFk-fP-iQc" secondAttribute="centerY" id="NLb-Wv-sAJ"/>
<constraint firstAttribute="trailing" secondItem="rPa-1k-gJU" secondAttribute="trailing" constant="12" id="VG0-Yr-VXv"/>
<constraint firstItem="rPa-1k-gJU" firstAttribute="centerY" secondItem="MFk-fP-iQc" secondAttribute="centerY" id="XtN-jq-ED1"/>
<constraint firstAttribute="trailing" secondItem="5cS-2x-QvM" secondAttribute="trailing" constant="58" id="ase-2S-6o7"/>
<constraint firstItem="5cS-2x-QvM" firstAttribute="centerY" secondItem="MFk-fP-iQc" secondAttribute="centerY" id="bTT-cT-CMG"/>
<constraint firstItem="b4b-um-EnV" firstAttribute="leading" secondItem="MFk-fP-iQc" secondAttribute="leading" constant="10" id="jDy-BW-tH9"/>
<constraint firstItem="5cS-2x-QvM" firstAttribute="leading" secondItem="b4b-um-EnV" secondAttribute="trailing" id="xfa-gL-5vd"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aVs-jg-plT" userLabel="Seperator">
<rect key="frame" x="0.0" y="37.5" width="315" height="0.5"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="QQL-55-X5Y"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="MFk-fP-iQc" firstAttribute="top" secondItem="0jM-Ad-6f3" secondAttribute="top" constant="5" id="7oP-HX-Fsv"/>
<constraint firstAttribute="trailing" secondItem="MFk-fP-iQc" secondAttribute="trailing" constant="5" id="BZb-qr-aGc"/>
<constraint firstAttribute="bottom" secondItem="MFk-fP-iQc" secondAttribute="bottom" constant="5" id="LyB-cE-ccu"/>
<constraint firstItem="aVs-jg-plT" firstAttribute="bottom" secondItem="MFk-fP-iQc" secondAttribute="bottom" id="ThW-Jc-kGf"/>
<constraint firstAttribute="trailing" secondItem="aVs-jg-plT" secondAttribute="trailing" id="a8T-2p-hft"/>
<constraint firstItem="MFk-fP-iQc" firstAttribute="leading" secondItem="0jM-Ad-6f3" secondAttribute="leading" constant="5" id="mGH-au-GWh"/>
<constraint firstItem="aVs-jg-plT" firstAttribute="leading" secondItem="0jM-Ad-6f3" secondAttribute="leading" id="qs2-FG-Bbq"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="backgroundview" destination="MFk-fP-iQc" id="VaJ-oM-XBg"/>
<outlet property="checkImageView" destination="rPa-1k-gJU" id="pTP-Qk-k5L"/>
<outlet property="titleLabel" destination="5cS-2x-QvM" id="dpA-oh-Nl2"/>
</connections>
</tableViewCell>
</prototypes>
</tableView>
</subviews>
<color key="backgroundColor" red="0.88235294119999996" green="0.87843137250000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="lkk-y6-gJJ" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" id="5FA-LB-Q71"/>
<constraint firstItem="f7w-QD-1S6" firstAttribute="centerX" secondItem="IA2-r7-puo" secondAttribute="centerX" id="IRs-zV-DHA"/>
<constraint firstItem="f7w-QD-1S6" firstAttribute="top" secondItem="IA2-r7-puo" secondAttribute="top" constant="22" id="J8R-O6-yV8"/>
<constraint firstItem="lkk-y6-gJJ" firstAttribute="top" secondItem="IA2-r7-puo" secondAttribute="top" id="ZEX-3U-QRk"/>
<constraint firstAttribute="trailing" secondItem="lZH-8y-Kpf" secondAttribute="trailing" constant="15" id="fbR-kl-ISb"/>
<constraint firstAttribute="trailing" secondItem="obU-jk-2i1" secondAttribute="trailing" constant="10" id="fcb-KT-6ii"/>
<constraint firstAttribute="bottom" secondItem="obU-jk-2i1" secondAttribute="bottom" constant="10" id="gjN-Yr-Dik"/>
<constraint firstAttribute="trailing" secondItem="lkk-y6-gJJ" secondAttribute="trailing" id="oFQ-bh-wjl"/>
<constraint firstItem="f7w-QD-1S6" firstAttribute="centerY" secondItem="lZH-8y-Kpf" secondAttribute="centerY" id="oaj-9h-cB9"/>
<constraint firstItem="obU-jk-2i1" firstAttribute="top" secondItem="lkk-y6-gJJ" secondAttribute="bottom" id="v3x-x4-RF1"/>
<constraint firstItem="obU-jk-2i1" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" constant="10" id="z8z-Va-R7X"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.40484705110000002" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="IA2-r7-puo" firstAttribute="top" secondItem="hQv-gh-5cz" secondAttribute="top" constant="70" id="BI3-YV-Naw"/>
<constraint firstItem="IA2-r7-puo" firstAttribute="leading" secondItem="hQv-gh-5cz" secondAttribute="leading" constant="20" id="DDG-4u-4Ym"/>
<constraint firstAttribute="bottom" secondItem="IA2-r7-puo" secondAttribute="bottom" constant="40" id="FHh-MW-1cn"/>
<constraint firstAttribute="trailing" secondItem="IA2-r7-puo" secondAttribute="trailing" constant="20" id="FfM-Rd-OpC"/>
<constraint firstAttribute="bottom" secondItem="IA2-r7-puo" secondAttribute="bottom" constant="70" id="Lqm-n6-fpp"/>
<constraint firstItem="IA2-r7-puo" firstAttribute="top" secondItem="hQv-gh-5cz" secondAttribute="top" constant="60" id="rMj-w7-4aj"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="FHh-MW-1cn"/>
<exclude reference="rMj-w7-4aj"/>
</mask>
</variation>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="hQv-gh-5cz" secondAttribute="bottom" id="3gM-oq-O8p"/>
<constraint firstItem="hQv-gh-5cz" firstAttribute="top" secondItem="Rlr-lh-F8G" secondAttribute="top" id="8u0-1y-dcj"/>
<constraint firstItem="bAs-K2-xyK" firstAttribute="trailing" secondItem="3CD-ye-gKy" secondAttribute="trailing" id="OYH-bn-b4k"/>
<constraint firstItem="hQv-gh-5cz" firstAttribute="leading" secondItem="3CD-ye-gKy" secondAttribute="leading" id="abs-En-hsM"/>
<constraint firstItem="bAs-K2-xyK" firstAttribute="centerY" secondItem="Rlr-lh-F8G" secondAttribute="centerY" id="qDP-N5-lbK"/>
<constraint firstItem="bAs-K2-xyK" firstAttribute="leading" secondItem="3CD-ye-gKy" secondAttribute="leading" id="w73-Rr-lJO"/>
<constraint firstItem="3CD-ye-gKy" firstAttribute="trailing" secondItem="hQv-gh-5cz" secondAttribute="trailing" id="wal-tc-Lh1"/>
</constraints>
<viewLayoutGuide key="safeArea" id="3CD-ye-gKy"/>
</view>
<connections>
<outlet property="mainview" destination="IA2-r7-puo" id="pHW-C8-CNR"/>
<outlet property="noResultFoundLabel" destination="bAs-K2-xyK" id="JiR-4m-mFb"/>
<outlet property="searchTextField" destination="Sm6-Yq-rdj" id="trG-eX-b0i"/>
<outlet property="tableVIew" destination="obU-jk-2i1" id="3LK-wI-BB5"/>
<outlet property="titleLabel" destination="f7w-QD-1S6" id="TdZ-Kd-z01"/>
<outlet property="titleView" destination="Bm0-Pj-YxX" id="flR-tz-rrg"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Alb-it-7Ew" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1069.5999999999999" y="-146.17691154422789"/>
</scene>
</scenes>
<resources>
<image name="ic_search" width="14" height="14"/>
<image name="right" width="22" height="22"/>
</resources>
</document>

27
GMERemittance/Library/BankBranchPicker/BankBranchPickerCell.swift

@ -0,0 +1,27 @@
//
// TableViewPickerCell.swift
// Sipradi
//
// Created by shishir sapkota on 7/25/17.
// Copyright © 2017 Ekbana. All rights reserved.
//
import UIKit
class BankBranchPickerCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var checkImageView: UIImageView!
var selectedPlace: String?
var place: String?
@IBOutlet weak var backgroundview: UIView!
func setup() {
self.backgroundview.layer.cornerRadius = 8.0
self.titleLabel.text = place
self.checkImageView.isHidden = true
}
}

187
GMERemittance/Library/BankBranchPicker/BankBranchPickerViewController.swift

@ -0,0 +1,187 @@
//
// ItemsPickerViewController.swift
// Sipradi
//
// Created by shishir sapkota on 7/25/17.
// Copyright © 2017 Ekbana. All rights reserved.
//
import UIKit
class BankBranchPickerViewController: UIViewController {
struct Constants {
static let seperatorColor = "#DFDFDF"
static let tintColor = UIColor.red
static let gradientviewLeftColor = UIColor.init(hex: "#FF0000")
static let gradientviewRightColor = UIColor.init(hex: "#9C272D")
}
@IBOutlet weak var titleView: UIView!
@IBOutlet weak var tableVIew: UITableView!
@IBOutlet weak var searchTextField: UITextField!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var noResultFoundLabel: UILabel!
@IBOutlet weak var mainview: UIView!
var data: [SendMoneyBankBranch] = []
var filteredPlaces: [SendMoneyBankBranch] = [] {
didSet {
self.tableVIew.reloadData()
self.setNoResultText()
self.filteredPlaces.isEmpty ? (self.noResultFoundLabel.isHidden = false) : (self.noResultFoundLabel.isHidden = true)
}
}
var allowMultipleSelection = false
var allowSelection = true
var doneAction: (([SendMoneyBankBranch]) -> ())?
var defaultSelectedData: [SendMoneyBankBranch?] = []
var searchText = ""
var type: PickerTitle?
override func viewDidLoad() {
super.viewDidLoad()
self.setupTableView()
self.setupSearchService()
// self.setupSearchTextFieldUi()
self.setupPlaces()
self.titleView.layer.cornerRadius = 10
self.mainview.layer.cornerRadius = 10
setTitle()
}
private func setNoResultText() {
var text = ""
if let type = self.type {
text = "No matching \(type.rawValue) found for "
} else {
text = "No matching result found for "
}
self.noResultFoundLabel.text = text + "'\(searchText)'"
}
private func setTitle() {
self.titleLabel.text = "Select " + (self.type?.rawValue ?? "Location").capitalized
}
private func setupPlaces() {
self.filteredPlaces = self.data
}
private func setupTableView() {
self.tableVIew.delegate = self
self.tableVIew.dataSource = self
self.tableVIew.separatorColor = UIColor.init(hex: Constants.seperatorColor)
self.tableVIew.allowsMultipleSelection = self.allowMultipleSelection
self.tableVIew.allowsSelection = self.allowSelection
}
private func setupSearchTextFieldUi() {
// #imageLiteral(resourceName: "ic_search")
let searchIconImageView = UIImageView(image: #imageLiteral(resourceName: "ic_search"))
searchIconImageView.tintColor = Constants.tintColor
self.searchTextField.leftView = searchIconImageView
self.searchTextField.leftViewMode = .always
}
private func setupSearchService() {
self.searchTextField.addTarget(self, action: #selector(self.search(sender:)), for: UIControlEvents.editingChanged)
}
@objc private func search(sender: UITextField) {
let searchString = sender.text!
self.searchText = searchString
if searchString.isEmpty {
self.filteredPlaces = self.data
return
}
print("searchString : \(searchString), \(filteredPlaces)")
self.filteredPlaces = self.data.filter({
return searchString.isEmpty ||
($0.name ?? "").lowercased().contains(searchString.lowercased())
}).sorted(by: { (a, _) -> Bool in
return ((a.name ?? "").lowercased() ?? "").hasPrefix(searchString.lowercased())
})
print("after search")
print(filteredPlaces)
}
// MARK: IBActions
@IBAction func close(_ sender: Any?) {
// let selectedIndexPaths = self.tableVIew.indexPathsForSelectedRows ?? self.tableVIew.indexPathForSelectedRow.map({[$0]})
// let selectedData = selectedIndexPaths?.flatMap { indexPath -> String? in
// let value = data[indexPath.row]
// return value
// }
// self.doneAction?(selectedData ?? [])
// self.dismiss(animated: true, completion: nil)
}
@IBAction func dismiss(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
@IBAction func clear(_ sender: Any) {
self.tableVIew.indexPathsForSelectedRows?.forEach({self.tableVIew.deselectRow(at: $0, animated: true)})
self.tableVIew.indexPathForSelectedRow.map({self.tableVIew.deselectRow(at: $0, animated: true)})
self.defaultSelectedData = []
self.tableVIew.reloadData()
}
}
extension BankBranchPickerViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 75
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
cell?.accessoryType = .checkmark
if !self.allowMultipleSelection {
self.close(nil)
}
}
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
cell?.accessoryType = .none
}
}
extension BankBranchPickerViewController: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return filteredPlaces.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableVIew.dequeueReusableCell(withIdentifier: "BankBranchPickerCell", for: indexPath) as! BankBranchPickerCell
cell.place = self.filteredPlaces.elementAt(index: indexPath.row)?.name
// if let selected = self.defaultSelectedData.first {
// cell.selectedPlace = selected
// }
cell.setup()
return cell
}
}

4
GMERemittance/Model/SendMoneyPaymentModeModel.swift

@ -54,6 +54,7 @@ class SendMoneyPayoutMode: Mappable {
var payCurrency: [String]?
var bankRequired: String?
var bankList: [SendMoneyBank]?
required init?(map: Map) {
}
@ -61,10 +62,11 @@ class SendMoneyPayoutMode: Mappable {
func mapping(map: Map) {
id <- map["Id"]
mode <- map["Mode"]
bankList <- map["BankList"]
payoutPartner <- map["PayoutPartner"]
payCurrency <- map["PayCurrency"]
bankRequired <- map["Bankrequired"]
bankList <- map["BankList"]
}
}

18
GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift

@ -90,6 +90,7 @@ class SendMoneyPaymentModeViewController: UIViewController {
// MARK: IBActions
@IBAction func _continue(_ sender: UIButton) {
self.actionDelegate?.continueToExchangeAction()
}
// MARK: Other Functions
@ -130,20 +131,17 @@ class SendMoneyPaymentModeViewController: UIViewController {
}
private func showBranchPickerView() {
let viewcontroller = self.getPickerViewController()
let viewcontroller = self.getBankBranchPickerViewController()
let branches = self.selectedBank?.branches ?? []
let names = branches.compactMap({$0.name})
viewcontroller.data = names
viewcontroller.data = branches
viewcontroller.type = PickerTitle.branch
viewcontroller.doneAction = self.branchSelected
viewcontroller.defaultSelectedData = [self.selectedBranch?.name ?? ""]
viewcontroller.defaultSelectedData = [self.selectedBranch]
self.present(viewcontroller, animated: true, completion: nil)
}
func branchSelected(branches: [String]) {
let _branches = self.selectedBank?.branches ?? []
let _branch = _branches.filter({($0.name ?? "") == (branches.first ?? "") }).first
self.selectedBranch = _branch
func branchSelected(branches: [SendMoneyBankBranch]) {
self.selectedBranch = branches.first
}
func bankSelected(banks: [String]) {
@ -155,6 +153,10 @@ class SendMoneyPaymentModeViewController: UIViewController {
private func getPickerViewController()-> ItemsPickerViewController {
return UIStoryboard.init(name: "ItemsPicker", bundle: nil).instantiateViewController(withIdentifier: "ItemsPickerViewController") as! ItemsPickerViewController
}
private func getBankBranchPickerViewController()-> BankBranchPickerViewController {
return UIStoryboard.init(name: "BankBranchPicker", bundle: nil).instantiateViewController(withIdentifier: "BankBranchPickerViewController") as! BankBranchPickerViewController
}
}
extension SendMoneyPaymentModeViewController: UICollectionViewDelegate {

Loading…
Cancel
Save