Commit 8efb6edf by Demid Merzlyakov

Access control modifiers fixed + a potential retain cycle addressed.

parent 45c34fb1
......@@ -7,26 +7,26 @@
import UIKit
class TodayCoordinator:Coordinator {
//Private
class TodayCoordinator: Coordinator {
// MARK: - Private
private let navigationController = UINavigationController(nibName: nil, bundle: nil)
private var tabBarController:UITabBarController?
//Public
var childCoordinators = [Coordinator]()
var parentCoordinator: Coordinator?
// MARK: - Public
public var childCoordinators = [Coordinator]()
public var parentCoordinator: Coordinator?
init(tabBarController:UITabBarController) {
public init(tabBarController:UITabBarController) {
self.tabBarController = tabBarController
}
func start() {
public func start() {
let todayViewController = TodayViewController(coordinator: self)
navigationController.viewControllers = [todayViewController]
tabBarController?.add(viewController: navigationController)
}
func openLocationsSearch() {
public func openLocationsSearch() {
let searchCoordinator = LocationSearchCoordinator(parentViewController: navigationController)
searchCoordinator.parentCoordinator = self
searchCoordinator.start()
......
......@@ -21,7 +21,7 @@ public class LocationManager {
private let weatherUpdateSource: WeatherSource
private let healthSource: HealthSource
private let nwsAlertsManager: NWSAlertsManager
public let nwsAlertsManager: NWSAlertsManager
private let storage: Storage
private var defaultLocation = Location(deviceLocation: false,
coordinates: .init(latitude: 37.3230, longitude: -122.0322), // Cupertino
......
......@@ -29,6 +29,7 @@ class TodayViewController: UIViewController {
super.init(nibName: nil, bundle: nil)
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
......@@ -65,8 +66,8 @@ private extension TodayViewController {
func prepareViewController() {
view.backgroundColor = ThemeManager.currentTheme.baseBackgroundColor
localizationObserver = NotificationCenter.default.addObserver(forName: .localizationChange, object: nil, queue: .main, using: { _ in
self.tableView.reloadData()
localizationObserver = NotificationCenter.default.addObserver(forName: .localizationChange, object: nil, queue: .main, using: { [weak self] _ in
self?.tableView.reloadData()
})
}
......
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