gme_2
6 years ago
6 changed files with 514 additions and 9 deletions
-
20GMERemittance.xcodeproj/project.pbxproj
-
267GMERemittance/Library/BankBranchPicker/BankBranchPicker.storyboard
-
27GMERemittance/Library/BankBranchPicker/BankBranchPickerCell.swift
-
187GMERemittance/Library/BankBranchPicker/BankBranchPickerViewController.swift
-
4GMERemittance/Model/SendMoneyPaymentModeModel.swift
-
18GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift
@ -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> |
@ -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 |
|||
} |
|||
} |
@ -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 |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue