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
c2757262
Commit
c2757262
authored
Apr 27, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alerts display.
parent
3fcf0f43
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
265 additions
and
28 deletions
+265
-28
1Weather/Model/LocationManager.swift
+9
-4
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_background.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_separator.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_tile_background.colorset/Contents.json
+38
-0
1Weather/Resources/en.lproj/Localizable.strings
+1
-0
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertCellFactory.swift
+1
-1
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertInfoBlockTableViewCell.swift
+55
-13
1Weather/UI/View controllers/NWSAlert/Cells/NWSForecastOfficeTableViewCell.swift
+69
-3
1Weather/UI/View controllers/NWSAlert/NWSAlertViewController.swift
+5
-2
1Weather/UI/View controllers/Notifications/Cells/NWSAlertCell.swift
+11
-5
No files found.
1Weather/Model/LocationManager.swift
View file @
c2757262
...
@@ -284,7 +284,7 @@ public class LocationManager {
...
@@ -284,7 +284,7 @@ public class LocationManager {
}
}
}
}
log
.
info
(
"Update weather for:
\(
location
)
; type:
\(
updateType
)
"
)
//
log.info("Update weather for: \(location); type: \(updateType)")
weatherUpdateSource
.
updateWeather
(
for
:
location
,
type
:
updateType
)
{
[
weak
self
]
(
updatedLocation
,
error
)
in
weatherUpdateSource
.
updateWeather
(
for
:
location
,
type
:
updateType
)
{
[
weak
self
]
(
updatedLocation
,
error
)
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -295,11 +295,16 @@ public class LocationManager {
...
@@ -295,11 +295,16 @@ public class LocationManager {
}
}
}
}
else
{
else
{
if
let
error
=
error
{
if
let
wdtError
=
error
as?
WdtWeatherSourceError
{
self
.
log
.
error
(
"Update weather (
\(
location
)
) error:
\(
error
)
"
)
if
case
WdtWeatherSourceError
.
alreadyBeingUpdated
=
wdtError
{
// do nothing
}
else
{
self
.
log
.
error
(
"Update weather (
\(
location
)
) error:
\(
error
)
"
)
}
}
}
else
{
else
{
self
.
log
.
error
(
"Update weather (
\(
location
)
) error:
unknown error
"
)
self
.
log
.
error
(
"Update weather (
\(
location
)
) error:
\(
error
)
"
)
}
}
}
}
}
}
...
...
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_background.colorset/Contents.json
0 → 100644
View file @
c2757262
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.988"
,
"green"
:
"0.968"
,
"red"
:
"0.965"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"26"
,
"green"
:
"23"
,
"red"
:
"23"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_separator.colorset/Contents.json
0 → 100644
View file @
c2757262
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.592"
,
"green"
:
"0.592"
,
"red"
:
"0.592"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.592"
,
"green"
:
"0.592"
,
"red"
:
"0.592"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_nwsalert_tile_background.colorset/Contents.json
0 → 100644
View file @
c2757262
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"1.000"
,
"green"
:
"1.000"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"display-p3"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.169"
,
"green"
:
"0.149"
,
"red"
:
"0.149"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/en.lproj/Localizable.strings
View file @
c2757262
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
"notifications.nwsCell.expired" = "Expired";
"notifications.nwsCell.expired" = "Expired";
"notifications.nwsCell.staticTitle" = "NWS ALERT";
"notifications.nwsCell.staticTitle" = "NWS ALERT";
"notifications.nwsCell.remainsInEffectUntil" = "remains in effect until";
"notifications.nwsCell.remainsInEffectUntil" = "remains in effect until";
"notifications.nwsAlert.forecastOffice" = "Forecast office";
//Forecast
//Forecast
"forecast.sunny" = "Sunny";
"forecast.sunny" = "Sunny";
...
...
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertCellFactory.swift
View file @
c2757262
...
@@ -112,7 +112,7 @@ class NWSAlertCellFactory: CellFactoryProtocol {
...
@@ -112,7 +112,7 @@ class NWSAlertCellFactory: CellFactoryProtocol {
switch
type
{
switch
type
{
case
.
header
:
case
.
header
:
let
alertCell
=
dequeueReusableCell
(
type
:
NWSAlertCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
let
alertCell
=
dequeueReusableCell
(
type
:
NWSAlertCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
alertCell
.
configure
(
with
:
alert
)
alertCell
.
configure
(
with
:
alert
,
overrideBackgroundColorName
:
"notifications_nwsalert_background"
)
return
alertCell
return
alertCell
case
.
forecastOffice
:
case
.
forecastOffice
:
let
forecastOfficeCell
=
dequeueReusableCell
(
type
:
NWSForecastOfficeTableViewCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
let
forecastOfficeCell
=
dequeueReusableCell
(
type
:
NWSForecastOfficeTableViewCell
.
self
,
tableView
:
tableView
,
indexPath
:
indexPath
)
...
...
1Weather/UI/View controllers/NWSAlert/Cells/NWSAlertInfoBlockTableViewCell.swift
View file @
c2757262
...
@@ -10,9 +10,12 @@ import UIKit
...
@@ -10,9 +10,12 @@ import UIKit
class
NWSAlertInfoBlockTableViewCell
:
UITableViewCell
{
class
NWSAlertInfoBlockTableViewCell
:
UITableViewCell
{
let
titleLabel
=
UILabel
()
let
titleLabel
=
UILabel
()
let
detailsLabel
=
UILabel
()
let
detailsLabel
=
UILabel
()
let
containerView
=
UIView
()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
prepareSelf
()
prepareContainer
()
}
}
@available(*, unavailable)
@available(*, unavailable)
...
@@ -21,37 +24,76 @@ class NWSAlertInfoBlockTableViewCell: UITableViewCell {
...
@@ -21,37 +24,76 @@ class NWSAlertInfoBlockTableViewCell: UITableViewCell {
}
}
public
func
configure
(
with
info
:
NWSAlertInfoBlock
)
{
public
func
configure
(
with
info
:
NWSAlertInfoBlock
)
{
for
subview
in
contentView
.
subviews
{
subview
.
removeFromSuperview
()
}
titleLabel
.
removeFromSuperview
()
titleLabel
.
removeFromSuperview
()
detailsLabel
.
removeFromSuperview
()
detailsLabel
.
removeFromSuperview
()
let
vStack
=
UIStackView
()
if
info
.
title
?
.
isEmpty
==
false
{
vStack
.
axis
=
.
vertical
contentView
.
addSubview
(
vStack
)
if
info
.
title
?
.
isEmpty
??
false
{
titleLabel
.
text
=
info
.
title
titleLabel
.
text
=
info
.
title
vStack
.
addSubview
(
titleLabel
)
containerView
.
addSubview
(
titleLabel
)
}
}
if
info
.
text
?
.
isEmpty
??
false
{
if
info
.
text
?
.
isEmpty
==
false
{
detailsLabel
.
text
=
info
.
text
detailsLabel
.
text
=
info
.
text
vStack
.
addSubview
(
detailsLabel
)
containerView
.
addSubview
(
detailsLabel
)
}
}
prepareLabels
()
// this has to be here
vStack
.
snp
.
makeConstraints
{
(
make
)
in
if
containerView
.
subviews
.
count
==
1
,
let
subview
=
containerView
.
subviews
.
first
{
make
.
edges
.
equalToSuperview
()
subview
.
snp
.
makeConstraints
{
(
make
)
in
make
.
leading
.
equalToSuperview
()
.
inset
(
8
)
make
.
trailing
.
equalToSuperview
()
.
inset
(
8
)
make
.
top
.
equalToSuperview
()
.
inset
(
12
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
14
)
}
}
}
else
if
containerView
.
subviews
.
count
==
2
{
titleLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
leading
.
equalToSuperview
()
.
inset
(
8
)
make
.
trailing
.
equalToSuperview
()
.
inset
(
8
)
make
.
top
.
equalToSuperview
()
.
inset
(
12
)
}
detailsLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
leading
.
equalToSuperview
()
.
inset
(
8
)
make
.
trailing
.
equalToSuperview
()
.
inset
(
8
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
14
)
}
}
self
.
layoutIfNeeded
()
}
}
}
}
// MARK: - UI Setup
// MARK: - UI Setup
extension
NWSAlertInfoBlockTableViewCell
{
extension
NWSAlertInfoBlockTableViewCell
{
func
prepareSelf
()
{
self
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_background"
)
self
.
contentView
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_background"
)
self
.
selectionStyle
=
.
none
}
func
prepareContainer
()
{
contentView
.
addSubview
(
containerView
)
containerView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
.
inset
(
18
)
make
.
left
.
equalToSuperview
()
.
inset
(
18
)
make
.
right
.
equalToSuperview
()
.
inset
(
18
)
make
.
bottom
.
equalToSuperview
()
}
containerView
.
layer
.
cornerRadius
=
8
containerView
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_tile_background"
)
}
func
prepareLabels
()
{
func
prepareLabels
()
{
titleLabel
.
font
=
AppFont
.
SFPro
.
bold
(
size
:
18
)
titleLabel
.
font
=
AppFont
.
SFPro
.
bold
(
size
:
18
)
detailsLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
14
)
detailsLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
14
)
titleLabel
.
textColor
=
UIColor
(
named
:
"notifications_primary_text"
)
titleLabel
.
textColor
=
UIColor
(
named
:
"notifications_primary_text"
)
detailsLabel
.
textColor
=
UIColor
(
named
:
"notifications_primary_text"
)
detailsLabel
.
textColor
=
UIColor
(
named
:
"notifications_primary_text"
)
titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
false
detailsLabel
.
translatesAutoresizingMaskIntoConstraints
=
false
titleLabel
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
vertical
)
detailsLabel
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
vertical
)
titleLabel
.
numberOfLines
=
0
detailsLabel
.
numberOfLines
=
0
titleLabel
.
lineBreakMode
=
.
byWordWrapping
detailsLabel
.
lineBreakMode
=
.
byWordWrapping
}
}
}
}
1Weather/UI/View controllers/NWSAlert/Cells/NWSForecastOfficeTableViewCell.swift
View file @
c2757262
...
@@ -11,14 +11,19 @@ import SnapKit
...
@@ -11,14 +11,19 @@ import SnapKit
class
NWSForecastOfficeTableViewCell
:
UITableViewCell
{
class
NWSForecastOfficeTableViewCell
:
UITableViewCell
{
var
alert
:
NWSAlert
?
var
alert
:
NWSAlert
?
private
let
containerView
=
UIView
()
private
let
officeTitleLabel
=
UILabel
()
private
let
officeTitleLabel
=
UILabel
()
private
let
sentLabel
=
UILabel
()
private
let
sentLabel
=
UILabel
()
private
let
expiresLabel
=
UILabel
()
private
let
expiresLabel
=
UILabel
()
private
let
separatorView
=
UIView
()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
prepareSubviews
()
prepareSelf
()
prepareContainer
()
prepareLabels
()
prepareSeparator
()
}
}
@available(*, unavailable)
@available(*, unavailable)
...
@@ -27,10 +32,71 @@ class NWSForecastOfficeTableViewCell: UITableViewCell {
...
@@ -27,10 +32,71 @@ class NWSForecastOfficeTableViewCell: UITableViewCell {
}
}
func
configure
(
with
alert
:
NWSAlert
)
{
func
configure
(
with
alert
:
NWSAlert
)
{
officeTitleLabel
.
text
=
alert
.
extendedInfo
?
.
issuer
??
"--"
}
var
primaryTextColor
:
UIColor
!
{
// TODO: use ThemeManager here.
UIColor
(
named
:
"notifications_primary_text"
)
}
}
func
prepareSubviews
()
{
private
func
prepareSelf
()
{
self
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_background"
)
self
.
contentView
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_background"
)
self
.
selectionStyle
=
.
none
}
private
func
prepareLabels
()
{
let
forecastOfficeLabel
=
UILabel
()
forecastOfficeLabel
.
font
=
AppFont
.
SFPro
.
bold
(
size
:
18
)
forecastOfficeLabel
.
textColor
=
primaryTextColor
forecastOfficeLabel
.
text
=
"notifications.nwsAlert.forecastOffice"
.
localized
()
officeTitleLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
14
)
officeTitleLabel
.
textColor
=
primaryTextColor
officeTitleLabel
.
numberOfLines
=
0
officeTitleLabel
.
lineBreakMode
=
.
byWordWrapping
containerView
.
addSubview
(
forecastOfficeLabel
)
containerView
.
addSubview
(
officeTitleLabel
)
forecastOfficeLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
.
inset
(
12
)
make
.
left
.
equalToSuperview
()
.
inset
(
8
)
make
.
right
.
equalToSuperview
()
.
inset
(
8
)
}
officeTitleLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
forecastOfficeLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
left
.
equalToSuperview
()
.
inset
(
8
)
make
.
right
.
equalToSuperview
()
.
inset
(
8
)
}
}
private
func
prepareSeparator
()
{
separatorView
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_separator"
)
separatorView
.
isUserInteractionEnabled
=
false
separatorView
.
isOpaque
=
true
separatorView
.
isHidden
=
true
containerView
.
addSubview
(
separatorView
)
separatorView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
height
.
equalTo
(
0.5
)
make
.
left
.
equalToSuperview
()
.
inset
(
8
)
make
.
right
.
equalToSuperview
()
.
inset
(
8
)
make
.
top
.
equalTo
(
officeTitleLabel
.
snp
.
bottom
)
.
offset
(
4
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
4
)
// temporary
}
}
private
func
prepareContainer
()
{
contentView
.
addSubview
(
containerView
)
containerView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
.
inset
(
18
)
make
.
left
.
equalToSuperview
()
.
inset
(
18
)
make
.
right
.
equalToSuperview
()
.
inset
(
18
)
make
.
bottom
.
equalToSuperview
()
}
containerView
.
layer
.
cornerRadius
=
8
containerView
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_tile_background"
)
}
}
}
}
1Weather/UI/View controllers/NWSAlert/NWSAlertViewController.swift
View file @
c2757262
...
@@ -51,8 +51,7 @@ class NWSAlertViewController: UIViewController {
...
@@ -51,8 +51,7 @@ class NWSAlertViewController: UIViewController {
//MARK: - UI Setup
//MARK: - UI Setup
extension
NWSAlertViewController
{
extension
NWSAlertViewController
{
func
prepareViewController
()
{
func
prepareViewController
()
{
view
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
view
.
backgroundColor
=
UIColor
(
named
:
"notifications_nwsalert_background"
)
let
closeButton
=
UIBarButtonItem
(
title
:
"general.close"
.
localized
()
.
capitalized
,
let
closeButton
=
UIBarButtonItem
(
title
:
"general.close"
.
localized
()
.
capitalized
,
style
:
.
done
,
style
:
.
done
,
target
:
self
,
target
:
self
,
...
@@ -107,4 +106,8 @@ extension NWSAlertViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -107,4 +106,8 @@ extension NWSAlertViewController: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
UITableView
.
automaticDimension
UITableView
.
automaticDimension
}
}
func
tableView
(
_
tableView
:
UITableView
,
estimatedHeightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
160
}
}
}
1Weather/UI/View controllers/Notifications/Cells/NWSAlertCell.swift
View file @
c2757262
...
@@ -62,9 +62,12 @@ class NWSAlertCell: UITableViewCell {
...
@@ -62,9 +62,12 @@ class NWSAlertCell: UITableViewCell {
return
NWSAlertCell
.
issueDateFormatter
// it's always used from the same thread, so it's OK.
return
NWSAlertCell
.
issueDateFormatter
// it's always used from the same thread, so it's OK.
}
}
public
func
configure
(
with
alert
:
NWSAlert
)
{
public
func
configure
(
with
alert
:
NWSAlert
,
overrideBackgroundColorName
:
String
?
=
nil
)
{
self
.
alert
=
alert
self
.
alert
=
alert
let
backgroundColorName
=
alert
.
read
?
"notifications_background_read"
:
"notifications_background_unread"
var
backgroundColorName
=
alert
.
read
?
"notifications_background_read"
:
"notifications_background_unread"
if
let
overrideBackgroundColorName
=
overrideBackgroundColorName
{
backgroundColorName
=
overrideBackgroundColorName
}
self
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
self
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
self
.
contentView
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
self
.
contentView
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
...
@@ -78,11 +81,14 @@ class NWSAlertCell: UITableViewCell {
...
@@ -78,11 +81,14 @@ class NWSAlertCell: UITableViewCell {
}
}
headerActiveExpiredLabel
.
isHidden
=
false
headerActiveExpiredLabel
.
isHidden
=
false
let
expiryString
=
expiryDateFormatter
(
timeZone
:
alert
.
timeZone
)
.
string
(
from
:
alert
.
expires
)
let
expiryString
=
expiryDateFormatter
(
timeZone
:
alert
.
timeZone
)
.
string
(
from
:
alert
.
expires
)
let
paragraphStyle
=
NSMutableParagraphStyle
()
paragraphStyle
.
lineSpacing
=
10
let
attributedText
=
NSMutableAttributedString
(
string
:
"
\(
alert
.
description
)
\(
"notifications.nwsCell.remainsInEffectUntil"
.
localized
()
)
\(
expiryString
)
"
,
let
attributedText
=
NSMutableAttributedString
(
string
:
"
\(
alert
.
description
)
\(
"notifications.nwsCell.remainsInEffectUntil"
.
localized
()
)
\(
expiryString
)
"
,
attributes
:
[
attributes
:
[
.
font
:
AppFont
.
SFPro
.
regular
(
size
:
14
),
.
font
:
AppFont
.
SFPro
.
regular
(
size
:
14
),
.
foregroundColor
:
primaryTextColor
as
Any
.
foregroundColor
:
primaryTextColor
as
Any
,
.
paragraphStyle
:
paragraphStyle
])
])
let
nsText
=
attributedText
.
string
as
NSString
let
nsText
=
attributedText
.
string
as
NSString
let
boldRange
=
nsText
.
range
(
of
:
alert
.
description
)
let
boldRange
=
nsText
.
range
(
of
:
alert
.
description
)
...
@@ -154,7 +160,7 @@ private extension NWSAlertCell {
...
@@ -154,7 +160,7 @@ private extension NWSAlertCell {
addSubview
(
alertTextLabel
)
addSubview
(
alertTextLabel
)
alertTextLabel
.
snp
.
makeConstraints
{
(
make
)
in
alertTextLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
equalToSuperview
()
.
offset
(
offsetToSuperview
)
make
.
left
.
equalToSuperview
()
.
offset
(
offsetToSuperview
)
make
.
top
.
equalTo
(
alertIconImageView
.
snp
.
bottom
)
.
offset
(
4
)
make
.
top
.
equalTo
(
alertIconImageView
.
snp
.
bottom
)
.
offset
(
8
)
make
.
right
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
make
.
right
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
}
}
}
}
...
@@ -176,7 +182,7 @@ private extension NWSAlertCell {
...
@@ -176,7 +182,7 @@ private extension NWSAlertCell {
}
}
alertLocationLabel
.
snp
.
makeConstraints
{
(
make
)
in
alertLocationLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
alertTextLabel
.
snp
.
bottom
)
make
.
top
.
equalTo
(
alertTextLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
left
.
equalTo
(
locationIconImageView
.
snp
.
right
)
.
offset
(
6
)
make
.
left
.
equalTo
(
locationIconImageView
.
snp
.
right
)
.
offset
(
6
)
make
.
right
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
make
.
right
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
offsetToSuperview
)
...
...
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