Browse Source

added hint label when count is less than three

pull/1/head
gme_2 6 years ago
parent
commit
a1bc5ea8f2
  1. 3
      GMERemittance/Module/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift
  2. 13
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPicker.storyboard
  3. 14
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPickerViewController.swift
  4. 1
      GMERemittance/Module/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift

3
GMERemittance/Module/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift

@ -125,14 +125,15 @@ class SendMoneyExchangeRateViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
self.action = ActionBehaviour.calculate
configureViews() configureViews()
self.action = ActionBehaviour.calculate
} }
// MARK: IBActions // MARK: IBActions
@IBAction func continueButton(_ sender: UIButton) { @IBAction func continueButton(_ sender: UIButton) {
self.view.endEditing(true)
if let _action = action { if let _action = action {
switch _action { switch _action {
case .calculate: case .calculate:

13
GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPicker.storyboard

@ -120,7 +120,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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"/>
<rect key="frame" x="10" y="105" width="315" height="411.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <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="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"/> <color key="separatorColor" red="0.87450980389999999" green="0.87450980389999999" blue="0.87450980389999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@ -200,19 +200,29 @@
</tableViewCell> </tableViewCell>
</prototypes> </prototypes>
</tableView> </tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="please type the name of your branch. Name should be at least 3 characters long." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J89-w4-XeB">
<rect key="frame" x="10" y="205.5" width="315" height="29"/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="12"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" red="0.88235294119999996" green="0.87843137250000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.88235294119999996" green="0.87843137250000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="J89-w4-XeB" firstAttribute="top" secondItem="lkk-y6-gJJ" secondAttribute="bottom" constant="100" id="2GC-Mz-yhS"/>
<constraint firstItem="lkk-y6-gJJ" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" id="5FA-LB-Q71"/> <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="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="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 firstItem="lkk-y6-gJJ" firstAttribute="top" secondItem="IA2-r7-puo" secondAttribute="top" id="ZEX-3U-QRk"/>
<constraint firstAttribute="trailing" secondItem="J89-w4-XeB" secondAttribute="trailing" constant="10" id="dix-UA-j0a"/>
<constraint firstAttribute="trailing" secondItem="lZH-8y-Kpf" secondAttribute="trailing" constant="15" id="fbR-kl-ISb"/> <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="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="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 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="f7w-QD-1S6" firstAttribute="centerY" secondItem="lZH-8y-Kpf" secondAttribute="centerY" id="oaj-9h-cB9"/>
<constraint firstItem="J89-w4-XeB" firstAttribute="centerX" secondItem="IA2-r7-puo" secondAttribute="centerX" id="sa8-Y8-Zv1"/>
<constraint firstItem="obU-jk-2i1" firstAttribute="top" secondItem="lkk-y6-gJJ" secondAttribute="bottom" id="v3x-x4-RF1"/> <constraint firstItem="obU-jk-2i1" firstAttribute="top" secondItem="lkk-y6-gJJ" secondAttribute="bottom" id="v3x-x4-RF1"/>
<constraint firstItem="J89-w4-XeB" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" constant="10" id="xYe-Uk-MEw"/>
<constraint firstItem="obU-jk-2i1" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" constant="10" id="z8z-Va-R7X"/> <constraint firstItem="obU-jk-2i1" firstAttribute="leading" secondItem="IA2-r7-puo" secondAttribute="leading" constant="10" id="z8z-Va-R7X"/>
</constraints> </constraints>
</view> </view>
@ -247,6 +257,7 @@
<viewLayoutGuide key="safeArea" id="3CD-ye-gKy"/> <viewLayoutGuide key="safeArea" id="3CD-ye-gKy"/>
</view> </view>
<connections> <connections>
<outlet property="infoLabel" destination="J89-w4-XeB" id="nsf-RO-XfY"/>
<outlet property="mainview" destination="IA2-r7-puo" id="pHW-C8-CNR"/> <outlet property="mainview" destination="IA2-r7-puo" id="pHW-C8-CNR"/>
<outlet property="noResultFoundLabel" destination="bAs-K2-xyK" id="JiR-4m-mFb"/> <outlet property="noResultFoundLabel" destination="bAs-K2-xyK" id="JiR-4m-mFb"/>
<outlet property="searchTextField" destination="Sm6-Yq-rdj" id="trG-eX-b0i"/> <outlet property="searchTextField" destination="Sm6-Yq-rdj" id="trG-eX-b0i"/>

14
GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/BankBranchPicker/BankBranchPickerViewController.swift

@ -25,6 +25,7 @@ class BankBranchPickerViewController: UIViewController {
@IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var noResultFoundLabel: UILabel! @IBOutlet weak var noResultFoundLabel: UILabel!
@IBOutlet weak var mainview: UIView! @IBOutlet weak var mainview: UIView!
@IBOutlet weak var infoLabel: UILabel!
var data: [SendMoneyBankBranch] = [] { var data: [SendMoneyBankBranch] = [] {
didSet { didSet {
@ -57,6 +58,7 @@ class BankBranchPickerViewController: UIViewController {
self.setupTableView() self.setupTableView()
self.setupSearchService() self.setupSearchService()
self.setupPlaces() self.setupPlaces()
self.setupTarget()
self.titleView.layer.cornerRadius = 10 self.titleView.layer.cornerRadius = 10
self.mainview.layer.cornerRadius = 10 self.mainview.layer.cornerRadius = 10
setTitle() setTitle()
@ -73,6 +75,15 @@ class BankBranchPickerViewController: UIViewController {
self.noResultFoundLabel.text = text + "'\(searchText)'" self.noResultFoundLabel.text = text + "'\(searchText)'"
} }
private func setupTarget() {
self.searchTextField.addTarget(self, action: #selector(self.textChanged(sender:)), for: UIControlEvents.editingChanged)
}
@objc private func textChanged(sender: UITextField) {
let text = sender.text!
self.infoLabel.isHidden = text.count >= 3
}
private func setTitle() { private func setTitle() {
self.titleLabel.text = "Select " + (self.type?.rawValue ?? "Location").capitalized self.titleLabel.text = "Select " + (self.type?.rawValue ?? "Location").capitalized
} }
@ -109,6 +120,7 @@ class BankBranchPickerViewController: UIViewController {
self.filteredPlaces = [] self.filteredPlaces = []
return return
} }
self.infoLabel.isHidden = true
let countryCode = self.countryCode ?? "" let countryCode = self.countryCode ?? ""
let bankId = self.bankId ?? "" let bankId = self.bankId ?? ""
self.fetchBranches(countryCode: countryCode, bankId: bankId, branchName: searchString) self.fetchBranches(countryCode: countryCode, bankId: bankId, branchName: searchString)
@ -182,3 +194,5 @@ extension BankBranchPickerViewController: FetchBankBranchService {
} }
} }
} }

1
GMERemittance/Module/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift

@ -60,6 +60,7 @@ class SendMoneyReceiptViewController: UIViewController {
// all setup should be done here // all setup should be done here
let button = UIBarButtonItem.init(title: nil, style: UIBarButtonItemStyle.plain, target: nil, action: nil) let button = UIBarButtonItem.init(title: nil, style: UIBarButtonItemStyle.plain, target: nil, action: nil)
self.navigationItem.leftBarButtonItem = button self.navigationItem.leftBarButtonItem = button
self.navigationItem.title = "Receipt"
} }
private func createMockModel() -> SendMoneyReciept { private func createMockModel() -> SendMoneyReciept {

Loading…
Cancel
Save