Skip to content

Commit 887a646

Browse files
Merge pull request #17 from htmlprogrammist/develop
Release 2.3
2 parents 607570e + 59accfc commit 887a646

File tree

67 files changed

+1580
-293
lines changed

Some content is hidden

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

67 files changed

+1580
-293
lines changed

Agenda.xcodeproj/project.pbxproj

Lines changed: 228 additions & 31 deletions
Large diffs are not rendered by default.

Agenda.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 16 deletions
This file was deleted.
Binary file not shown.

Agenda.xcodeproj/xcuserdata/egbad.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@
99
<key>orderHint</key>
1010
<integer>0</integer>
1111
</dict>
12+
<key>PlaygroundChart (Playground) 1.xcscheme</key>
13+
<dict>
14+
<key>isShown</key>
15+
<false/>
16+
<key>orderHint</key>
17+
<integer>2</integer>
18+
</dict>
19+
<key>PlaygroundChart (Playground) 2.xcscheme</key>
20+
<dict>
21+
<key>isShown</key>
22+
<false/>
23+
<key>orderHint</key>
24+
<integer>3</integer>
25+
</dict>
26+
<key>PlaygroundChart (Playground).xcscheme</key>
27+
<dict>
28+
<key>isShown</key>
29+
<false/>
30+
<key>orderHint</key>
31+
<integer>1</integer>
32+
</dict>
1233
</dict>
1334
<key>SuppressBuildableAutocreation</key>
1435
<dict>

Agenda.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Binary file not shown.

Agenda/Application/AppCoordinator.swift

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,36 @@
88
import UIKit
99

1010
final class AppCoordinator {
11-
11+
/// Service is used for using Core Data in the project
1212
public let coreDataManager = CoreDataManager(containerName: "Agenda")
13+
/// View controllers to set in the tab bar controller
1314
public var viewControllers = [UIViewController]()
1415

16+
/// `UIWindow` of the application, provided from the SceneDelegate
1517
private let window: UIWindow
18+
/// Root view controller of the application
1619
private let tabBarController = UITabBarController()
1720

1821
init(window: UIWindow) {
1922
self.window = window
2023
}
2124

25+
/// This method setup tab bar controller with 3 modules and set root view controller for the `UIWindow`
2226
func start() {
2327
setupAgenda()
2428
setupHistory()
2529
setupSummary()
2630

31+
/// Setup tab bar appearence like in earlier versions of iOS, because in iOS 15 it does not look good
32+
if #available(iOS 15.0, *) {
33+
let appearance = UITabBarAppearance()
34+
appearance.configureWithOpaqueBackground()
35+
appearance.backgroundColor = .systemBackground
36+
tabBarController.tabBar.standardAppearance = appearance
37+
tabBarController.tabBar.scrollEdgeAppearance = appearance
38+
}
2739
tabBarController.setViewControllers(viewControllers, animated: false)
40+
2841
window.rootViewController = tabBarController
2942
window.makeKeyAndVisible()
3043
}
@@ -37,7 +50,6 @@ private extension AppCoordinator {
3750

3851
let agendaViewController = createNavController(viewController: container.viewController, itemName: Labels.goals, itemImage: Icons.calendar)
3952
viewControllers.append(agendaViewController)
40-
subscribeToCoreDataManager(vc: container.viewController)
4153
}
4254

4355
func setupHistory() {
@@ -46,27 +58,20 @@ private extension AppCoordinator {
4658

4759
let historyViewController = createNavController(viewController: container.viewController, itemName: Labels.History.title, itemImage: Icons.history)
4860
viewControllers.append(historyViewController)
49-
subscribeToCoreDataManager(vc: container.viewController)
5061
}
5162

5263
func setupSummary() {
5364
let context = SummaryContext(moduleOutput: nil, moduleDependency: coreDataManager)
5465
let container = SummaryContainer.assemble(with: context)
5566
let summaryViewController = createNavController(viewController: container.viewController, itemName: Labels.Summary.title, itemImage: Icons.summary)
5667
viewControllers.append(summaryViewController)
57-
subscribeToCoreDataManager(vc: container.viewController)
5868
}
5969

70+
/// Creates navigation controller and set tab bar item to it
6071
func createNavController(viewController: UIViewController, itemName: String, itemImage: UIImage) -> UINavigationController {
61-
6272
let navController = UINavigationController(rootViewController: viewController)
6373
navController.tabBarItem = UITabBarItem(title: itemName, image: itemImage, tag: 0)
6474
navController.navigationBar.prefersLargeTitles = true
6575
return navController
6676
}
67-
68-
func subscribeToCoreDataManager(vc: UIViewController) {
69-
guard let vc = vc as? CoreDataManagerDelegate else { return }
70-
coreDataManager.viewControllers.append(vc)
71-
}
7277
}

Agenda/Extensions/Date.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import Foundation
99

1010
extension Date {
11+
/// Format date with format `dd.MM.yyyy` to the provided template with the first capitalized letter
1112
func formatTo(_ template: String) -> String {
1213
let dateFormatter = DateFormatter()
1314
dateFormatter.dateFormat = "dd.MM.yyyy"

Agenda/Extensions/String.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import Foundation
99

1010
extension String {
11-
// For simplify localizing texts in the whole application
11+
/// For simplify localizing texts in the whole application
1212
var localized: String {
1313
NSLocalizedString(self, comment: "")
1414
}
15-
15+
/// Capitalizes first letter of the string
1616
func capitalizingFirstLetter() -> String {
1717
return prefix(1).uppercased() + self.lowercased().dropFirst()
1818
}

0 commit comments

Comments
 (0)