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
a797f93a
Commit
a797f93a
authored
Apr 30, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tap on Alert on the Today screen.
parent
a55b9c74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
+7
-2
1Weather/UI/View controllers/Today/TodayViewController.swift
+4
-1
No files found.
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
View file @
a797f93a
...
...
@@ -7,7 +7,7 @@
import
UIKit
p
rivate
enum
TodayCellType
:
Int
{
p
ublic
enum
TodayCellType
:
Int
{
case
alert
=
0
case
forecast
case
ad
...
...
@@ -96,8 +96,13 @@ class TodayCellFactory: CellFactoryProtocol {
return
adView
}
public
func
cell
FromTableView
(
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
public
func
cell
Type
(
at
indexPath
:
IndexPath
)
->
TodayCellType
{
let
cellType
=
todaySection
.
rows
[
indexPath
.
row
]
return
cellType
}
public
func
cellFromTableView
(
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cellType
=
self
.
cellType
(
at
:
indexPath
)
guard
let
loc
=
self
.
todayViewModel
.
location
else
{
return
UITableViewCell
()
}
...
...
1Weather/UI/View controllers/Today/TodayViewController.swift
View file @
a797f93a
...
...
@@ -130,7 +130,10 @@ extension TodayViewController: UITableViewDataSource {
//MARK:- UITableView Delegate
extension
TodayViewController
:
UITableViewDelegate
{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
print
(
"TodayViewController: didSelectRow"
)
let
cellType
=
viewModel
.
todayCellFactory
.
cellType
(
at
:
indexPath
)
if
cellType
==
.
alert
{
coordinator
.
openNotificationsScreen
()
}
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
...
...
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