Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-10-27 10:59:43 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
88c5c24a476a0fb674038751e5ff2932e64e8cb0
88c5c24a
1 parent
7a22e269
fix history cell image caching
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
View file @
88c5c24
...
...
@@ -14,6 +14,24 @@ class AnalysisItemViewCell: UITableViewCell {
@IBOutlet
weak
var
titleLabel
:
UILabel
!
@IBOutlet
weak
var
priceLabel
:
UILabel
!
@IBOutlet
weak
var
subtitleLabel
:
UILabel
!
var
postImageURL
:
String
?
{
didSet
{
if
let
url
=
postImageURL
{
self
.
itemImage
.
image
=
UIImage
()
// UIImage(named: "loading")
UIImage
.
loadImageUsingCacheWithUrlString
(
url
)
{
image
in
// set the image only when we are still displaying the content for the image we finished downloading
if
url
==
self
.
postImageURL
{
self
.
itemImage
.
image
=
image
}
}
}
else
{
self
.
itemImage
.
image
=
nil
}
}
}
// lifecycle
override
func
awakeFromNib
()
{
...
...
@@ -42,7 +60,8 @@ extension AnalysisItemViewCell {
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
item
.
_merchant_uuid
)
{
itemImage
.
load
(
link
:
merchant
.
_img_preview
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
// itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
self
.
postImageURL
=
merchant
.
_img_preview
titleLabel
.
text
=
merchant
.
_admin_name
break
;
}
...
...
@@ -76,7 +95,8 @@ extension AnalysisItemViewCell {
for
merchant
in
merchantList
{
if
(
merchant
.
_uuid
==
couponSetData
?
.
merchant_uuid
)
{
itemImage
.
load
(
link
:
merchant
.
_img_preview
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
// itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
self
.
postImageURL
=
merchant
.
_img_preview
titleLabel
.
text
=
merchant
.
_admin_name
break
;
}
...
...
Please
register
or
login
to post a comment