added memo view

This commit is contained in:
loj 2019-02-09 11:40:59 +01:00
parent 46892f5725
commit 4f047d6a31
7 changed files with 253 additions and 7 deletions

View File

@ -73,7 +73,6 @@
EEBEBB7D2200E10B00A6BD18 /* ScanVCDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB7C2200E10B00A6BD18 /* ScanVCDelegate.swift */; };
EEBEBB7F2200E41D00A6BD18 /* Scan.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEBEBB7E2200E41D00A6BD18 /* Scan.storyboard */; };
EEBEBB812206F81F00A6BD18 /* Amount.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEBEBB802206F80300A6BD18 /* Amount.storyboard */; };
EEBEBB842206FB4D00A6BD18 /* AmountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB832206FB4D00A6BD18 /* AmountVC.swift */; };
EEBEBB862206FE1000A6BD18 /* AmountVCDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB852206FE1000A6BD18 /* AmountVCDelegate.swift */; };
EEBEBB882207061300A6BD18 /* String-Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB872207061300A6BD18 /* String-Extension.swift */; };
EEBEBB8B2207073900A6BD18 /* String-ExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB8A2207073900A6BD18 /* String-ExtensionTests.swift */; };
@ -83,6 +82,10 @@
EEBEBB9322073A4500A6BD18 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE377EC121E7DFD200138385 /* Constants.swift */; };
EEBEBB952207425500A6BD18 /* SendCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB942207425500A6BD18 /* SendCoordinator.swift */; };
EEBEBB972207477100A6BD18 /* SendCoordinatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB962207477100A6BD18 /* SendCoordinatorDelegate.swift */; };
EEBEBB9E2208D64C00A6BD18 /* AmountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB9D2208D64C00A6BD18 /* AmountVC.swift */; };
EEBEBBA02208D75600A6BD18 /* MemoVCDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB9F2208D66600A6BD18 /* MemoVCDelegate.swift */; };
EEBEBBA12208D75A00A6BD18 /* MemoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB9C2208D60100A6BD18 /* MemoVC.swift */; };
EEBEBBA22208D76200A6BD18 /* Memo.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEBEBB9A2208D4FD00A6BD18 /* Memo.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -168,13 +171,16 @@
EEBEBB7C2200E10B00A6BD18 /* ScanVCDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanVCDelegate.swift; sourceTree = "<group>"; };
EEBEBB7E2200E41D00A6BD18 /* Scan.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Scan.storyboard; sourceTree = "<group>"; };
EEBEBB802206F80300A6BD18 /* Amount.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Amount.storyboard; sourceTree = "<group>"; };
EEBEBB832206FB4D00A6BD18 /* AmountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmountVC.swift; sourceTree = "<group>"; };
EEBEBB852206FE1000A6BD18 /* AmountVCDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmountVCDelegate.swift; sourceTree = "<group>"; };
EEBEBB872207061300A6BD18 /* String-Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String-Extension.swift"; sourceTree = "<group>"; };
EEBEBB8A2207073900A6BD18 /* String-ExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String-ExtensionTests.swift"; sourceTree = "<group>"; };
EEBEBB912207290A00A6BD18 /* ZECTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZECTests.swift; sourceTree = "<group>"; };
EEBEBB942207425500A6BD18 /* SendCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendCoordinator.swift; sourceTree = "<group>"; };
EEBEBB962207477100A6BD18 /* SendCoordinatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendCoordinatorDelegate.swift; sourceTree = "<group>"; };
EEBEBB9A2208D4FD00A6BD18 /* Memo.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Memo.storyboard; sourceTree = "<group>"; };
EEBEBB9C2208D60100A6BD18 /* MemoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoVC.swift; sourceTree = "<group>"; };
EEBEBB9D2208D64C00A6BD18 /* AmountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmountVC.swift; sourceTree = "<group>"; };
EEBEBB9F2208D66600A6BD18 /* MemoVCDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoVCDelegate.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -365,6 +371,7 @@
EE76B84121D7EC3F0093571F /* Home.storyboard */,
EE57700621CFCC5600433CAB /* LaunchScreen.storyboard */,
EE57700121CFCC5500433CAB /* Main.storyboard */,
EEBEBB9A2208D4FD00A6BD18 /* Memo.storyboard */,
EE96916F21D561BE00BE1289 /* Passphrase.storyboard */,
EE57702C21D38A8200433CAB /* Pin.storyboard */,
EEBEBB7221FF8B6D00A6BD18 /* RecipientAddress.storyboard */,
@ -396,6 +403,7 @@
EEBEBB822206FB3200A6BD18 /* Amount */,
EE377ED021F47D5200138385 /* Home */,
EE07A44E21E217E0006031C8 /* Main */,
EEBEBB9B2208D5E700A6BD18 /* Memo */,
EE377EC321E8F44C00138385 /* Passphrase */,
EE377EBA21E68A6600138385 /* Pin */,
EEBEBB7321FF8D9C00A6BD18 /* RecipientAddress */,
@ -481,7 +489,7 @@
EEBEBB822206FB3200A6BD18 /* Amount */ = {
isa = PBXGroup;
children = (
EEBEBB832206FB4D00A6BD18 /* AmountVC.swift */,
EEBEBB9D2208D64C00A6BD18 /* AmountVC.swift */,
EEBEBB852206FE1000A6BD18 /* AmountVCDelegate.swift */,
);
path = Amount;
@ -503,6 +511,15 @@
path = Types;
sourceTree = "<group>";
};
EEBEBB9B2208D5E700A6BD18 /* Memo */ = {
isa = PBXGroup;
children = (
EEBEBB9C2208D60100A6BD18 /* MemoVC.swift */,
EEBEBB9F2208D66600A6BD18 /* MemoVCDelegate.swift */,
);
path = Memo;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -603,6 +620,7 @@
EE76B85F21D8D1930093571F /* SourceSansPro-Italic.ttf in Resources */,
EE76B85B21D8D1930093571F /* SourceSansPro-ExtraLight.ttf in Resources */,
EE76B85A21D8D1930093571F /* OFL.txt in Resources */,
EEBEBBA22208D76200A6BD18 /* Memo.storyboard in Resources */,
EE76B84221D7EC3F0093571F /* Home.storyboard in Resources */,
EE57700821CFCC5600433CAB /* LaunchScreen.storyboard in Resources */,
EEBEBB812206F81F00A6BD18 /* Amount.storyboard in Resources */,
@ -629,7 +647,6 @@
EEBEBB862206FE1000A6BD18 /* AmountVCDelegate.swift in Sources */,
EE377EE221F4F18700138385 /* TrxDirection.swift in Sources */,
EE07A46A21E29B6F006031C8 /* AppCoordinator.swift in Sources */,
EEBEBB842206FB4D00A6BD18 /* AmountVC.swift in Sources */,
EE07A45221E23E92006031C8 /* MainVCDelegate.swift in Sources */,
EE377EC521E8F47100138385 /* PassphraseVC.swift in Sources */,
EEBEBB952207425500A6BD18 /* SendCoordinator.swift in Sources */,
@ -643,6 +660,7 @@
EE377EED21F7B02600138385 /* TrxMemoTableViewCell.swift in Sources */,
EE57702921D0011400433CAB /* Colors.swift in Sources */,
EE377EE621F4F1C400138385 /* TrxHistoryObservable.swift in Sources */,
EEBEBBA02208D75600A6BD18 /* MemoVCDelegate.swift in Sources */,
EE377EE421F4F1A100138385 /* TrxDetails.swift in Sources */,
EE377ECB21E8F71700138385 /* PassphraseEntryMode.swift in Sources */,
EEBEBB882207061300A6BD18 /* String-Extension.swift in Sources */,
@ -663,6 +681,7 @@
EE377EBC21E68AB000138385 /* PinVC.swift in Sources */,
EE377EC221E7DFD200138385 /* Constants.swift in Sources */,
EE377EC921E8F67000138385 /* PassphraseVCDelegate.swift in Sources */,
EEBEBB9E2208D64C00A6BD18 /* AmountVC.swift in Sources */,
EE07A45721E26E88006031C8 /* IocContainer.swift in Sources */,
EE377EF121FDEE3F00138385 /* ZEC.swift in Sources */,
EEBEBB972207477100A6BD18 /* SendCoordinatorDelegate.swift in Sources */,
@ -671,6 +690,7 @@
EE377EBE21E68C0B00138385 /* PinVCDelegate.swift in Sources */,
EE57702F21D38BAD00433CAB /* ZWPinDotView.swift in Sources */,
EEBEBB7721FF91B700A6BD18 /* RecipientAddressDelegate.swift in Sources */,
EEBEBBA12208D75A00A6BD18 /* MemoVC.swift in Sources */,
EE07A45021E23E43006031C8 /* MainVC.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -19,6 +19,7 @@ internal protocol ViewFactoryProtocol {
func getRecipientAddressView() -> RecipientAddressVC
func getScanView() -> ScanVC
func getAmountView() -> AmountVC
func getMemoVC() -> MemoVC
}
@ -56,6 +57,10 @@ internal class ViewFactory: ViewFactoryProtocol {
return self.view(withName: "Amount", onStoryboard: "Amount")
}
func getMemoVC() -> MemoVC {
return self.view(withName: "Memo", onStoryboard: "Memo")
}
private func view<T>(withName viewName: String, onStoryboard storyboardName: String) -> T {
let sb = UIStoryboard(name: storyboardName, bundle: nil)
let vc = sb.instantiateViewController(withIdentifier: viewName) as! T

View File

@ -0,0 +1,123 @@
<?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">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<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="SourceSansPro-Bold.ttf">
<string>SourceSansPro-Bold</string>
</array>
<array key="SourceSansPro-Regular.ttf">
<string>SourceSansPro-Regular</string>
</array>
<array key="SourceSansPro-SemiBold.ttf">
<string>SourceSansPro-SemiBold</string>
</array>
</customFonts>
<scenes>
<!--MemoVC-->
<scene sceneID="5TK-63-Amy">
<objects>
<viewController storyboardIdentifier="Memo" id="M2V-hB-lEq" customClass="MemoVC" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="MfU-s3-T92">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wua-MI-GFO" customClass="ZWProgressBar" customModule="ZWallet" customModuleProvider="target">
<rect key="frame" x="24" y="124" width="366" height="16"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" notEnabled="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="height" constant="16" id="Wcl-zL-3Hh"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="totalSteps">
<integer key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="currentStep">
<integer key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="!!Memo" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r9g-U1-6GC">
<rect key="frame" x="24" y="172" width="366" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="TKL-j1-J2Y"/>
</constraints>
<fontDescription key="fontDescription" name="SourceSansPro-Bold" family="Source Sans Pro" pointSize="24"/>
<color key="textColor" red="0.2901675105" green="0.29021433000000002" blue="0.29015725850000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="!!Start typing" textAlignment="center" minimumFontSize="20" translatesAutoresizingMaskIntoConstraints="NO" id="miM-vD-sj4">
<rect key="frame" x="24" y="243" width="366" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="2tw-nU-SUI"/>
</constraints>
<color key="textColor" red="0.17999999999999999" green="0.16" blue="0.14999999999999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="SourceSansPro-Regular" family="Source Sans Pro" pointSize="20"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="alphabet" returnKeyType="next" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="H0N-Ax-m9d" customClass="ZWButton" customModule="ZWallet">
<rect key="frame" x="0.0" y="840" width="414" height="56"/>
<color key="backgroundColor" red="0.14474189281463623" green="0.55489373207092285" blue="0.96221667528152466" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="56" id="brW-Yb-hQ5"/>
</constraints>
<fontDescription key="fontDescription" name="SourceSansPro-SemiBold" family="Source Sans Pro" pointSize="16"/>
<state key="normal" title="!!Next"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="textColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="nextButtonTouched" destination="M2V-hB-lEq" eventType="touchUpInside" id="EJz-bI-2sK"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Vyu-5m-YUx" firstAttribute="trailing" secondItem="miM-vD-sj4" secondAttribute="trailing" constant="24" id="2s0-qI-ezO"/>
<constraint firstItem="r9g-U1-6GC" firstAttribute="top" secondItem="wua-MI-GFO" secondAttribute="bottom" constant="32" id="2sr-L1-ZYq"/>
<constraint firstItem="miM-vD-sj4" firstAttribute="top" secondItem="r9g-U1-6GC" secondAttribute="bottom" constant="40" id="CFm-5G-a67"/>
<constraint firstItem="miM-vD-sj4" firstAttribute="leading" secondItem="Vyu-5m-YUx" secondAttribute="leading" constant="24" id="FKs-Vj-WtE"/>
<constraint firstAttribute="bottom" secondItem="H0N-Ax-m9d" secondAttribute="bottom" id="FPj-Sn-BCT" customClass="ZWKeyboardLayoutConstraint" customModule="ZWallet"/>
<constraint firstItem="r9g-U1-6GC" firstAttribute="leading" secondItem="Vyu-5m-YUx" secondAttribute="leading" constant="24" id="WOg-Dr-Ycf"/>
<constraint firstItem="Vyu-5m-YUx" firstAttribute="trailing" secondItem="wua-MI-GFO" secondAttribute="trailing" constant="24" id="ig4-Jz-6Gs"/>
<constraint firstItem="Vyu-5m-YUx" firstAttribute="trailing" secondItem="H0N-Ax-m9d" secondAttribute="trailing" id="j43-qX-LKh"/>
<constraint firstItem="wua-MI-GFO" firstAttribute="top" secondItem="Vyu-5m-YUx" secondAttribute="top" constant="80" id="kXJ-le-AYd"/>
<constraint firstItem="H0N-Ax-m9d" firstAttribute="leading" secondItem="Vyu-5m-YUx" secondAttribute="leading" id="mFp-Wh-To7"/>
<constraint firstItem="wua-MI-GFO" firstAttribute="leading" secondItem="Vyu-5m-YUx" secondAttribute="leading" constant="24" id="r7j-18-XtY"/>
<constraint firstItem="Vyu-5m-YUx" firstAttribute="trailing" secondItem="r9g-U1-6GC" secondAttribute="trailing" constant="24" id="unm-EG-rDc"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Vyu-5m-YUx"/>
</view>
<connections>
<outlet property="memoTextField" destination="miM-vD-sj4" id="D9a-Eb-LRK"/>
<outlet property="nextButton" destination="H0N-Ax-m9d" id="5yh-hp-fjw"/>
<outlet property="progressBar" destination="wua-MI-GFO" id="gWZ-hc-G3M"/>
<outlet property="titleLabel" destination="r9g-U1-6GC" id="JRH-ft-th2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fNu-aZ-Pmz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="133.33333333333334" y="-179.46428571428569"/>
</scene>
</scenes>
</document>

View File

@ -41,7 +41,7 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9bf-V7-fpZ">
<rect key="frame" x="338" y="92" width="44" height="44"/>
<rect key="frame" x="354" y="44" width="44" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="8ND-ry-H6Z"/>
<constraint firstAttribute="height" constant="44" id="sdk-iY-Y19"/>
@ -57,10 +57,10 @@
<constraint firstItem="z7w-Du-ztS" firstAttribute="trailing" secondItem="Y8Z-sX-hmw" secondAttribute="trailing" id="E7z-dZ-JNC"/>
<constraint firstItem="z7w-Du-ztS" firstAttribute="centerX" secondItem="xBu-hN-lf8" secondAttribute="centerX" id="N19-al-IwU"/>
<constraint firstItem="Y8Z-sX-hmw" firstAttribute="top" secondItem="z7w-Du-ztS" secondAttribute="bottom" constant="5" id="ca9-1y-xcq"/>
<constraint firstItem="9bf-V7-fpZ" firstAttribute="top" secondItem="qfh-Fs-D4h" secondAttribute="top" constant="48" id="gDd-Vh-ejd"/>
<constraint firstItem="9bf-V7-fpZ" firstAttribute="top" secondItem="qfh-Fs-D4h" secondAttribute="top" id="gDd-Vh-ejd"/>
<constraint firstItem="Y8Z-sX-hmw" firstAttribute="leading" secondItem="z7w-Du-ztS" secondAttribute="leading" id="oYG-Og-hdO"/>
<constraint firstItem="z7w-Du-ztS" firstAttribute="centerY" secondItem="xBu-hN-lf8" secondAttribute="centerY" id="vkC-0L-yeM"/>
<constraint firstItem="qfh-Fs-D4h" firstAttribute="trailing" secondItem="9bf-V7-fpZ" secondAttribute="trailing" constant="32" id="zzz-ye-CaJ"/>
<constraint firstItem="qfh-Fs-D4h" firstAttribute="trailing" secondItem="9bf-V7-fpZ" secondAttribute="trailing" constant="16" id="zzz-ye-CaJ"/>
</constraints>
<viewLayoutGuide key="safeArea" id="qfh-Fs-D4h"/>
</view>

View File

@ -84,6 +84,8 @@ extension SendCoordinator: AmountVCDelegate {
func amountVCDelegateNextButtonTouched(sender: AmountVC, amount: ZecInAtomicUnits) {
#warning("implement")
self.showMemoView()
}
private func showAmountView() {
@ -96,3 +98,19 @@ extension SendCoordinator: AmountVCDelegate {
self.navigationController.pushViewController(vc, animated: true)
}
}
extension SendCoordinator: MemoVCDelegate {
func memoVCDelegateNextButtonTouched(sender: MemoVC, memo: String?) {
#warning("implement")
}
private func showMemoView() {
let vc = self.viewFactory.getMemoVC()
vc.delegate = self
vc.localizer = self.localizer
vc.memo = "22of8.ch"
self.navigationController.pushViewController(vc, animated: true)
}
}

View File

@ -0,0 +1,66 @@
//
// AmountVC.swift
// ZWallet
//
// Created by loj on 03.02.19.
// Copyright © 2019 XMR Systems LLC. All rights reserved.
//
import UIKit
class MemoVC: UIViewController {
@IBOutlet weak var progressBar: ZWProgressBar!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var memoTextField: UITextField!
@IBOutlet weak var nextButton: ZWButton!
public weak var delegate: MemoVCDelegate?
public weak var localizer: Localizable?
public var memo: String?
@IBAction func nextButtonTouched() {
self.delegate?.memoVCDelegateNextButtonTouched(sender: self, memo: self.memoTextField.text)
}
override func viewDidLoad() {
super.viewDidLoad()
self.setup()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.updateView()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.memoTextField.resignFirstResponder()
}
private func setup() {
self.memoTextField.addTarget(self,
action: #selector(memoTextFieldDidChange(_:)),
for: .editingChanged)
}
private func updateView() {
self.memoTextField.becomeFirstResponder()
guard let localizer = self.localizer else { return }
self.titleLabel.text = localizer.localized("memo.title")
self.memoTextField.text = self.memo
self.memoTextField.placeholder = localizer.localized("memo.memo.placeholder")
self.nextButton.setTitle(localizer.localized("memo.next"), for: .normal)
}
@objc
private func memoTextFieldDidChange(_ sender: Any) {
self.memo = self.memoTextField.text
if let memo = self.memo {
print(memo)
}
}
}

View File

@ -0,0 +1,14 @@
//
// AmountVCDelegate.swift
// ZWallet
//
// Created by loj on 03.02.19.
// Copyright © 2019 XMR Systems LLC. All rights reserved.
//
import Foundation
internal protocol MemoVCDelegate: class {
func memoVCDelegateNextButtonTouched(sender: MemoVC, memo: String?)
}