File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 77 objects = {
88
99/* Begin PBXBuildFile section */
10+ 86171D7C24C7330000D71D06 /* UIImageViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86171D7B24C7330000D71D06 /* UIImageViewExtension.swift */; };
1011 8656BC582483E3C60023549D /* EncodableExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8656BC572483E3C60023549D /* EncodableExtension.swift */; };
1112 8656BC5B2483E43D0023549D /* EncodableExtensionUnitTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8656BC5A2483E43D0023549D /* EncodableExtensionUnitTest.swift */; };
1213 8656BC5E2484313F0023549D /* HttpUtilityIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8656BC5D2484313F0023549D /* HttpUtilityIntegrationTests.swift */; };
2829/* End PBXContainerItemProxy section */
2930
3031/* Begin PBXFileReference section */
32+ 86171D7B24C7330000D71D06 /* UIImageViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImageViewExtension.swift; sourceTree = "<group>"; };
3133 8656BC572483E3C60023549D /* EncodableExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodableExtension.swift; sourceTree = "<group>"; };
3234 8656BC5A2483E43D0023549D /* EncodableExtensionUnitTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncodableExtensionUnitTest.swift; sourceTree = "<group>"; };
3335 8656BC5D2484313F0023549D /* HttpUtilityIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpUtilityIntegrationTests.swift; sourceTree = "<group>"; };
6466 isa = PBXGroup;
6567 children = (
6668 8656BC572483E3C60023549D /* EncodableExtension.swift */,
69+ 86171D7B24C7330000D71D06 /* UIImageViewExtension.swift */,
6770 );
6871 path = Extensions;
6972 sourceTree = "<group>";
245248 files = (
246249 86719EB124720E40002A2AB0 /* HttpUtility.swift in Sources */,
247250 8656BC582483E3C60023549D /* EncodableExtension.swift in Sources */,
251+ 86171D7C24C7330000D71D06 /* UIImageViewExtension.swift in Sources */,
248252 );
249253 runOnlyForDeploymentPostprocessing = 0;
250254 };
Original file line number Diff line number Diff line change 1+ //
2+ // UIImageViewExtension.swift
3+ // HttpUtility
4+ //
5+ // Created by CodeCat15 on 7/21/20.
6+ // Copyright © 2020 CodeCat15. All rights reserved.
7+ //
8+
9+ import Foundation
10+ import UIKit
11+
12+ extension UIImageView
13+ {
14+ func downloadImageFromUrl( urlString: String )
15+ {
16+ let url = URL ( string: urlString) !
17+
18+ URLSession . shared. dataTask ( with: url) { ( data, response, error) in
19+
20+ if ( data != nil )
21+ {
22+ DispatchQueue . main. async {
23+ self . image = UIImage ( data: data!)
24+ }
25+ }
26+ } . resume ( )
27+
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments