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
b071d02c
Commit
b071d02c
authored
Jun 10, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS-106: MREC layout fix
parent
3b01922f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
11 deletions
+24
-11
1Weather/Ads/Native/NativeAdViews/NativeMRECView.xib
+1
-0
1Weather/UI/SharedCells/AdCells/MRECAdCell.swift
+1
-8
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
+21
-3
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
+1
-0
No files found.
1Weather/Ads/Native/NativeAdViews/NativeMRECView.xib
View file @
b071d02c
...
...
@@ -19,6 +19,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"300"
height=
"155"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"155"
id=
"2of-WV-KVU"
/>
<constraint
firstAttribute=
"width"
constant=
"300"
id=
"fBU-Kp-e3s"
/>
</constraints>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Headline"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ALU-9y-yCS"
>
...
...
1Weather/UI/SharedCells/AdCells/MRECAdCell.swift
View file @
b071d02c
...
...
@@ -50,11 +50,8 @@ class MRECAdCell: UITableViewCell, AdCell {
switch
interfaceStyle
{
case
.
light
:
gradientView
.
isHidden
=
false
container
.
layer
.
borderWidth
=
1
/
UIScreen
.
main
.
scale
container
.
layer
.
borderColor
=
UIColor
(
hex
:
0xc7c7c7
)
.
cgColor
case
.
dark
:
gradientView
.
isHidden
=
true
container
.
layer
.
borderWidth
=
0
}
}
}
...
...
@@ -83,7 +80,7 @@ private extension MRECAdCell {
make
.
height
.
equalTo
(
250
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
18
)
make
.
centerX
.
equalToSuperview
()
make
.
width
.
e
qualTo
(
300
)
make
.
width
.
greaterThanOrE
qualTo
(
300
)
}
}
...
...
@@ -91,10 +88,6 @@ private extension MRECAdCell {
for
subview
in
container
.
subviews
{
subview
.
removeFromSuperview
()
}
label
.
snp
.
makeConstraints
{
(
make
)
in
make
.
center
.
equalToSuperview
()
}
if
let
adView
=
adView
{
container
.
addSubview
(
adView
)
adView
.
snp
.
makeConstraints
{
(
make
)
in
...
...
1Weather/UI/View controllers/Forecast/Cells/ForecastCellFactory.swift
View file @
b071d02c
...
...
@@ -114,16 +114,34 @@ class ForecastCellFactory: CellFactoryProtocol {
let
adView
=
AdView
()
var
placementName
:
String
!
var
timePeriodString
:
String
!
var
adType
=
AdType
.
banner
var
adTypeString
=
"Banner"
var
adLoggingEmoji
=
"🔹"
switch
timePeriod
{
case
.
daily
:
placementName
=
placementNameForecastDailyBanner
timePeriodString
=
"D"
placementName
=
placementNameForecastDailyBanner
let
cellType
=
DailyForecastCellType
(
rawValue
:
indexPath
.
row
)
if
cellType
==
.
adMREC
{
placementName
=
placementNameForecastDailySquare
adType
=
.
square
adTypeString
=
"MREC"
adLoggingEmoji
=
"✅"
}
case
.
hourly
:
placementName
=
placementNameForecastHourlyBanner
timePeriodString
=
"H"
let
cellType
=
HourlyForecastCellType
(
rawValue
:
indexPath
.
row
)
if
cellType
==
.
adMREC
{
placementName
=
placementNameForecastHourlySquare
adType
=
.
square
adTypeString
=
"MREC"
adLoggingEmoji
=
"✅"
}
}
adView
.
set
(
placementName
:
placementName
,
adType
:
.
banner
)
adView
.
loggingAlias
=
"🔹 Forecast
\(
timePeriodString
!
)
Banner"
adView
.
set
(
placementName
:
placementName
,
adType
:
adType
)
adView
.
loggingAlias
=
"
\(
adLoggingEmoji
)
Forecast
\(
timePeriodString
!
)
\(
adTypeString
)
"
var
edited
=
adViewCache
[
timePeriod
]
??
[
IndexPath
:
AdView
]()
edited
[
indexPath
]
=
adView
adViewCache
[
timePeriod
]
=
edited
...
...
1Weather/UI/View controllers/Today/Cells/TodayCellFactory.swift
View file @
b071d02c
...
...
@@ -97,6 +97,7 @@ class TodayCellFactory: CellFactoryProtocol {
var
adType
=
AdType
.
banner
if
cellType
(
at
:
indexPath
)
==
.
adMREC
{
adType
=
.
square
adView
.
loggingAlias
=
"📅 Today MREC"
}
adView
.
set
(
placementName
:
placementNameTodayBanner
,
adType
:
adType
)
adViewCache
[
indexPath
]
=
adView
...
...
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