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
08bed76c
Commit
08bed76c
authored
Oct 07, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-186: added support for deeplinking.
parent
c3e394ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
1Weather/Coordinators/DeeplinksRouter.swift
+12
-2
1Weather/Coordinators/ForecastCoordinator.swift
+9
-0
No files found.
1Weather/Coordinators/DeeplinksRouter.swift
View file @
08bed76c
...
@@ -21,6 +21,7 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
...
@@ -21,6 +21,7 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
case
forecast
=
"forecast"
case
forecast
=
"forecast"
case
hourly
=
"hourly"
case
hourly
=
"hourly"
case
daily
=
"daily"
case
daily
=
"daily"
case
minutely
=
"minutely"
case
precipitation
=
"precipitation"
case
precipitation
=
"precipitation"
case
radar
=
"radar"
case
radar
=
"radar"
case
sunMoon
=
"sun-moon"
case
sunMoon
=
"sun-moon"
...
@@ -121,6 +122,8 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
...
@@ -121,6 +122,8 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
openHourlyForecast
()
openHourlyForecast
()
case
.
daily
:
case
.
daily
:
openDailyForecast
()
openDailyForecast
()
case
.
minutely
:
openMinutelyForecast
()
case
.
precipitation
:
case
.
precipitation
:
openPrecipitation
()
openPrecipitation
()
case
.
radar
:
case
.
radar
:
...
@@ -152,14 +155,21 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
...
@@ -152,14 +155,21 @@ class DeeplinksRouter: DeepLinksRouterProtocol {
func
openDailyForecast
()
{
func
openDailyForecast
()
{
onMain
{
onMain
{
self
.
log
.
info
(
"open Forecast"
)
self
.
log
.
info
(
"open Forecast
(daily)
"
)
self
.
appCoordinator
.
openForecast
(
timePeriod
:
.
daily
)
self
.
appCoordinator
.
openForecast
(
timePeriod
:
.
daily
)
}
}
}
}
func
openMinutelyForecast
()
{
onMain
{
self
.
log
.
info
(
"open Forecast (minutely)"
)
self
.
appCoordinator
.
openForecast
(
timePeriod
:
.
minutely
)
}
}
func
openHourlyForecast
()
{
func
openHourlyForecast
()
{
onMain
{
onMain
{
self
.
log
.
info
(
"open Forecast"
)
self
.
log
.
info
(
"open Forecast
(hourly)
"
)
self
.
appCoordinator
.
openForecast
(
timePeriod
:
.
hourly
)
self
.
appCoordinator
.
openForecast
(
timePeriod
:
.
hourly
)
}
}
}
}
...
...
1Weather/Coordinators/ForecastCoordinator.swift
View file @
08bed76c
...
@@ -7,9 +7,11 @@
...
@@ -7,9 +7,11 @@
import
UIKit
import
UIKit
import
OneWeatherCore
import
OneWeatherCore
import
OneWeatherAnalytics
class
ForecastCoordinator
:
Coordinator
{
class
ForecastCoordinator
:
Coordinator
{
//Private
//Private
private
let
log
=
Logger
(
componentName
:
"ForecastCoordinator"
)
private
let
forecastViewModel
=
ForecastViewModel
(
locationManager
:
LocationManager
.
shared
)
private
let
forecastViewModel
=
ForecastViewModel
(
locationManager
:
LocationManager
.
shared
)
private
let
navigationController
=
ColoredNavigationController
(
nibName
:
nil
,
bundle
:
nil
)
private
let
navigationController
=
ColoredNavigationController
(
nibName
:
nil
,
bundle
:
nil
)
private
var
tabBarController
:
UITabBarController
?
private
var
tabBarController
:
UITabBarController
?
...
@@ -31,6 +33,13 @@ class ForecastCoordinator: Coordinator {
...
@@ -31,6 +33,13 @@ class ForecastCoordinator: Coordinator {
}
}
public
func
open
(
timePeriod
:
TimePeriod
)
{
public
func
open
(
timePeriod
:
TimePeriod
)
{
var
timePeriod
=
timePeriod
if
timePeriod
==
.
minutely
{
if
!
FeatureAvailabilityManager
.
shared
.
isAvailable
(
feature
:
.
minutelyForecast
)
{
timePeriod
=
.
daily
log
.
warning
(
"Open daily instead of minutely (minutely forecast is not available)."
)
}
}
self
.
forecastViewController
?
.
switchTo
(
timePeriod
:
timePeriod
)
self
.
forecastViewController
?
.
switchTo
(
timePeriod
:
timePeriod
)
}
}
...
...
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