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
387d5c72
Commit
387d5c72
authored
Jun 10, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-108: move ad banner on the NWSAlert screen 1 section up.
parent
a3de7b82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertCellFactory.swift
+12
-25
No files found.
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertCellFactory.swift
View file @
387d5c72
...
@@ -32,9 +32,17 @@ fileprivate struct HeaderSection: NWSAlertTableViewSection {
...
@@ -32,9 +32,17 @@ fileprivate struct HeaderSection: NWSAlertTableViewSection {
//do nothing
//do nothing
}
}
private
let
rows
:
[
NWSAlertCellType
]
=
[
.
header
,
.
forecastOffice
]
private
let
rows
:
[
NWSAlertCellType
]
=
{
if
!
isAppPro
()
&&
AdConfigManager
.
shared
.
adConfig
.
adsEnabled
{
return
[
.
header
,
.
forecastOffice
,
.
adBanner
]
}
else
{
return
[
.
header
,
.
forecastOffice
]
}
}()
var
numberOfRows
:
Int
{
var
numberOfRows
:
Int
{
r
eturn
r
ows
.
count
rows
.
count
}
}
func
type
(
forRow
row
:
Int
)
->
NWSAlertCellType
{
func
type
(
forRow
row
:
Int
)
->
NWSAlertCellType
{
...
@@ -44,19 +52,13 @@ fileprivate struct HeaderSection: NWSAlertTableViewSection {
...
@@ -44,19 +52,13 @@ fileprivate struct HeaderSection: NWSAlertTableViewSection {
fileprivate
struct
ExtendedInfoSection
:
NWSAlertTableViewSection
{
fileprivate
struct
ExtendedInfoSection
:
NWSAlertTableViewSection
{
private
var
alert
:
NWSAlert
private
var
alert
:
NWSAlert
private
var
countOfAds
:
Int
{
if
!
isAppPro
()
&&
AdConfigManager
.
shared
.
adConfig
.
adsEnabled
{
return
1
}
return
0
}
init
(
alert
:
NWSAlert
)
{
init
(
alert
:
NWSAlert
)
{
self
.
alert
=
alert
self
.
alert
=
alert
}
}
var
numberOfRows
:
Int
{
var
numberOfRows
:
Int
{
countOfAds
+
(
alert
.
extendedInfo
?
.
infoBlocks
.
count
??
0
)
alert
.
extendedInfo
?
.
infoBlocks
.
count
??
0
}
}
mutating
func
update
(
with
alert
:
NWSAlert
)
{
mutating
func
update
(
with
alert
:
NWSAlert
)
{
...
@@ -64,25 +66,10 @@ fileprivate struct ExtendedInfoSection: NWSAlertTableViewSection {
...
@@ -64,25 +66,10 @@ fileprivate struct ExtendedInfoSection: NWSAlertTableViewSection {
}
}
func
type
(
forRow
row
:
Int
)
->
NWSAlertCellType
{
func
type
(
forRow
row
:
Int
)
->
NWSAlertCellType
{
guard
countOfAds
>
0
else
{
.
extendedInfoBlock
return
.
extendedInfoBlock
}
if
numberOfRows
==
1
{
return
.
adBanner
}
else
{
if
row
==
1
{
return
.
adBanner
}
else
{
return
.
extendedInfoBlock
}
}
}
}
let
rows
:
[
NWSAlertCellType
]
=
[
.
extendedInfoBlock
]
let
rows
:
[
NWSAlertCellType
]
=
[
.
extendedInfoBlock
]
}
}
class
NWSAlertCellFactory
:
CellFactoryProtocol
{
class
NWSAlertCellFactory
:
CellFactoryProtocol
{
...
...
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