Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
8efb6edf
Commit
8efb6edf
authored
Apr 24, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Access control modifiers fixed + a potential retain cycle addressed.
parent
45c34fb1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
1Weather/Coordinators/TodayCoordinator.swift
+8
-8
1Weather/Model/LocationManager.swift
+1
-1
1Weather/UI/View controllers/Today/TodayViewController.swift
+3
-2
No files found.
1Weather/Coordinators/TodayCoordinator.swift
View file @
8efb6edf
...
@@ -7,26 +7,26 @@
...
@@ -7,26 +7,26 @@
import
UIKit
import
UIKit
class
TodayCoordinator
:
Coordinator
{
class
TodayCoordinator
:
Coordinator
{
//Private
//
MARK: -
Private
private
let
navigationController
=
UINavigationController
(
nibName
:
nil
,
bundle
:
nil
)
private
let
navigationController
=
UINavigationController
(
nibName
:
nil
,
bundle
:
nil
)
private
var
tabBarController
:
UITabBarController
?
private
var
tabBarController
:
UITabBarController
?
//Public
//
MARK: -
Public
var
childCoordinators
=
[
Coordinator
]()
public
var
childCoordinators
=
[
Coordinator
]()
var
parentCoordinator
:
Coordinator
?
public
var
parentCoordinator
:
Coordinator
?
init
(
tabBarController
:
UITabBarController
)
{
public
init
(
tabBarController
:
UITabBarController
)
{
self
.
tabBarController
=
tabBarController
self
.
tabBarController
=
tabBarController
}
}
func
start
()
{
public
func
start
()
{
let
todayViewController
=
TodayViewController
(
coordinator
:
self
)
let
todayViewController
=
TodayViewController
(
coordinator
:
self
)
navigationController
.
viewControllers
=
[
todayViewController
]
navigationController
.
viewControllers
=
[
todayViewController
]
tabBarController
?
.
add
(
viewController
:
navigationController
)
tabBarController
?
.
add
(
viewController
:
navigationController
)
}
}
func
openLocationsSearch
()
{
public
func
openLocationsSearch
()
{
let
searchCoordinator
=
LocationSearchCoordinator
(
parentViewController
:
navigationController
)
let
searchCoordinator
=
LocationSearchCoordinator
(
parentViewController
:
navigationController
)
searchCoordinator
.
parentCoordinator
=
self
searchCoordinator
.
parentCoordinator
=
self
searchCoordinator
.
start
()
searchCoordinator
.
start
()
...
...
1Weather/Model/LocationManager.swift
View file @
8efb6edf
...
@@ -21,7 +21,7 @@ public class LocationManager {
...
@@ -21,7 +21,7 @@ public class LocationManager {
private
let
weatherUpdateSource
:
WeatherSource
private
let
weatherUpdateSource
:
WeatherSource
private
let
healthSource
:
HealthSource
private
let
healthSource
:
HealthSource
p
rivate
let
nwsAlertsManager
:
NWSAlertsManager
p
ublic
let
nwsAlertsManager
:
NWSAlertsManager
private
let
storage
:
Storage
private
let
storage
:
Storage
private
var
defaultLocation
=
Location
(
deviceLocation
:
false
,
private
var
defaultLocation
=
Location
(
deviceLocation
:
false
,
coordinates
:
.
init
(
latitude
:
37.3230
,
longitude
:
-
122.0322
),
// Cupertino
coordinates
:
.
init
(
latitude
:
37.3230
,
longitude
:
-
122.0322
),
// Cupertino
...
...
1Weather/UI/View controllers/Today/TodayViewController.swift
View file @
8efb6edf
...
@@ -29,6 +29,7 @@ class TodayViewController: UIViewController {
...
@@ -29,6 +29,7 @@ class TodayViewController: UIViewController {
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
}
@available(*, unavailable)
required
init
?(
coder
:
NSCoder
)
{
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
...
@@ -65,8 +66,8 @@ private extension TodayViewController {
...
@@ -65,8 +66,8 @@ private extension TodayViewController {
func
prepareViewController
()
{
func
prepareViewController
()
{
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
localizationObserver
=
NotificationCenter
.
default
.
addObserver
(
forName
:
.
localizationChange
,
object
:
nil
,
queue
:
.
main
,
using
:
{
_
in
localizationObserver
=
NotificationCenter
.
default
.
addObserver
(
forName
:
.
localizationChange
,
object
:
nil
,
queue
:
.
main
,
using
:
{
[
weak
self
]
_
in
self
.
tableView
.
reloadData
()
self
?
.
tableView
.
reloadData
()
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment