Commit e36a2731 authored by Grigor Aghabalyan's avatar Grigor Aghabalyan
Browse files

Feat: add FormCreate view

parent 5cf48a7b
......@@ -35,6 +35,8 @@
C5D691AB242AC17D004268C3 /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D691AA242AC17D004268C3 /* UIView+Extensions.swift */; };
C5D691AF242AC607004268C3 /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D691AD242AC607004268C3 /* WelcomeViewController.swift */; };
C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5D691AE242AC607004268C3 /* WelcomeViewController.xib */; };
C5D691B4242AD290004268C3 /* QrViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D691B2242AD290004268C3 /* QrViewController.swift */; };
C5D691B5242AD290004268C3 /* QrViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5D691B3242AD290004268C3 /* QrViewController.xib */; };
DFF30959C2696CFA212F54E4 /* Pods_App16.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC947C811CE3C096F8981C77 /* Pods_App16.framework */; };
/* End PBXBuildFile section */
......@@ -72,6 +74,8 @@
C5D691AA242AC17D004268C3 /* UIView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = "<group>"; };
C5D691AD242AC607004268C3 /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
C5D691AE242AC607004268C3 /* WelcomeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WelcomeViewController.xib; sourceTree = "<group>"; };
C5D691B2242AD290004268C3 /* QrViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrViewController.swift; sourceTree = "<group>"; };
C5D691B3242AD290004268C3 /* QrViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = QrViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -195,6 +199,7 @@
C5D6916C242AA460004268C3 /* Views */ = {
isa = PBXGroup;
children = (
C5D691B1242AD26C004268C3 /* Qr */,
C5D6919B242AADBD004268C3 /* Main */,
C5D691AC242AC5F3004268C3 /* Welcome */,
C5D69186242AABFA004268C3 /* Login */,
......@@ -293,6 +298,15 @@
path = Welcome;
sourceTree = "<group>";
};
C5D691B1242AD26C004268C3 /* Qr */ = {
isa = PBXGroup;
children = (
C5D691B2242AD290004268C3 /* QrViewController.swift */,
C5D691B3242AD290004268C3 /* QrViewController.xib */,
);
path = Qr;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -357,6 +371,7 @@
C5D69195242AAD00004268C3 /* SingleFormViewController.xib in Resources */,
C5D6915A242AA094004268C3 /* LaunchScreen.storyboard in Resources */,
C5D6919A242AAD3F004268C3 /* FormCreateViewController.xib in Resources */,
C5D691B5242AD290004268C3 /* QrViewController.xib in Resources */,
C5D69190242AAC86004268C3 /* FormListViewController.xib in Resources */,
C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */,
C5D69157242AA094004268C3 /* Assets.xcassets in Resources */,
......@@ -426,6 +441,7 @@
C5D69194242AAD00004268C3 /* SingleFormViewController.swift in Sources */,
C5D69170242AA4E9004268C3 /* Config.swift in Sources */,
C5D6916E242AA4D2004268C3 /* Settings.swift in Sources */,
C5D691B4242AD290004268C3 /* QrViewController.swift in Sources */,
C5D691AB242AC17D004268C3 /* UIView+Extensions.swift in Sources */,
C5D69177242AA573004268C3 /* ValidationError.swift in Sources */,
C5D6917D242AA5BE004268C3 /* UserDefaultsHelper.swift in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "Screen Shot 2020-03-25 at 03.47.30.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -7,14 +7,43 @@
//
import UIKit
import IQKeyboardManagerSwift
class FormCreateViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var outDateTimeTextFiled: UITextField!
@IBOutlet weak var outAddressTextFiled: UITextField!
@IBOutlet weak var destinationAddressTextField: UITextField!
@IBOutlet weak var planneDateTimeTextField: UITextField!
@IBOutlet weak var destinationTypeTextField:
UITextField!
@IBOutlet weak var createButton: UIButton!
// MARK: - LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func createButtonAction(_ sender: UIButton) {
if outDateTimeTextFiled.text == ""
|| outAddressTextFiled.text == ""
|| destinationAddressTextField.text == "" || planneDateTimeTextField.text == "" {
let alertController = AlertControllerHelper.showAlert(title: nil, message: "Խնդում ենք լրացրեք բոլոր դաշտերը")
self.present(alertController, animated: true, completion: nil)
}else {
openQrView()
}
}
private func openQrView() {
let controller = QrViewController()
changeRoot(UINavigationController(rootViewController: controller))
}
}
......@@ -18,11 +18,4 @@ class FormListViewController: UIViewController {
super.viewDidLoad()
}
private func openCreateFormViewController() {
let controller = SingleFormViewController()
let navController = UINavigationController(rootViewController: controller)
self.present(navController, animated: true, completion: nil)
}
}
......@@ -22,7 +22,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vtm-vD-8p8">
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vtm-vD-8p8">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pjJ-TP-GZQ">
......
//
// QrViewController.swift
// App16
//
// Created by Grigor Aghabalyan on 3/25/20.
// Copyright © 2020 X-TECH. All rights reserved.
//
import UIKit
class QrViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var qrImageView: UIImageView!
@IBOutlet weak var fomrButton: UIButton!
@IBOutlet weak var finishButton: UIButton!
// MARK: - LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: - Actions
@IBAction func formButtonAction(_ sender: UIButton) {
}
@IBAction func finshButtonAction(_ sender: UIButton) {
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="QrViewController" customModule="App16" customModuleProvider="target">
<connections>
<outlet property="finishButton" destination="pPZ-K4-2Kg" id="7HX-fh-rYR"/>
<outlet property="fomrButton" destination="72Y-zH-s26" id="JJK-Uk-0Hu"/>
<outlet property="qrImageView" destination="R4q-c0-18T" id="Uvw-YL-6g0"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qr_icon" translatesAutoresizingMaskIntoConstraints="NO" id="R4q-c0-18T">
<rect key="frame" x="67" y="84" width="280" height="280"/>
<constraints>
<constraint firstAttribute="width" secondItem="R4q-c0-18T" secondAttribute="height" multiplier="1:1" id="TRE-AB-Ndc"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="72Y-zH-s26">
<rect key="frame" x="40" y="437" width="334" height="50"/>
<color key="backgroundColor" red="0.0" green="0.53725490200000003" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="WXE-LO-W7A"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="Ձևաթուղթ">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="4"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="formButtonAction:" destination="-1" eventType="touchUpInside" id="hj8-Cm-0qm"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pPZ-K4-2Kg">
<rect key="frame" x="40" y="512" width="334" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="o9Y-3x-iE7"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="Ավարտել">
<color key="titleColor" red="0.0" green="0.53725490200000003" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="0.0" green="0.53725490200000003" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="finshButtonAction:" destination="-1" eventType="touchUpInside" id="ACU-84-kQN"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="pPZ-K4-2Kg" secondAttribute="trailing" constant="40" id="1j4-ji-GHo"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="R4q-c0-18T" secondAttribute="trailing" constant="67" id="2d3-D6-vaZ"/>
<constraint firstItem="R4q-c0-18T" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="67" id="3SQ-6z-RO0"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="72Y-zH-s26" secondAttribute="trailing" constant="40" id="DaE-jl-g2X"/>
<constraint firstItem="72Y-zH-s26" firstAttribute="top" secondItem="R4q-c0-18T" secondAttribute="bottom" constant="73" id="OIl-63-hEv"/>
<constraint firstItem="pPZ-K4-2Kg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="SYI-BX-jUk"/>
<constraint firstItem="R4q-c0-18T" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="40" id="Yo3-5M-76K"/>
<constraint firstItem="72Y-zH-s26" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="fVE-9w-GhO"/>
<constraint firstItem="pPZ-K4-2Kg" firstAttribute="top" secondItem="72Y-zH-s26" secondAttribute="bottom" constant="25" id="tVL-En-x82"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="139" y="130"/>
</view>
</objects>
<resources>
<image name="qr_icon" width="458" height="460"/>
</resources>
</document>
......@@ -40,6 +40,8 @@ class WelcomeViewController: UIViewController {
@IBAction func createButtonAction(_ sender: UIButton) {
let createFormView = FormCreateViewController()
self.navigationController?.pushViewController(createFormView, animated: true)
}
@IBAction func historyButtonAction(_ sender: UIButton) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment