Skip to content

Commit c97dcbe

Browse files
committed
- root
- tabbar init - r.swift
1 parent accb4cc commit c97dcbe

File tree

62 files changed

+2184
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2184
-145
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Atter.xcworkspace/xcuserdata
2+
Atter.xcodeproj/xcuserdata
3+
Pods/Pods.xcodeproj/xcuserdata

Atter.xcodeproj/project.pbxproj

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
8F74564022E1B050003B9C1D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F74563F22E1B050003B9C1D /* AppDelegate.swift */; };
1111
8F74564722E1B051003B9C1D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F74564622E1B051003B9C1D /* Assets.xcassets */; };
1212
8F74564A22E1B051003B9C1D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F74564822E1B051003B9C1D /* LaunchScreen.storyboard */; };
13+
8FD7C8E522E21B050019B532 /* AtterTabBarRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E222E21B050019B532 /* AtterTabBarRouter.swift */; };
14+
8FD7C8E622E21B050019B532 /* AtterTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E322E21B050019B532 /* AtterTabBarViewController.swift */; };
15+
8FD7C8E722E21B050019B532 /* AtterTabBarConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E422E21B050019B532 /* AtterTabBarConfigurator.swift */; };
16+
8FD7C8EB22E21C880019B532 /* R.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8EA22E21C880019B532 /* R.generated.swift */; };
17+
8FD7C8EE22E21D080019B532 /* RootRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8ED22E21D080019B532 /* RootRouter.swift */; };
1318
E314BD30BBAF1CE6474593C7 /* Pods_Atter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3B08D871FB59595CB29583 /* Pods_Atter.framework */; };
1419
/* End PBXBuildFile section */
1520

@@ -21,6 +26,11 @@
2126
8F74564622E1B051003B9C1D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2227
8F74564922E1B051003B9C1D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2328
8F74564B22E1B051003B9C1D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
29+
8FD7C8E222E21B050019B532 /* AtterTabBarRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarRouter.swift; sourceTree = "<group>"; };
30+
8FD7C8E322E21B050019B532 /* AtterTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarViewController.swift; sourceTree = "<group>"; };
31+
8FD7C8E422E21B050019B532 /* AtterTabBarConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarConfigurator.swift; sourceTree = "<group>"; };
32+
8FD7C8EA22E21C880019B532 /* R.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = R.generated.swift; path = Generated/R.generated.swift; sourceTree = SOURCE_ROOT; };
33+
8FD7C8ED22E21D080019B532 /* RootRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootRouter.swift; sourceTree = "<group>"; };
2434
984D26E540D2C3B37C439E9A /* Pods-Atter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Atter.debug.xcconfig"; path = "Target Support Files/Pods-Atter/Pods-Atter.debug.xcconfig"; sourceTree = "<group>"; };
2535
/* End PBXFileReference section */
2636

