Commit 3a2fb802 authored by Grigor Aghabalyan's avatar Grigor Aghabalyan
Browse files

Feat: add SingleView form

parent ac56c2a8
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
C5356A3D242FC9F900EFD310 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3C242FC9F900EFD310 /* Language.swift */; }; C5356A3D242FC9F900EFD310 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3C242FC9F900EFD310 /* Language.swift */; };
C5356A41242FCB4700EFD310 /* LanguageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3F242FCB4600EFD310 /* LanguageCell.swift */; }; C5356A41242FCB4700EFD310 /* LanguageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3F242FCB4600EFD310 /* LanguageCell.swift */; };
C5356A42242FCB4700EFD310 /* LanguageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5356A40242FCB4600EFD310 /* LanguageCell.xib */; }; C5356A42242FCB4700EFD310 /* LanguageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5356A40242FCB4600EFD310 /* LanguageCell.xib */; };
C54206282430AC53001D858F /* SingleFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C54206262430AC53001D858F /* SingleFormViewController.swift */; };
C54206292430AC53001D858F /* SingleFormViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C54206272430AC53001D858F /* SingleFormViewController.xib */; };
C5D2A725242B077100825031 /* FormsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A724242B077100825031 /* FormsService.swift */; }; C5D2A725242B077100825031 /* FormsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A724242B077100825031 /* FormsService.swift */; };
C5D2A727242B0A2300825031 /* FormsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A726242B0A2300825031 /* FormsResponse.swift */; }; C5D2A727242B0A2300825031 /* FormsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A726242B0A2300825031 /* FormsResponse.swift */; };
C5D2A729242B12F200825031 /* FormResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A728242B12F200825031 /* FormResponse.swift */; }; C5D2A729242B12F200825031 /* FormResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A728242B12F200825031 /* FormResponse.swift */; };
...@@ -77,6 +79,8 @@ ...@@ -77,6 +79,8 @@
C5356A3C242FC9F900EFD310 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = "<group>"; }; C5356A3C242FC9F900EFD310 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = "<group>"; };
C5356A3F242FCB4600EFD310 /* LanguageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageCell.swift; sourceTree = "<group>"; }; C5356A3F242FCB4600EFD310 /* LanguageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageCell.swift; sourceTree = "<group>"; };
C5356A40242FCB4600EFD310 /* LanguageCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LanguageCell.xib; sourceTree = "<group>"; }; C5356A40242FCB4600EFD310 /* LanguageCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LanguageCell.xib; sourceTree = "<group>"; };
C54206262430AC53001D858F /* SingleFormViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingleFormViewController.swift; sourceTree = "<group>"; };
C54206272430AC53001D858F /* SingleFormViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SingleFormViewController.xib; sourceTree = "<group>"; };
C5D2A724242B077100825031 /* FormsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsService.swift; sourceTree = "<group>"; }; C5D2A724242B077100825031 /* FormsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsService.swift; sourceTree = "<group>"; };
C5D2A726242B0A2300825031 /* FormsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsResponse.swift; sourceTree = "<group>"; }; C5D2A726242B0A2300825031 /* FormsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsResponse.swift; sourceTree = "<group>"; };
C5D2A728242B12F200825031 /* FormResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormResponse.swift; sourceTree = "<group>"; }; C5D2A728242B12F200825031 /* FormResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormResponse.swift; sourceTree = "<group>"; };
...@@ -196,6 +200,15 @@ ...@@ -196,6 +200,15 @@
path = Cells; path = Cells;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C54206252430AC28001D858F /* Single */ = {
isa = PBXGroup;
children = (
C54206262430AC53001D858F /* SingleFormViewController.swift */,
C54206272430AC53001D858F /* SingleFormViewController.xib */,
);
path = Single;
sourceTree = "<group>";
};
C5D69141242AA091004268C3 = { C5D69141242AA091004268C3 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -328,6 +341,7 @@ ...@@ -328,6 +341,7 @@
C5D69187242AAC05004268C3 /* Form */ = { C5D69187242AAC05004268C3 /* Form */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C54206252430AC28001D858F /* Single */,
C5D69196242AAD2C004268C3 /* Create */, C5D69196242AAD2C004268C3 /* Create */,
C5D6918C242AAC73004268C3 /* FormList */, C5D6918C242AAC73004268C3 /* FormList */,
); );
...@@ -490,6 +504,7 @@ ...@@ -490,6 +504,7 @@
C5D691D1242AFEB0004268C3 /* DatePickerViewController.xib in Resources */, C5D691D1242AFEB0004268C3 /* DatePickerViewController.xib in Resources */,
C5D69190242AAC86004268C3 /* FormListViewController.xib in Resources */, C5D69190242AAC86004268C3 /* FormListViewController.xib in Resources */,
C5356A35242FBAF800EFD310 /* SettingsViewController.xib in Resources */, C5356A35242FBAF800EFD310 /* SettingsViewController.xib in Resources */,
C54206292430AC53001D858F /* SingleFormViewController.xib in Resources */,
C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */, C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */,
C5D69157242AA094004268C3 /* Assets.xcassets in Resources */, C5D69157242AA094004268C3 /* Assets.xcassets in Resources */,
C5D69155242AA091004268C3 /* Main.storyboard in Resources */, C5D69155242AA091004268C3 /* Main.storyboard in Resources */,
...@@ -552,6 +567,7 @@ ...@@ -552,6 +567,7 @@
C5D69179242AA58F004268C3 /* BaseResponse.swift in Sources */, C5D69179242AA58F004268C3 /* BaseResponse.swift in Sources */,
C5D691C0242AE5E2004268C3 /* FormCreateResponse.swift in Sources */, C5D691C0242AE5E2004268C3 /* FormCreateResponse.swift in Sources */,
C5D69199242AAD3F004268C3 /* FormCreateViewController.swift in Sources */, C5D69199242AAD3F004268C3 /* FormCreateViewController.swift in Sources */,
C54206282430AC53001D858F /* SingleFormViewController.swift in Sources */,
C5D6917F242AA5D9004268C3 /* CheckBaseHelper.swift in Sources */, C5D6917F242AA5D9004268C3 /* CheckBaseHelper.swift in Sources */,
C5356A34242FBAF800EFD310 /* SettingsViewController.swift in Sources */, C5356A34242FBAF800EFD310 /* SettingsViewController.swift in Sources */,
C5356A39242FC1F900EFD310 /* LanguageViewController.swift in Sources */, C5356A39242FC1F900EFD310 /* LanguageViewController.swift in Sources */,
...@@ -742,7 +758,7 @@ ...@@ -742,7 +758,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10; CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = JY829SQQAV; DEVELOPMENT_TEAM = JY829SQQAV;
INFOPLIST_FILE = App16/Info.plist; INFOPLIST_FILE = App16/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
...@@ -764,7 +780,7 @@ ...@@ -764,7 +780,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10; CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = JY829SQQAV; DEVELOPMENT_TEAM = JY829SQQAV;
INFOPLIST_FILE = App16/Info.plist; INFOPLIST_FILE = App16/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
Copyright © 2020 X-TECH. All rights reserved. Copyright © 2020 X-TECH. All rights reserved.
*/ */
"OK" = "Ok";
"FIRST_NAME" = "Fist name"; "FIRST_NAME" = "Fist name";
"LAST_NAME" = "Last name"; "LAST_NAME" = "Last name";
"MIDDLE_NAME" = "Middle name"; "MIDDLE_NAME" = "Middle name";
...@@ -30,3 +32,5 @@ ...@@ -30,3 +32,5 @@
"LANGUAGE" = "Language"; "LANGUAGE" = "Language";
"LANGUAGES" = "Languages"; "LANGUAGES" = "Languages";
"CANCEL" = "Cancel"; "CANCEL" = "Cancel";
"Please fill in all fields" = "Please fill in all fields";
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
Copyright © 2020 X-TECH. All rights reserved. Copyright © 2020 X-TECH. All rights reserved.
*/ */
"OK" = "Լավ";
"FIRST_NAME" = "Անուն"; "FIRST_NAME" = "Անուն";
"LAST_NAME" = "Ազգանուն"; "LAST_NAME" = "Ազգանուն";
"MIDDLE_NAME" = "հայրանուն"; "MIDDLE_NAME" = "հայրանուն";
...@@ -30,3 +32,5 @@ ...@@ -30,3 +32,5 @@
"LANGUAGE" = "Լեզու"; "LANGUAGE" = "Լեզու";
"LANGUAGES" = "Լեզուներ"; "LANGUAGES" = "Լեզուներ";
"CANCEL" = "Չեղարկել"; "CANCEL" = "Չեղարկել";
"Please fill in all fields" = "Խնդում ենք լրացրեք բոլոր դաշտերը";
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
Copyright © 2020 X-TECH. All rights reserved. Copyright © 2020 X-TECH. All rights reserved.
*/ */
"OK" = "Ok";
"FIRST_NAME" = "Имя"; "FIRST_NAME" = "Имя";
"LAST_NAME" = "Фамилия"; "LAST_NAME" = "Фамилия";
"MIDDLE_NAME" = "Отчество"; "MIDDLE_NAME" = "Отчество";
...@@ -30,3 +32,5 @@ ...@@ -30,3 +32,5 @@
"LANGUAGE" = "Язык"; "LANGUAGE" = "Язык";
"LANGUAGES" = "Языки"; "LANGUAGES" = "Языки";
"CANCEL" = "Отменить"; "CANCEL" = "Отменить";
"Please fill in all fields" = "Пожалуйста, заполните все поля";
...@@ -50,34 +50,17 @@ class FormCreateViewController: UIViewController { ...@@ -50,34 +50,17 @@ class FormCreateViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
setUI() setUI()
}
switch formViewType {
case .creta: private func setUI() {
createButton.isHidden = false
self.title = "CREATE_FORM".localized()
curentDate.text = date
case .viewFromList:
self.title = "FORM".localized()
createButton.isHidden = true
setData(response: data)
case .viewFromQr:
self.title = "FORM".localized()
createButton.isHidden = true
retriveCurentForm()
}
if let firstName = UserDefaultsHelper.getString(for: .firstName), if let firstName = UserDefaultsHelper.getString(for: .firstName),
let lastName = UserDefaultsHelper.getString(for: .lstName), let lastName = UserDefaultsHelper.getString(for: .lstName),
let middleName = UserDefaultsHelper.getString(for: .middleName) { let middleName = UserDefaultsHelper.getString(for: .middleName) {
nameLabel.text = "\(firstName) \(lastName) \(middleName)" nameLabel.text = "\(firstName) \(lastName) \(middleName)"
} }
}
private func setUI() {
self.title = "CREATE_FORM".localized()
createButton.setTitle("CREATE".localized(), for: .normal) createButton.setTitle("CREATE".localized(), for: .normal)
outDateTimeTextLabel.text = "OUT_ADDRESS".localized() outDateTimeTextLabel.text = "OUT_ADDRESS".localized()
outAddressTextLabel.text = "OUT_DATETIME".localized() outAddressTextLabel.text = "OUT_DATETIME".localized()
...@@ -117,7 +100,7 @@ class FormCreateViewController: UIViewController { ...@@ -117,7 +100,7 @@ class FormCreateViewController: UIViewController {
|| outAddressTextFiled.text == "" || outAddressTextFiled.text == ""
|| destinationAddressTextField.text == "" || planneDateTimeTextField.text == "" { || destinationAddressTextField.text == "" || planneDateTimeTextField.text == "" {
let alertController = AlertControllerHelper.showAlert(title: nil, message: "Խնդում ենք լրացրեք բոլոր դաշտերը") let alertController = AlertControllerHelper.showAlert(title: nil, message: "Please fill in all fields".localized())
self.present(alertController, animated: true, completion: nil) self.present(alertController, animated: true, completion: nil)
}else { }else {
createForm() createForm()
...@@ -173,58 +156,4 @@ class FormCreateViewController: UIViewController { ...@@ -173,58 +156,4 @@ class FormCreateViewController: UIViewController {
} }
} }
} }
private func retriveCurentForm() {
activityIndicator.isHidden = false
activityIndicator.startAnimating()
let form = CurentFormRequestForm(deviceToken: UIDevice.current.identifierForVendor?.uuidString)
CurrentFormService.shered.retrive(data: form) { (responseData) in
switch responseData {
case .base(response: let baseResposne):
self.activityIndicator.stopAnimating()
CheckBaseHelper.checkBaseResponse(baseResposne, viewController: self)
case .success(let response):
self.activityIndicator.stopAnimating()
DispatchQueue.main.async {
self.setData(response: response.data )
}
case .isOffline:
self.activityIndicator.stopAnimating()
return
case .conflict:
self.activityIndicator.stopAnimating()
return
}
}
}
private func setData(response: FormResponse?) {
destinationAddressTextField.isUserInteractionEnabled = false
planneDateTimeTextField.isUserInteractionEnabled = false
destinationTypeTextField.isUserInteractionEnabled = false
destinationAddressTextField.isUserInteractionEnabled = false
outDateButtonAction.isUserInteractionEnabled = false
planneDateTimeButton.isUserInteractionEnabled = false
outAddressTextFiled.isUserInteractionEnabled = false
outDateTimeTextFiled.isUserInteractionEnabled = false
planneDateTimeTextField.isUserInteractionEnabled = false
outDateTimeTextFiled.text = response?.outDatetime
outAddressTextFiled.text = response?.outAddress
destinationAddressTextField.text = response?.visitingAddressAndName
planneDateTimeTextField.text = response?.plannedReturnDatetime
destinationTypeTextField.text = response?.visitingReason
curentDate.text = response?.createdAt
}
} }
...@@ -96,9 +96,8 @@ extension FormListViewController: UITableViewDelegate { ...@@ -96,9 +96,8 @@ extension FormListViewController: UITableViewDelegate {
private func openCreateFormView(index: Int) { private func openCreateFormView(index: Int) {
let controller = FormCreateViewController() let controller = SingleFormViewController()
controller.formViewType = .viewFromList controller.formData = dataSource[index]
controller.data = dataSource[index]
self.navigationController?.navigationBar.topItem?.title = " " self.navigationController?.navigationBar.topItem?.title = " "
self.navigationController?.pushViewController(controller, animated: true) self.navigationController?.pushViewController(controller, animated: true)
} }
......
//
// SingleFormViewController.swift
// App16
//
// Created by Grigor Aghabalyan on 3/29/20.
// Copyright © 2020 X-TECH. All rights reserved.
//
import UIKit
class SingleFormViewController: UIViewController {
// MARK: - IBOutlets
@IBOutlet weak var fistNameTextLabel: UILabel!
@IBOutlet weak var lastNameTextLabel: UILabel!
@IBOutlet weak var meddleNameTextLabel: UILabel!
@IBOutlet weak var outDateTimeTextLabel: UILabel!
@IBOutlet weak var outAddressTextLabel: UILabel!
@IBOutlet weak var destinationAddressTextLabel: UILabel!
@IBOutlet weak var planneDateTimeTextLabel: UILabel!
@IBOutlet weak var destinationTypeTextLabel: UILabel!
@IBOutlet weak var fistNameLabel: UILabel!
@IBOutlet weak var lastNameLabel: UILabel!
@IBOutlet weak var meddleNameLabel: UILabel!
@IBOutlet weak var outDateTimeLabel: UILabel!
@IBOutlet weak var outAddressLabel: UILabel!
@IBOutlet weak var destinationAddressLabel: UILabel!
@IBOutlet weak var planneDateTimeLabel: UILabel!
@IBOutlet weak var destinationTypeLabel: UILabel!
@IBOutlet weak var curentDateLabel: UILabel!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
// MARK: - Variables
var formData: FormResponse?
// MARK: - LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
setUI()
if let data = formData {
setData(response: data)
}else {
retriveCurentForm()
}
}
private func setUI() {
self.title = "FORM".localized()
fistNameLabel.text = "FIRST_NAME".localized()
lastNameLabel.text = "LAST_NAME".localized()
meddleNameLabel.text = "MEDDLE_NAME".localized()
outDateTimeTextLabel.text = "OUT_ADDRESS".localized()
outAddressTextLabel.text = "OUT_DATETIME".localized()
destinationAddressTextLabel.text = "Address of the place of visit/Title".localized()
planneDateTimeTextLabel.text = "Estimated Return Time".localized()
destinationTypeTextLabel.text = "Purpose of the visit".localized()
}
private func setData(response: FormResponse?) {
fistNameLabel.text = response?.firstName
lastNameLabel.text = response?.lastName
meddleNameLabel.text = response?.middleName
outDateTimeLabel.text = response?.outDatetime
outAddressLabel.text = response?.outAddress
destinationAddressLabel.text = response?.visitingAddressAndName
planneDateTimeLabel.text = response?.plannedReturnDatetime
destinationTypeLabel.text = response?.visitingReason
curentDateLabel.text = response?.createdAt
}
private func retriveCurentForm() {
activityIndicator.isHidden = false
activityIndicator.startAnimating()
let form = CurentFormRequestForm(deviceToken: UIDevice.current.identifierForVendor?.uuidString)
CurrentFormService.shered.retrive(data: form) { (responseData) in
switch responseData {
case .base(response: let baseResposne):
self.activityIndicator.stopAnimating()
CheckBaseHelper.checkBaseResponse(baseResposne, viewController: self)
case .success(let response):
self.activityIndicator.stopAnimating()
DispatchQueue.main.async {
self.setData(response: response.data )
}
case .isOffline:
self.activityIndicator.stopAnimating()
return
case .conflict:
self.activityIndicator.stopAnimating()
return
}
}
}
}
This diff is collapsed.
...@@ -17,18 +17,16 @@ class QrViewController: UIViewController { ...@@ -17,18 +17,16 @@ class QrViewController: UIViewController {
@IBOutlet weak var finishButton: UIButton! @IBOutlet weak var finishButton: UIButton!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView! @IBOutlet weak var activityIndicator: UIActivityIndicatorView!
// MARK: - Variables
let downloader = ImageDownloader()
var urlRequest: URLRequest?
// MARK: - LifeCycle // MARK: - LifeCycle
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
downloaderQR()
setUI() setUI()
if let teviceId = UIDevice.current.identifierForVendor?.uuidString {
activityIndicator.isHidden = false
activityIndicator.startAnimating()
let url = "https://app16.x-tech.am/api/v1/applications/qr_code?device_token=\(teviceId)"
setImage(url, imageView: qrImageView)
}
} }
private func setUI() { private func setUI() {
...@@ -37,14 +35,29 @@ class QrViewController: UIViewController { ...@@ -37,14 +35,29 @@ class QrViewController: UIViewController {
finishButton.setTitle("FINISH".localized(), for: .normal) finishButton.setTitle("FINISH".localized(), for: .normal)
} }
private func downloaderQR() {
self.activityIndicator.isHidden = false
self.activityIndicator.startAnimating()
if let teviceId = UIDevice.current.identifierForVendor?.uuidString {
urlRequest = URLRequest(url: URL(string: "https://app16.x-tech.am/api/v1/applications/qr_code?device_token=\(teviceId)")!)
downloader.download(urlRequest!) { response in
if case .success(let image) = response.result {
print(image)
self.qrImageView.image = image
self.activityIndicator.stopAnimating()
}
}
}
}
// MARK: - Actions // MARK: - Actions
@IBAction func formButtonAction(_ sender: UIButton) { @IBAction func formButtonAction(_ sender: UIButton) {
openCreateFormView() openCreateFormView()
} }
@IBAction func finshButtonAction(_ sender: UIButton) { @IBAction func finshButtonAction(_ sender: UIButton) {
retriveCurentForm() finishCurentForm()
} }
private func openWelcomeView() { private func openWelcomeView() {
...@@ -55,8 +68,8 @@ class QrViewController: UIViewController { ...@@ -55,8 +68,8 @@ class QrViewController: UIViewController {
private func openCreateFormView() { private func openCreateFormView() {
let controller = FormCreateViewController() let controller = SingleFormViewController()
controller.formViewType = .viewFromQr
self.navigationController?.navigationBar.topItem?.title = " " self.navigationController?.navigationBar.topItem?.title = " "
self.navigationController?.pushViewController(controller, animated: true) self.navigationController?.pushViewController(controller, animated: true)
} }
...@@ -76,20 +89,21 @@ class QrViewController: UIViewController { ...@@ -76,20 +89,21 @@ class QrViewController: UIViewController {
} }
} }
private func retriveCurentForm() { // MARK: - Request
private func finishCurentForm() {
let form = CurentFormRequestForm(deviceToken: UIDevice.current.identifierForVendor?.uuidString) let form = CurentFormRequestForm(deviceToken: UIDevice.current.identifierForVendor?.uuidString)
FormFinishService.shered.finishForm(data: form) { (responseData) in FormFinishService.shered.finishForm(data: form) { (responseData) in
switch responseData { switch responseData {
case .base(response: let baseResposne): case .base(response: let baseResposne):
CheckBaseHelper.checkBaseResponse(baseResposne, viewController: self) CheckBaseHelper.checkBaseResponse(baseResposne, viewController: self)
case .success(_): case .success(_):
self.openWelcomeView() self.openWelcomeView()
case .isOffline: case .isOffline:
return
case .conflict:
return return
case .conflict: }
return }
} }
}
}
} }
Markdown is supported
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