Commit 6ce5a0fa authored by Grigor Aghabalyan's avatar Grigor Aghabalyan

Feat: add languages

parent 82affefa
This diff is collapsed.
......@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
IQKeyboardManager.shared.enable = true
setDefaultLanguage()
return true
}
......@@ -80,4 +80,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
private func setDefaultLanguage() {
if UserDefaultsHelper.getString(for: .locale) == nil {
Settings.changeLanguage(Settings.Languages.Armenian.rawValue, langauge: "Հայերեն")
}
}
}
{
"images" : [
{
"filename" : "icons8-checkmark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
{
"images" : [
{
"filename" : "settings.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
......@@ -24,3 +24,20 @@ extension Date {
return dateFormatter.string(from: self)
}
}
extension Bundle {
class var applicationVersionNumber: String {
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
return version
}
return "Version Number Not Available"
}
class var applicationBuildNumber: String {
if let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
return build
}
return "Build Number Not Available"
}
}
......@@ -15,6 +15,8 @@ enum UDAliases: String {
case lstName
case middleName
case deviceToken
case locale = "hy"
case langauge = "Հայերեն"
}
class UserDefaultsHelper {
......
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Fist name";
"LAST_NAME" = "Last name";
"MIDDLE_NAME" = "Middle name";
"NEXT" = "Next";
"WELCOME" = "Welcome";
"HISTORY" = "History";
"CREATE_FORM" = "Create Form";
"CREATE" = "Create";
"FORM" = "Form";
"FINISH" = "Finish";
"OUT_ADDRESS" = "Out address";
"OUT_DATETIME" = "Out datetime";
"Estimated Return Time" = "Estimated Return Time";
"Address of the place of visit/Title" = "Address of the place of visit/Title";
"Purpose of the visit" = "Purpose of the visit";
"APP_VERSION" = "App version";
"SETTINGS" = "Settings";
"LANGUAGE" = "Language";
"LANGUAGES" = "Languages";
"CANCEL" = "Cancel";
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Անուն";
"LAST_NAME" = "Ազգանուն";
"MIDDLE_NAME" = "հայրանուն";
"NEXT" = "Հաջորդը";
"WELCOME" = "Բարի գալուստ";
"HISTORY" = "Պատմություն";
"CREATE_FORM" = "Ստեղծել ձևաթուղթ";
"CREATE" = "Ստեղծել";
"FOMR" = "Ձևաթուղթ";
"FINISH" = "Ավարտել";
"OUT_ADDRESS" = "Ելքի ժամ";
"OUT_DATETIME" = "Ելքի հասցե";
"Estimated Return Time" = "Վերադարձի ակնկալվող ժամը";
"Address of the place of visit/title" = "Այցելության վայրի հասցե/անվանում";
"Purpose of the visit" = "Այցելության նպատակը";
"APP_VERSION" = "Հավելվածի տարբերակ";
"SETTINGS" = "Կարգավորումներ";
"LANGUAGE" = "Լեզու";
"LANGUAGES" = "Լեզուներ";
"CANCEL" = "Չեղարկել";
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Имя";
"LAST_NAME" = "Фамилия";
"MIDDLE_NAME" = "Отчество";
"NEXT" = "Следующий";
"WELCOME" = "Добро пожаловать";
"HISTORY" = "История";
"CREATE_FORM" = "Создать форму";
"CREATE" = "Создать";
"FORM" = "Форма";
"FINISH" = "Закончить";
"OUT_ADDRESS" = "Время выхода";
"OUT_DATETIME" = "Адрес выхода";
"Estimated Return Time" = "Ожидаемое время возврата/название";
"Address of the place of visit/Title" = "Адрес места посещения";
"Purpose of the visit" = "Цель визита";
"APP_VERSION" = "Версия приложения";
"SETTINGS" = "Настройки";
"LANGUAGE" = "Язык";
"LANGUAGES" = "Языки";
"CANCEL" = "Отменить";
......@@ -8,6 +8,7 @@
import Foundation
import CoreLocation
import Localize_Swift
struct Settings {
......@@ -15,4 +16,33 @@ struct Settings {
case latitude = 40.178576
case longitude = 44.511739
}
enum Languages: String {
case Armenian = "hy"
case English = "en"
case Russian = "ru"
}
static func changeLanguage(_ code: String, langauge: String) {
Settings.language = code
Localize.setCurrentLanguage(Settings.language)
UserDefaultsHelper.set(alias: .locale, value: code)
UserDefaultsHelper.set(alias: .langauge, value: langauge)
UserDefaults.standard.set(code, forKey: "language")
UserDefaults.standard.synchronize()
}
static var language: String! {
set(token) {
let defaults = Foundation.UserDefaults.standard
defaults.set(token, forKey: "User.Language")
}
get {
let defaults = Foundation.UserDefaults.standard
let lang = defaults.object(forKey: "User.Language") as? String
return lang
}
}
}
......@@ -25,8 +25,8 @@ class FormCreateViewController: UIViewController {
@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!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
......@@ -34,6 +34,12 @@ class FormCreateViewController: UIViewController {
@IBOutlet weak var planneDateTimeButton: UIButton!
@IBOutlet weak var nameLabel: 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!
// MARK: - Variables
var data: FormResponse!
var formViewType: FormViewType = .creta
......@@ -43,20 +49,22 @@ class FormCreateViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
setUI()
switch formViewType {
case .creta:
createButton.isHidden = false
self.title = "Ստեղծել ձևաթուղթ"
self.title = "CREATE_FORM".localized()
curentDate.text = date
case .viewFromList:
self.title = "Ձևաթուղթ"
self.title = "FORM".localized()
createButton.isHidden = true
setData(response: data)
case .viewFromQr:
self.title = "Ձևաթուղթ"
self.title = "FORM".localized()
createButton.isHidden = true
retriveCurentForm()
}
......@@ -68,6 +76,16 @@ class FormCreateViewController: UIViewController {
}
}
private func setUI() {
createButton.setTitle("CREATE".localized(), for: .normal)
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()
}
// MARK: - Actions
@IBAction func outDateButtonAction(_ 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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -14,13 +14,18 @@
<outlet property="createButton" destination="NyF-FR-xam" id="UmO-AP-uuM"/>
<outlet property="curentDate" destination="Tq2-Oq-lxj" id="Fh8-Zh-rwo"/>
<outlet property="destinationAddressTextField" destination="rPL-7I-ofi" id="TjC-eL-miv"/>
<outlet property="destinationAddressTextLabel" destination="rli-qI-mfE" id="EXq-c4-AS9"/>
<outlet property="destinationTypeTextField" destination="4aW-Ax-Ff0" id="e4d-zH-y4m"/>
<outlet property="destinationTypeTextLabel" destination="ANA-an-vnP" id="dMy-zT-vvq"/>
<outlet property="nameLabel" destination="MpC-Y1-VSJ" id="VF0-A0-eq8"/>
<outlet property="outAddressTextFiled" destination="mYS-bW-6ay" id="cWv-wV-KGV"/>
<outlet property="outAddressTextLabel" destination="JQ1-bo-hyi" id="Gkd-Jx-Z1B"/>
<outlet property="outDateButtonAction" destination="PvO-en-2tn" id="jZ5-9P-rNL"/>
<outlet property="outDateTimeTextFiled" destination="1V6-3e-Iop" id="udW-wX-Bcq"/>
<outlet property="outDateTimeTextLabel" destination="syB-Qv-Joh" id="XPm-B9-8YN"/>
<outlet property="planneDateTimeButton" destination="Je5-zZ-aSZ" id="r1W-uE-hv6"/>
<outlet property="planneDateTimeTextField" destination="suG-e6-CV9" id="z7Q-ns-46L"/>
<outlet property="planneDateTimeTextLabel" destination="XIU-P6-Fzz" id="9yg-67-2Lc"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......
......@@ -26,7 +26,7 @@ class FormListViewController: UIViewController {
tableView.dataSource = self
registerCelll()
self.title = "Պատմություն"
self.title = "HISTORY".localized()
if let deviceId = UIDevice.current.identifierForVendor?.uuidString {
retriveCurentForm(deviceToken: deviceId)
......
//
// LanguageCell.swift
// App16
//
// Created by Grigor Aghabalyan on 3/28/20.
// Copyright © 2020 X-TECH. All rights reserved.
//
import UIKit
class LanguageCell: UITableViewCell {
// MARK: - IBOutlets
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var checkMarkImageView: UIImageView!
// MARK: - LifeCycle
override func awakeFromNib() {
super.awakeFromNib()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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="16086"/>
<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"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="LanguageCell" id="KGk-i7-Jjw" customClass="LanguageCell" customModule="App16" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lRk-vs-TaX">
<rect key="frame" x="16" y="12" width="255" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ycD-Yu-Ols">
<rect key="frame" x="0.0" y="43" width="320" height="1"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="glI-zf-o73"/>
</constraints>
</view>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="checkmark" translatesAutoresizingMaskIntoConstraints="NO" id="7ie-jl-7gW">
<rect key="frame" x="279" y="9.5" width="25" height="25"/>
<color key="tintColor" red="0.023529411760000001" green="0.47058823529999999" blue="0.094117647060000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="3hL-bq-stx"/>
<constraint firstAttribute="width" constant="25" id="BlR-IY-60e"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="7ie-jl-7gW" firstAttribute="leading" secondItem="lRk-vs-TaX" secondAttribute="trailing" constant="8" id="Clu-uc-RdT"/>
<constraint firstItem="ycD-Yu-Ols" firstAttribute="top" secondItem="lRk-vs-TaX" secondAttribute="bottom" constant="10" id="EPO-sJ-TN9"/>
<constraint firstItem="ycD-Yu-Ols" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="NXn-Pt-mwA"/>
<constraint firstItem="lRk-vs-TaX" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="SJp-gQ-Grj"/>
<constraint firstItem="lRk-vs-TaX" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="VA0-ZZ-lTf"/>
<constraint firstAttribute="bottom" secondItem="ycD-Yu-Ols" secondAttribute="bottom" id="bT1-yr-vwZ"/>
<constraint firstAttribute="trailing" secondItem="ycD-Yu-Ols" secondAttribute="trailing" id="guR-eB-uDP"/>
<constraint firstAttribute="trailing" secondItem="7ie-jl-7gW" secondAttribute="trailing" constant="16" id="kO5-pM-v03"/>
<constraint firstItem="7ie-jl-7gW" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="ldy-lT-AHb"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="checkMarkImageView" destination="7ie-jl-7gW" id="rkH-c6-Fnw"/>
<outlet property="titleLabel" destination="lRk-vs-TaX" id="fZL-1U-65I"/>
</connections>
<point key="canvasLocation" x="137.68115942028987" y="131.91964285714286"/>
</tableViewCell>
</objects>
<resources>
<image name="checkmark" width="40" height="40"/>
</resources>
</document>
//
// LanguageViewController.swift
// App16
//
// Created by Grigor Aghabalyan on 3/28/20.
// Copyright © 2020 X-TECH. All rights reserved.
//
import UIKit
import RxSwift
import RxRelay
class LanguageViewController: UIViewController {
// MARK: - IBOutletS
@IBOutlet weak var tableView: UITableView!
// MARK: - Vriables
private let languageCell = "LanguageCell"
var langauges: [Language] = []
let didRefresh = PublishRelay<Void>()
// MARK: - LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
langauges.append(Language(title: "Հայերեն", code: "hy"))
langauges.append(Language(title: "English", code: "en"))
langauges.append(Language(title: "Русский", code: "ru"))
if let selectedLanguage = UserDefaultsHelper.getString(for: .locale) {
langauges.filter({
$0.code == selectedLanguage
}).first?.isSelected = true
}
self.tableView.delegate = self
self.tableView.dataSource = self
registerCelll()
setRightBarButton()
setUI()
}
// MARK: - Register
private func registerCelll() {
let nib = UINib(nibName: languageCell, bundle: nil)
tableView.register(nib, forCellReuseIdentifier: languageCell)
}
private func setUI() {
self.title = "LANGUAGES".localized()
self.navigationItem.leftBarButtonItem?.title = "CANCEL".localized()
}
private func setRightBarButton() {
let editButton = UIBarButtonItem.init(title: "CANCEL".localized(),
style: .done,
target: self,
action: #selector(closeAction))
editButton.tintColor = .white
self.navigationItem.leftBarButtonItem = editButton
}
// MARK: - Actions
@IBAction func closeAction() {
self.dismiss(animated: true, completion: nil)
}
}
// MARK: - UITableViewDataSource
extension LanguageViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return langauges.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: languageCell, for: indexPath) as? LanguageCell
cell?.titleLabel.text = langauges[indexPath.row].title
cell?.checkMarkImageView.isHidden = !langauges[indexPath.row].isSelected
return cell ?? UITableViewCell()
}
}
// MARK: - UITableViewDelegate
extension LanguageViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
langauges.forEach({
$0.isSelected = false
})
langauges[indexPath.row].isSelected = true
tableView.reloadData()
setLanguage(index: indexPath.row)
setUI()
didRefresh.accept(Void())
}
private func setLanguage(index: Int) {
Settings.changeLanguage(langauges[index].code, langauge: langauges[index].title)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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="16086"/>
<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="LanguageViewController" customModule="App16" customModuleProvider="target">
<connections>
<outlet property="tableView" destination="kLE-QI-dpJ" id="5Hr-eA-4gw"/>
<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>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="kLE-QI-dpJ">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tableView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="kLE-QI-dpJ" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="9nE-rc-muz"/>
<constraint firstItem="kLE-QI-dpJ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="jPx-Rb-5BM"/>
<constraint firstAttribute="bottom" secondItem="kLE-QI-dpJ" secondAttribute="bottom" id="kRz-yL-uH1"/>
<constraint firstItem="kLE-QI-dpJ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="wQN-gf-BkU"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="137.68115942028987" y="131.91964285714286"/>
</view>
</objects>
</document>
//
// Language.swift
// App16
//
// Created by Grigor Aghabalyan on 3/28/20.
// Copyright © 2020 X-TECH. All rights reserved.
//
import Foundation
class Language {
let title: String
let code: String
var isSelected = false
init(title: String, code: String) {
self.title = title
self.code = code
}
}
......@@ -18,15 +18,38 @@ class LoginViewController: UIViewController {
// MARK: - LifeCycle
override func viewDidLoad() {
super.viewDidLoad()
firstNameTextField.attributedPlaceholder = NSAttributedString(string: "Անուն",
setRightBarButton()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setUI()
}
private func setUI() {
firstNameTextField.attributedPlaceholder = NSAttributedString(string: "FIRST_NAME".localized(),
attributes: [NSAttributedString.Key.foregroundColor: UIColor.black.withAlphaComponent(0.2)])
lastNameTextFiled.attributedPlaceholder = NSAttributedString(string: "Ազգանուն",
lastNameTextFiled.attributedPlaceholder = NSAttributedString(string: "LAST_NAME".localized(),
attributes: [NSAttributedString.Key.foregroundColor: UIColor.black.withAlphaComponent(0.2)])
middleNameTextField.attributedPlaceholder = NSAttributedString(string: "Հայրանուն",
middleNameTextField.attributedPlaceholder = NSAttributedString(string: "MIDDLE_NAME".localized(),
attributes: [NSAttributedString.Key.foregroundColor: UIColor.black.withAlphaComponent(0.2)])
nextButton.setTitle("NEXT".localized(), for: .normal)
}
private func setRightBarButton() {
let editButton = UIBarButtonItem.init(image: UIImage(named: "settings"),
style: .done,
target: self,
action: #selector(settingsActtions))
editButton.tintColor = .white
self.navigationItem.rightBarButtonItem = editButton
}
// MARK: - Navigation
private func openCreateFormViewController() {
......@@ -64,4 +87,13 @@ class LoginViewController: UIViewController {
}
}
// MARK: - Actions
@IBAction func settingsActtions() {
let controller = SettingsViewController()
self.navigationController?.navigationBar.topItem?.title = " "
self.navigationController?.pushViewController(controller, animated: true)
}
}
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -26,10 +26,10 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pjJ-TP-GZQ">
<rect key="frame" x="0.0" y="0.0" width="414" height="605"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="545"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v5b-ox-LAJ" customClass="IQPreviousNextView" customModule="IQKeyboardManagerSwift">
<rect key="frame" x="40" y="252" width="334" height="50"/>
<rect key="frame" x="40" y="192" width="334" height="50"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UdU-wC-cfP">