git.iko.soy/dashared/hookah-tau
on develop help sign in
Насоздавала кучу файликов, не тестила вообще
commit922e0cef5a15952dda4bacba32891fcc7b509808 authorDarya Rednikina <rednikina.com@yandex.ru> dateMon 9 Dec 2019, 13:32 (7 years ago) parent1445be5
10 files changed+338−9
Hookah Tau.xcodeproj/project.pbxproj+68 Hookah Tau/Controllers/Admin/Clients/Cells/ClientTableViewCell.swift+24 Hookah Tau/Controllers/Admin/Clients/ClientsCoordinator.swift+17 Hookah Tau/Controllers/Admin/Clients/ClientsViewController.swift+19 Hookah Tau/Controllers/Admin/Reservations/AdminAddressCoordinator.swift+18 Hookah Tau/Controllers/Admin/Tab bar/Admin.storyboard+79 Hookah Tau/Controllers/Admin/Tab bar/AdminTabbarController.swift+48 Hookah Tau/Controllers/Admin/Tab bar/AdminTabbarCoordinator.swift+56 Hookah Tau/Controllers/Client/Tab bar/ClientTabbarController.swift+6−6 Hookah Tau/Controllers/Client/Tab bar/ClientTabbarCoordinator.swift+3−3
Hookah Tau.xcodeproj/project.pbxproj+68
@@ -28,6 +28,10 @@
2828 123615CF235510BC00D1122A /* ProfileView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 123615CE235510BC00D1122A /* ProfileView.xib */; };
2929 123615D12355141600D1122A /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123615D02355141600D1122A /* ProfileView.swift */; };
3030 12387337234BB98700D1F1AB /* CodeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 12387336234BB98700D1F1AB /* CodeView.xib */; };
31+ 123D25F0239E3E11002FA32B /* AdminAddressCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123D25EF239E3E11002FA32B /* AdminAddressCoordinator.swift */; };
32+ 123D25F2239E3E44002FA32B /* ClientsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123D25F1239E3E44002FA32B /* ClientsCoordinator.swift */; };
33+ 123D25F4239E3FF5002FA32B /* ClientsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123D25F3239E3FF5002FA32B /* ClientsViewController.swift */; };
34+ 123D25F7239E5839002FA32B /* ClientTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123D25F6239E5839002FA32B /* ClientTableViewCell.swift */; };
3135 1246B717235CD186004CBFA1 /* NoReservationsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1246B716235CD186004CBFA1 /* NoReservationsView.xib */; };
3236 1246B719235CD3AD004CBFA1 /* NoReservationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1246B718235CD3AD004CBFA1 /* NoReservationsView.swift */; };
3337 1246B71C235CDF3A004CBFA1 /* ReservationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1246B71B235CDF3A004CBFA1 /* ReservationCell.swift */; };
@@ -63,6 +67,9 @@
6367 12BD95B2237EC22B009614D8 /* FirstStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12BD95B1237EC22B009614D8 /* FirstStepView.swift */; };
6468 12BD95B6237ED8AC009614D8 /* TimePointView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 12BD95B5237ED8AB009614D8 /* TimePointView.xib */; };
6569 12BD95B8237EDB01009614D8 /* TimePointView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12BD95B7237EDB01009614D8 /* TimePointView.swift */; };
70+ 12BE4B332399A52E00FC974B /* AdminTabbarCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12BE4B322399A52E00FC974B /* AdminTabbarCoordinator.swift */; };
71+ 12BE4B352399A60A00FC974B /* AdminTabbarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12BE4B342399A60A00FC974B /* AdminTabbarController.swift */; };
72+ 12BE4B372399A98200FC974B /* Admin.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 12BE4B362399A98200FC974B /* Admin.storyboard */; };
6673 12C72EDF23537D1B00AD7004 /* ProfileCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12C72EDE23537D1B00AD7004 /* ProfileCoordinator.swift */; };
6774 12C72EE1235380D400AD7004 /* ProfileClientViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12C72EE0235380D400AD7004 /* ProfileClientViewController.swift */; };
6875 12C72EE3235380EB00AD7004 /* ReservationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12C72EE2235380EB00AD7004 /* ReservationsViewController.swift */; };
@@ -151,6 +158,10 @@
151158 123615CE235510BC00D1122A /* ProfileView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProfileView.xib; sourceTree = "<group>"; };
152159 123615D02355141600D1122A /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
153160 12387336234BB98700D1F1AB /* CodeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CodeView.xib; sourceTree = "<group>"; };
161+ 123D25EF239E3E11002FA32B /* AdminAddressCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdminAddressCoordinator.swift; sourceTree = "<group>"; };
162+ 123D25F1239E3E44002FA32B /* ClientsCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientsCoordinator.swift; sourceTree = "<group>"; };
163+ 123D25F3239E3FF5002FA32B /* ClientsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientsViewController.swift; sourceTree = "<group>"; };
164+ 123D25F6239E5839002FA32B /* ClientTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientTableViewCell.swift; sourceTree = "<group>"; };
154165 1246B716235CD186004CBFA1 /* NoReservationsView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NoReservationsView.xib; sourceTree = "<group>"; };
155166 1246B718235CD3AD004CBFA1 /* NoReservationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoReservationsView.swift; sourceTree = "<group>"; };
156167 1246B71B235CDF3A004CBFA1 /* ReservationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReservationCell.swift; sourceTree = "<group>"; };
@@ -185,6 +196,9 @@
185196 12BD95B1237EC22B009614D8 /* FirstStepView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstStepView.swift; sourceTree = "<group>"; };
186197 12BD95B5237ED8AB009614D8 /* TimePointView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TimePointView.xib; sourceTree = "<group>"; };
187198 12BD95B7237EDB01009614D8 /* TimePointView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimePointView.swift; sourceTree = "<group>"; };
199+ 12BE4B322399A52E00FC974B /* AdminTabbarCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdminTabbarCoordinator.swift; sourceTree = "<group>"; };
200+ 12BE4B342399A60A00FC974B /* AdminTabbarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdminTabbarController.swift; sourceTree = "<group>"; };
201+ 12BE4B362399A98200FC974B /* Admin.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Admin.storyboard; sourceTree = "<group>"; };
188202 12C72EDE23537D1B00AD7004 /* ProfileCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileCoordinator.swift; sourceTree = "<group>"; };
189203 12C72EE0235380D400AD7004 /* ProfileClientViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileClientViewController.swift; sourceTree = "<group>"; };
190204 12C72EE2235380EB00AD7004 /* ReservationsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReservationsViewController.swift; sourceTree = "<group>"; };
@@ -388,6 +402,39 @@
388402 path = Views;
389403 sourceTree = "<group>";
390404 };
405+ 123D25EC239E3D47002FA32B /* Profile */ = {
406+ isa = PBXGroup;
407+ children = (
408+ );
409+ path = Profile;
410+ sourceTree = "<group>";
411+ };
412+ 123D25ED239E3D50002FA32B /* Reservations */ = {
413+ isa = PBXGroup;
414+ children = (
415+ 123D25EF239E3E11002FA32B /* AdminAddressCoordinator.swift */,
416+ );
417+ path = Reservations;
418+ sourceTree = "<group>";
419+ };
420+ 123D25EE239E3D61002FA32B /* Clients */ = {
421+ isa = PBXGroup;
422+ children = (
423+ 123D25F5239E57D6002FA32B /* Cells */,
424+ 123D25F1239E3E44002FA32B /* ClientsCoordinator.swift */,
425+ 123D25F3239E3FF5002FA32B /* ClientsViewController.swift */,
426+ );
427+ path = Clients;
428+ sourceTree = "<group>";
429+ };
430+ 123D25F5239E57D6002FA32B /* Cells */ = {
431+ isa = PBXGroup;
432+ children = (
433+ 123D25F6239E5839002FA32B /* ClientTableViewCell.swift */,
434+ );
435+ path = Cells;
436+ sourceTree = "<group>";
437+ };
391438 1246B71A235CD4C5004CBFA1 /* Views */ = {
392439 isa = PBXGroup;
393440 children = (
@@ -483,6 +530,16 @@
483530 path = 1;
484531 sourceTree = "<group>";
485532 };
533+ 12BE4B312399A51500FC974B /* Tab bar */ = {
534+ isa = PBXGroup;
535+ children = (
536+ 12BE4B322399A52E00FC974B /* AdminTabbarCoordinator.swift */,
537+ 12BE4B342399A60A00FC974B /* AdminTabbarController.swift */,
538+ 12BE4B362399A98200FC974B /* Admin.storyboard */,
539+ );
540+ path = "Tab bar";
541+ sourceTree = "<group>";
542+ };
486543 12C72EDB235367CF00AD7004 /* Tab bar */ = {
487544 isa = PBXGroup;
488545 children = (
@@ -609,6 +666,10 @@
609666 F30369BB2336845F00A8EA84 /* Admin */ = {
610667 isa = PBXGroup;
611668 children = (
669+ 123D25ED239E3D50002FA32B /* Reservations */,
670+ 123D25EE239E3D61002FA32B /* Clients */,
671+ 123D25EC239E3D47002FA32B /* Profile */,
672+ 12BE4B312399A51500FC974B /* Tab bar */,
612673 );
613674 path = Admin;
614675 sourceTree = "<group>";
@@ -859,6 +920,7 @@
859920 buildActionMask = 2147483647;
860921 files = (
861922 F3199E5B233FE08200F3C17A /* PhoneView.xib in Resources */,
923+ 12BE4B372399A98200FC974B /* Admin.storyboard in Resources */,
862924 12DBEEB223539F2100AF1BB6 /* Client.storyboard in Resources */,
863925 12D8FA2D237F003800305F57 /* DateView.xib in Resources */,
864926 12387337234BB98700D1F1AB /* CodeView.xib in Resources */,
@@ -915,13 +977,17 @@
915977 125AE51F2395585300F847BD /* ChangeReservationViewController.swift in Sources */,
916978 12EA99462362B674005D9FE9 /* AddressCoordinator.swift in Sources */,
917979 12B6A613235B9B4300898B31 /* BaseViewController.swift in Sources */,
980+ 12BE4B332399A52E00FC974B /* AdminTabbarCoordinator.swift in Sources */,
918981 12230AFA23901029004A01E5 /* DataStorage.swift in Sources */,
919982 F3FC7DFF2315C8D70080D851 /* NameCoordinator.swift in Sources */,
983+ 123D25F7239E5839002FA32B /* ClientTableViewCell.swift in Sources */,
920984 120BFC7C23891965001EBE89 /* ThirdStepView.swift in Sources */,
985+ 123D25F0239E3E11002FA32B /* AdminAddressCoordinator.swift in Sources */,
921986 F3FC7DCF2315BE610080D851 /* NameViewController.swift in Sources */,
922987 12838EB82367834900CEF108 /* MyCodable.swift in Sources */,
923988 F3DC5A05233E89D500B5E751 /* Button.swift in Sources */,
924989 F3FC7DFB2315C25D0080D851 /* ApplicationCoordinator.swift in Sources */,
990+ 12BE4B352399A60A00FC974B /* AdminTabbarController.swift in Sources */,
925991 12FC403A2382CB6F00AB593B /* TableButton.swift in Sources */,
926992 12EB698123661CB300E4D1CE /* AddressCell.swift in Sources */,
927993 F3895F48233D2EEA00FA6A37 /* CodeSmsViewController.swift in Sources */,
@@ -937,9 +1003,11 @@
9371003 12A075FD237357E900D749BB /* FirstStepReservationCoordinator.swift in Sources */,
9381004 124D0081237222C900AE76B9 /* ReservationsService.swift in Sources */,
9391005 1246B720235CDF9E004CBFA1 /* ReservationView.swift in Sources */,
1006+ 123D25F4239E3FF5002FA32B /* ClientsViewController.swift in Sources */,
9401007 12050569238048CE00801618 /* Extensions+Date.swift in Sources */,
9411008 124D007C23721FD400AE76B9 /* Reservation.swift in Sources */,
9421009 12D8FA2F237F00E200305F57 /* DateView.swift in Sources */,
1010+ 123D25F2239E3E44002FA32B /* ClientsCoordinator.swift in Sources */,
9431011 12F9652E23869F3100FCA696 /* SecondStepReservationCoordinator.swift in Sources */,
9441012 F3895F4E233D348B00FA6A37 /* PhoneCoordinator.swift in Sources */,
9451013 12B6A617235BB37D00898B31 /* ChangeView.swift in Sources */,
Hookah Tau/Controllers/Admin/Clients/Cells/ClientTableViewCell.swiftnew file+24
@@ -0,0 +1,24 @@
1+//
2+// ClientTableViewCell.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 09/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import UIKit
10+
11+class ClientTableViewCell: UITableViewCell {
12+
13+ override func awakeFromNib() {
14+ super.awakeFromNib()
15+ // Initialization code
16+ }
17+
18+ override func setSelected(_ selected: Bool, animated: Bool) {
19+ super.setSelected(selected, animated: animated)
20+
21+ // Configure the view for the selected state
22+ }
23+
24+}
Hookah Tau/Controllers/Admin/Clients/ClientsCoordinator.swiftnew file+17
@@ -0,0 +1,17 @@
1+//
2+// ClientsCoordinator.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 09/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import Foundation
10+
11+
12+class ClientsCoordinator: BaseCoordinator {
13+
14+ override func start() {
15+ //
16+ }
17+}
Hookah Tau/Controllers/Admin/Clients/ClientsViewController.swiftnew file+19
@@ -0,0 +1,19 @@
1+//
2+// ClientsViewController.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 09/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import UIKit
10+
11+class ClientsViewController: UIViewController {
12+
13+ override func viewDidLoad() {
14+ super.viewDidLoad()
15+
16+ // Do any additional setup after loading the view.
17+ }
18+
19+}
Hookah Tau/Controllers/Admin/Reservations/AdminAddressCoordinator.swiftnew file+18
@@ -0,0 +1,18 @@
1+//
2+// AdminAddressCoordinator.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 09/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import Foundation
10+
11+class AdminAddressCoordinator: BaseCoordinator {
12+
13+ override func start() {
14+ //
15+ }
16+
17+
18+}
Hookah Tau/Controllers/Admin/Tab bar/Admin.storyboardnew file+79
@@ -0,0 +1,79 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3+ <device id="retina6_1" orientation="portrait" appearance="light"/>
4+ <dependencies>
5+ <deployment identifier="iOS"/>
6+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
7+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9+ </dependencies>
10+ <scenes>
11+ <!--View Controller-->
12+ <scene sceneID="Q3i-Bo-7ns">
13+ <objects>
14+ <viewController id="Ifn-72-mgx" sceneMemberID="viewController">
15+ <view key="view" contentMode="scaleToFill" id="R2t-qa-IDx">
16+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
17+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+ <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
19+ <viewLayoutGuide key="safeArea" id="yHG-bf-ndj"/>
20+ </view>
21+ <tabBarItem key="tabBarItem" systemItem="downloads" id="9K1-uc-72H"/>
22+ </viewController>
23+ <placeholder placeholderIdentifier="IBFirstResponder" id="8X9-ca-bCi" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
24+ </objects>
25+ <point key="canvasLocation" x="1061" y="-327"/>
26+ </scene>
27+ <!--View Controller-->
28+ <scene sceneID="cAb-sw-24k">
29+ <objects>
30+ <viewController id="Jsm-cH-XbJ" sceneMemberID="viewController">
31+ <view key="view" contentMode="scaleToFill" id="s24-jW-vhb">
32+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
33+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
34+ <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
35+ <viewLayoutGuide key="safeArea" id="f96-UV-eoi"/>
36+ </view>
37+ <tabBarItem key="tabBarItem" systemItem="contacts" id="ziF-T0-lg1"/>
38+ </viewController>
39+ <placeholder placeholderIdentifier="IBFirstResponder" id="qqi-vY-Mog" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
40+ </objects>
41+ <point key="canvasLocation" x="1061" y="433"/>
42+ </scene>
43+ <!--View Controller-->
44+ <scene sceneID="p6D-Gs-DUK">
45+ <objects>
46+ <viewController id="Tc3-UW-Fwi" sceneMemberID="viewController">
47+ <view key="view" contentMode="scaleToFill" id="dmc-GR-czf">
48+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
49+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
50+ <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
51+ <viewLayoutGuide key="safeArea" id="z8c-Ub-USh"/>
52+ </view>
53+ <tabBarItem key="tabBarItem" systemItem="mostViewed" id="szW-oN-ixR"/>
54+ </viewController>
55+ <placeholder placeholderIdentifier="IBFirstResponder" id="1ST-zr-4Zs" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
56+ </objects>
57+ <point key="canvasLocation" x="1062" y="-1047"/>
58+ </scene>
59+ <!--Admin Tabbar Controller-->
60+ <scene sceneID="cWI-V1-4ZB">
61+ <objects>
62+ <tabBarController storyboardIdentifier="AdminTabbarController" id="mgG-ir-mFF" customClass="AdminTabbarController" customModule="Hookah_Tau" customModuleProvider="target" sceneMemberID="viewController">
63+ <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="src-m7-O6h">
64+ <rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
65+ <autoresizingMask key="autoresizingMask"/>
66+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
67+ </tabBar>
68+ <connections>
69+ <segue destination="Tc3-UW-Fwi" kind="relationship" relationship="viewControllers" id="K4a-6A-WdW"/>
70+ <segue destination="Ifn-72-mgx" kind="relationship" relationship="viewControllers" id="NdV-rq-bli"/>
71+ <segue destination="Jsm-cH-XbJ" kind="relationship" relationship="viewControllers" id="2PQ-04-zRb"/>
72+ </connections>
73+ </tabBarController>
74+ <placeholder placeholderIdentifier="IBFirstResponder" id="oiC-tc-RNa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
75+ </objects>
76+ <point key="canvasLocation" x="-817" y="-251"/>
77+ </scene>
78+ </scenes>
79+</document>
Hookah Tau/Controllers/Admin/Tab bar/AdminTabbarController.swiftnew file+48
@@ -0,0 +1,48 @@
1+//
2+// AdminTabbarController.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 05/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import UIKit
10+
11+class AdminTabbarController: UITabBarController {
12+
13+ // MARK: - Properties
14+
15+ var onViewDidLoad: TabbarClosure?
16+ var onReservationsFlow: TabbarClosure?
17+ var onClientsFlow: TabbarClosure?
18+ var onProfileFlow: TabbarClosure?
19+
20+ // MARK: - Lifecycle
21+
22+ override func viewDidLoad() {
23+ super.viewDidLoad()
24+
25+ delegate = self
26+ if let controller = customizableViewControllers?.first as? UINavigationController {
27+ onViewDidLoad?(controller)
28+ }
29+ }
30+
31+ func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)
32+ {
33+
34+ guard let controller = viewControllers?[selectedIndex] as? UINavigationController else { return }
35+
36+ switch selectedIndex {
37+ case 0:
38+ onReservationsFlow?(controller)
39+ case 1:
40+ onClientsFlow?(controller)
41+ default:
42+ onProfileFlow?(controller)
43+ }
44+ }
45+
46+}
47+
48+extension AdminTabbarController: UITabBarControllerDelegate {}
Hookah Tau/Controllers/Admin/Tab bar/AdminTabbarCoordinator.swiftnew file+56
@@ -0,0 +1,56 @@
1+//
2+// AdminTabbarCoordinator.swift
3+// Hookah Tau
4+//
5+// Created by cstore on 05/12/2019.
6+// Copyright © 2019 Daria Rednikina. All rights reserved.
7+//
8+
9+import UIKit
10+
11+
12+class AdminTabbarCoordinator: BaseCoordinator {
13+
14+ /// Мы тут определяем что происходит с таббарами
15+ override func start() {
16+ let storyboard = UIStoryboard(name: "Admin", bundle: nil)
17+ let tabbarView = storyboard.instantiateViewController(withIdentifier: "AdminTabbarController") as? AdminTabbarController
18+
19+ tabbarView?.onViewDidLoad = runReservationsFlow()
20+ tabbarView?.onClientsFlow = runClientsFlow()
21+ tabbarView?.onProfileFlow = runProfileFlow()
22+ tabbarView?.onReservationsFlow = runReservationsFlow()
23+
24+ let appDelegate = UIApplication.shared.delegate as? AppDelegate
25+ guard let appD = appDelegate else { return }
26+ appD.window?.rootViewController = tabbarView
27+ }
28+
29+ private func runReservationsFlow() -> TabbarClosure {
30+ print("reserv")
31+ return { [unowned self] navigationController in
32+ if navigationController.viewControllers.isEmpty {
33+
34+ }
35+ }
36+ }
37+
38+ private func runClientsFlow() -> TabbarClosure {
39+ print("client")
40+ return { [unowned self] navigationController in
41+ if navigationController.viewControllers.isEmpty {
42+
43+ }
44+ }
45+ }
46+
47+ private func runProfileFlow() -> TabbarClosure {
48+ print("prof")
49+ return { [unowned self] navigationController in
50+ if navigationController.viewControllers.isEmpty {
51+
52+ }
53+ }
54+ }
55+
56+}
Hookah Tau/Controllers/Client/Tab bar/ClientTabbarController.swift+6−6
@@ -10,18 +10,18 @@ import Foundation
1010import UIKit
1111
1212protocol TabbarView: class {
13− var onReservationFlowSelect: ((UINavigationController) -> ())? { get set }
14− var onProfileFlowSelect: ((UINavigationController) -> ())? { get set }
15− var onViewDidLoad: ((UINavigationController) -> ())? { get set }
13+ var onReservationFlowSelect: TabbarClosure? { get set }
14+ var onProfileFlowSelect: TabbarClosure? { get set }
15+ var onViewDidLoad: TabbarClosure? { get set }
1616}
1717
1818final class ClientTabbarController: UITabBarController, UITabBarControllerDelegate, TabbarView {
1919
2020 // MARK: - Properties
2121
22− var onReservationFlowSelect: ((UINavigationController) -> ())?
23− var onProfileFlowSelect: ((UINavigationController) -> ())?
24− var onViewDidLoad: ((UINavigationController) -> ())?
22+ var onReservationFlowSelect: TabbarClosure?
23+ var onProfileFlowSelect: TabbarClosure?
24+ var onViewDidLoad: TabbarClosure?
2525
2626
2727 // MARK: - Lifecycle
Hookah Tau/Controllers/Client/Tab bar/ClientTabbarCoordinator.swift+3−3
@@ -8,10 +8,10 @@
88
99import UIKit
1010
11+typealias TabbarClosure = ((UINavigationController) -> ())
12+
1113class ClientTabbarCoordinator: BaseCoordinator {
1214
13− typealias TabbarClosure = ((UINavigationController) -> ())
14−
1515 // MARK: - Lifecycle
1616
1717 override func start() {
@@ -37,7 +37,7 @@ class ClientTabbarCoordinator: BaseCoordinator {
3737 }
3838 }
3939
40− private func runProfileFlow() -> TabbarClosure{
40+ private func runProfileFlow() -> TabbarClosure {
4141 return { navigationController in
4242 if navigationController.viewControllers.isEmpty {
4343 let profileCoordinator = ProfileCoordinator(navigationController: navigationController)