@@ -74,6 +84,9 @@
7484
8F74563E22E1B050003B9C1D /* Atter */ = {
7585
isa = PBXGroup;
7686
children = (
87+
8FD7C8EC22E21CE40019B532 /* Root */,
88+
8FD7C8E922E21C380019B532 /* Generated */,
89+
8FD7C8D322E21A980019B532 /* Tab Bar */,
7790
8F74565622E1B1A4003B9C1D /* Shared */,
7891
8F74565522E1B19C003B9C1D /* Supporting Files */,
7992
8F74565422E1B191003B9C1D /* Resources */,
@@ -114,6 +127,32 @@
114127
path = Delegates;
115128
sourceTree = "<group>";
116129
};
130+
8FD7C8D322E21A980019B532 /* Tab Bar */ = {
131+
isa = PBXGroup;
132+
children = (
133+
8FD7C8E222E21B050019B532 /* AtterTabBarRouter.swift */,
134+
8FD7C8E322E21B050019B532 /* AtterTabBarViewController.swift */,
135+
8FD7C8E422E21B050019B532 /* AtterTabBarConfigurator.swift */,
136+
);
137+
path = "Tab Bar";
138+
sourceTree = "<group>";
139+
};
140+
8FD7C8E922E21C380019B532 /* Generated */ = {
141+
isa = PBXGroup;
142+
children = (
143+
8FD7C8EA22E21C880019B532 /* R.generated.swift */,
144+
);
145+
path = Generated;
146+
sourceTree = "<group>";
147+
};
148+
8FD7C8EC22E21CE40019B532 /* Root */ = {
149+
isa = PBXGroup;
150+
children = (
151+
8FD7C8ED22E21D080019B532 /* RootRouter.swift */,
152+
);
153+
path = Root;
154+
sourceTree = "<group>";
155+
};
117156
/* End PBXGroup section */
118157

119158
/* Begin PBXNativeTarget section */
@@ -122,10 +161,12 @@
122161
buildConfigurationList = 8F74564E22E1B051003B9C1D /* Build configuration list for PBXNativeTarget "Atter" */;
123162
buildPhases = (
124163
870EFA60EB091353C50386AF /* [CP] Check Pods Manifest.lock */,
164+
8FD7C8E822E21C060019B532 /* Run R.swift */,
125165
8F74563822E1B050003B9C1D /* Sources */,
126166
8F74563922E1B050003B9C1D /* Frameworks */,
127167
8F74563A22E1B050003B9C1D /* Resources */,
128168
8F74565322E1B14D003B9C1D /* Run SwiftLint */,
169+
CCDAAFCDA4811C812C1DC979 /* [CP] Embed Pods Frameworks */,
129170
);
130171
buildRules = (
131172
);
@@ -222,6 +263,43 @@
222263
shellPath = /bin/sh;
223264
shellScript = "${PODS_ROOT}/SwiftLint/swiftlint\n";
224265
};
266+
8FD7C8E822E21C060019B532 /* Run R.swift */ = {
267+
isa = PBXShellScriptBuildPhase;
268+
buildActionMask = 2147483647;
269+
files = (
270+
);
271+
inputFileListPaths = (
272+
);
273+
inputPaths = (
274+
"$TEMP_DIR/rswift-lastrun",
275+
);
276+
name = "Run R.swift";
277+
outputFileListPaths = (
278+
);
279+
outputPaths = (
280+
$SRCROOT/Generated/R.generated.swift,
281+
);
282+
runOnlyForDeploymentPostprocessing = 0;
283+
shellPath = /bin/sh;
284+
shellScript = "\"$PODS_ROOT/R.swift/rswift\" generate \"$SRCROOT/Generated/R.generated.swift\"\n";
285+
};
286+
CCDAAFCDA4811C812C1DC979 /* [CP] Embed Pods Frameworks */ = {
287+
isa = PBXShellScriptBuildPhase;
288+
buildActionMask = 2147483647;
289+
files = (
290+
);
291+
inputFileListPaths = (
292+
"${PODS_ROOT}/Target Support Files/Pods-Atter/Pods-Atter-frameworks-${CONFIGURATION}-input-files.xcfilelist",
293+
);
294+
name = "[CP] Embed Pods Frameworks";
295+
outputFileListPaths = (
296+
"${PODS_ROOT}/Target Support Files/Pods-Atter/Pods-Atter-frameworks-${CONFIGURATION}-output-files.xcfilelist",
297+
);
298+
runOnlyForDeploymentPostprocessing = 0;
299+
shellPath = /bin/sh;
300+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Atter/Pods-Atter-frameworks.sh\"\n";
301+
showEnvVarsInLog = 0;
302+
};
225303
/* End PBXShellScriptBuildPhase section */
226304

227305
/* Begin PBXSourcesBuildPhase section */
@@ -230,6 +308,11 @@
230308
buildActionMask = 2147483647;
231309
files = (
232310
8F74564022E1B050003B9C1D /* AppDelegate.swift in Sources */,
311+
8FD7C8E622E21B050019B532 /* AtterTabBarViewController.swift in Sources */,
312+
8FD7C8EB22E21C880019B532 /* R.generated.swift in Sources */,
313+
8FD7C8E522E21B050019B532 /* AtterTabBarRouter.swift in Sources */,
314+
8FD7C8EE22E21D080019B532 /* RootRouter.swift in Sources */,
315+
8FD7C8E722E21B050019B532 /* AtterTabBarConfigurator.swift in Sources */,
233316
);
234317
runOnlyForDeploymentPostprocessing = 0;
235318
};

Atter.xcodeproj/xcuserdata/patrykmieszala.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 0 additions & 14 deletions
This file was deleted.

Atter/Root/RootRouter.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// RootRouter.swift
3+
// Atter
4+
//
5+
// Created by Patryk Mieszała on 19/07/2019.
6+
// Copyright (c) 2019 Patryk Mieszała. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
final class RootRouter {
12+
var window: UIWindow?
13+
14+
init(window: UIWindow) {
15+
self.window = window
16+
}
17+
}
18+
19+
extension RootRouter {
20+
func navigateToTabBar() {
21+
let tabBar = AtterTabBarConfigurator().configureAtterTabBarModule()
22+
23+
window?.rootViewController = tabBar
24+
}
25+
}

Atter/Shared/Delegates/AppDelegate.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ import UIKit
1111
@UIApplicationMain
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
1313

14-
var window: UIWindow?
14+
var rootRouter: RootRouter?
1515

