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
2023-03-29 11:13:15 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
98b6e50e61c210adc1ee0fc5a7849e298c800547
98b6e50e
1 parent
2a6affcd
fix null merchant image crash
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
98b6e50
...
...
@@ -237,21 +237,22 @@ extension UIImage {
}
else
{
//No cache, so create new one and set image
let
url
=
URL
(
string
:
urlString
)
URLSession
.
shared
.
dataTask
(
with
:
url
!
,
completionHandler
:
{
(
data
,
response
,
error
)
in
if
let
error
=
error
{
print
(
error
)
return
}
DispatchQueue
.
main
.
async
(
execute
:
{
if
let
downloadedImage
=
UIImage
(
data
:
data
!
)
{
imageCache
.
setObject
(
downloadedImage
,
forKey
:
urlString
as
NSString
)
completion
(
downloadedImage
)
if
let
url
=
URL
(
string
:
urlString
)
{
URLSession
.
shared
.
dataTask
(
with
:
url
,
completionHandler
:
{
(
data
,
response
,
error
)
in
if
let
error
=
error
{
print
(
error
)
return
}
})
})
.
resume
()
DispatchQueue
.
main
.
async
(
execute
:
{
if
let
downloadedImage
=
UIImage
(
data
:
data
!
)
{
imageCache
.
setObject
(
downloadedImage
,
forKey
:
urlString
as
NSString
)
completion
(
downloadedImage
)
}
})
})
.
resume
()
}
}
}
}
...
...
Please
register
or
login
to post a comment