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
862b5676
Commit
862b5676
authored
Apr 28, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forecast: city button and notifications button implemented
parent
4e9f7a95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
1Weather/Coordinators/ForecastCoordinator.swift
+13
-1
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
+5
-3
1Weather/UI/View controllers/Radar/RadarViewController.swift
+1
-1
No files found.
1Weather/Coordinators/ForecastCoordinator.swift
View file @
862b5676
...
...
@@ -23,7 +23,7 @@ class ForecastCoordinator: Coordinator {
}
func
start
()
{
let
forecastViewController
=
ForecastViewController
(
viewModel
:
forecastViewModel
)
let
forecastViewController
=
ForecastViewController
(
viewModel
:
forecastViewModel
,
coordinator
:
self
)
navigationController
.
viewControllers
=
[
forecastViewController
]
tabBarController
?
.
add
(
viewController
:
navigationController
)
self
.
forecastViewController
=
forecastViewController
...
...
@@ -33,6 +33,18 @@ class ForecastCoordinator: Coordinator {
self
.
forecastViewController
?
.
switchTo
(
timePeriod
:
timePeriod
)
}
public
func
openNotificationsScreen
()
{
let
notificationsCoordinator
=
NotificationsCoordinator
(
parentViewController
:
navigationController
)
notificationsCoordinator
.
parentCoordinator
=
self
notificationsCoordinator
.
start
()
}
public
func
openLocationsSearch
()
{
let
searchCoordinator
=
LocationSearchCoordinator
(
parentViewController
:
navigationController
)
searchCoordinator
.
parentCoordinator
=
self
searchCoordinator
.
start
()
}
func
viewControllerDidEnd
(
controller
:
UIViewController
)
{
//
}
...
...
1Weather/UI/View controllers/Forecast/ForecastViewController.swift
View file @
862b5676
...
...
@@ -12,6 +12,7 @@ class ForecastViewController: UIViewController {
private
let
forecastCellFactory
:
ForecastCellFactory
private
let
cityButton
=
NavigationCityButton
()
private
let
daysControlView
=
DaysControlView
()
private
let
coordinator
:
ForecastCoordinator
private
let
timePeriodControl
=
ForecastTimePeriodControl
(
items
:
[
"forecast.timePeriod.daily"
.
localized
(),
"forecast.timePeriod.hourly"
.
localized
()])
private
let
tableView
=
UITableView
()
...
...
@@ -22,8 +23,9 @@ class ForecastViewController: UIViewController {
return
TimePeriod
(
rawValue
:
timePeriodControl
.
selectedSegmentIndex
)
??
.
daily
}
init
(
viewModel
:
ForecastViewModel
)
{
init
(
viewModel
:
ForecastViewModel
,
coordinator
:
ForecastCoordinator
)
{
self
.
viewModel
=
viewModel
self
.
coordinator
=
coordinator
self
.
forecastCellFactory
=
ForecastCellFactory
(
viewModel
:
viewModel
)
super
.
init
(
nibName
:
nil
,
bundle
:
nil
)
}
...
...
@@ -83,11 +85,11 @@ class ForecastViewController: UIViewController {
}
@objc
private
func
handleCityButton
()
{
print
(
"Handle city button"
)
coordinator
.
openLocationsSearch
(
)
}
@objc
private
func
handleNotificationButton
()
{
print
(
"Handle notification button"
)
coordinator
.
openNotificationsScreen
(
)
}
}
...
...
1Weather/UI/View controllers/Radar/RadarViewController.swift
View file @
862b5676
...
...
@@ -13,7 +13,7 @@ class RadarViewController: UIViewController {
//Private
private
let
kPinnedLayersHeight
:
CGFloat
=
43
private
let
radarViewModel
=
RadarViewModel
()
private
let
coordinator
:
RadarCoordinator
private
let
coordinator
:
RadarCoordinator
private
let
cityButton
=
NavigationCityButton
()
private
var
localizationObserver
:
Any
?
private
let
mapView
=
MKMapView
()
...
...
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