1616
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1717
// Override point for customization after application launch.
18+
19+
let window = UIWindow()
20+
window.makeKeyAndVisible()
21+
22+
let router = RootRouter(window: window)
23+
router.navigateToTabBar()
24+
self.rootRouter = router
25+
1826
return true
1927
}
2028
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// AtterTabBarConfigurator.swift
3+
// Atter
4+
//
5+
// Created by Patryk Mieszała on 19/07/2019.
6+
// Copyright © 2019 Patryk Mieszała. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
final class AtterTabBarConfigurator {
12+
func configureAtterTabBarModule() -> AtterTabBarViewController {
13+
let viewController: AtterTabBarViewController = AtterTabBarViewController()
14+
let router: AtterTabBarRouter = AtterTabBarRouter(viewController: viewController)
15+
// let viewModel: AtterTabBarViewModel = container.forceResolve(arguments: viewController as AtterTabBarPresenter)
16+
17+
viewController.router = router
18+
// viewController.viewModel = viewModel
19+
20+
//TODO: move view controllers configuration to separate modules
21+
let eventsVC = UIViewController()
22+
eventsVC.view.backgroundColor = .white
23+
eventsVC.tabBarItem.title = "Events"
24+
25+
let peopleVC = UIViewController()
26+
peopleVC.view.backgroundColor = .brown
27+
peopleVC.tabBarItem.title = "People"
28+
29+
viewController.viewControllers = [eventsVC, peopleVC]
30+
31+
return viewController
32+
}
33+
}

Atter/Tab Bar/AtterTabBarRouter.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// AtterTabBarRouter.swift
3+
// Atter
4+
//
5+
// Created by Patryk Mieszała on 19/07/2019.
6+
// Copyright (c) 2019 Patryk Mieszała. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
final class AtterTabBarRouter {
12+
13+
weak var viewController: AtterTabBarViewController?
14+
15+
init(viewController: AtterTabBarViewController?) {
16+
self.viewController = viewController
17+
}
18+
}
19+
20+
extension AtterTabBarRouter {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// AtterTabBarViewController.swift
3+
// Atter
4+
//
5+
// Created by Patryk Mieszała on 19/07/2019.
6+
// Copyright (c) 2019 Patryk Mieszała. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
final class AtterTabBarViewController: UITabBarController {
12+
// var viewModel: AtterTabBarViewModel?
13+
var router: AtterTabBarRouter?
14+
}
15+
16+
//extension AtterTabBarViewController: AtterTabBarPresenter {}

Generated/R.generated.swift

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//
2+
// This is a generated file, do not edit!
3+
// Generated by R.swift, see https://github.com/mac-cain13/R.swift
4+
//
5+
6+
import Foundation
7+
import Rswift
8+
import UIKit
9+
10+
/// This `R` struct is generated and contains references to static resources.
11+
struct R: Rswift.Validatable {
12+
fileprivate static let applicationLocale = hostingBundle.preferredLocalizations.first.flatMap(Locale.init) ?? Locale.current
13+
fileprivate static let hostingBundle = Bundle(for: R.Class.self)
14+
15+
static func validate() throws {
16+
try intern.validate()
17+
}
18+
19+
/// This `R.storyboard` struct is generated, and contains static references to 1 storyboards.
20+
struct storyboard {
21+
/// Storyboard `LaunchScreen`.
22+
static let launchScreen = _R.storyboard.launchScreen()
23+
24+
/// `UIStoryboard(name: "LaunchScreen", bundle: ...)`
25+
static func launchScreen(_: Void = ()) -> UIKit.UIStoryboard {
26+
return UIKit.UIStoryboard(resource: R.storyboard.launchScreen)
27+
}
28+
29+
fileprivate init() {}
30+
}
31+
32+
fileprivate struct intern: Rswift.Validatable {
33+
fileprivate static func validate() throws {
34+
try _R.validate()
35+
}
36+
37+
fileprivate init() {}
38+
}
39+
40+
fileprivate class Class {}
41+
42+
fileprivate init() {}
43+
}
44+
45+
struct _R: Rswift.Validatable {
46+
static func validate() throws {
47+
try storyboard.validate()
48+
}
49+
50+
struct storyboard: Rswift.Validatable {
51+
static func validate() throws {
52+
try launchScreen.validate()
53+
}
54+
55+
struct launchScreen: Rswift.StoryboardResourceWithInitialControllerType, Rswift.Validatable {
56+
typealias InitialController = UIKit.UIViewController
57+
58+
let bundle = R.hostingBundle
59+
let name = "LaunchScreen"
60+
61+
static func validate() throws {
62+
if #available(iOS 11.0, *) {
63+
}
64+
}
65+
66+
fileprivate init() {}
67+
}
68+
69+
fileprivate init() {}
70+
}
71+
72+
fileprivate init() {}
73+
}

0 commit comments

Comments
 (0)