Skip to content

Commit 24d764e

Browse files
author
burak.uzunboy
committed
Modifiers are corrected
1 parent 77083e1 commit 24d764e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Sources/UsefulNetworkLayer/Extensions/UIImage+ResponseImage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import UIKit
1111
/**
1212
Extends UIImage with Network Layer compatible `ResponseImage` class. With that, image class can directly respond to URLs.
1313
*/
14-
extension UIImage {
14+
public extension UIImage {
1515

1616
/// Returns immediately if image is available on the cache, otherwise requests from Network Layer and calls completion block.
1717
@discardableResult
18-
open class func fromURL(_ url: URL, completion: @escaping (_ image: UIImage?)->()) -> UIImage? {
18+
class func fromURL(_ url: URL, completion: @escaping (_ image: UIImage?)->()) -> UIImage? {
1919
let api = APIConfiguration(url: url, responseBodyObject: ResponseImage.self, cachingTime: NetworkLayer.CachingTime(seconds: 60*60*24))
2020

2121
api.request { (result) in
@@ -34,14 +34,14 @@ extension UIImage {
3434
}
3535

3636
/// Returns immediately the image if it is available on the cache.
37-
open class func fromCache(_ url: URL) -> UIImage? {
37+
class func fromCache(_ url: URL) -> UIImage? {
3838
let api = APIConfiguration(url: url, responseBodyObject: ResponseImage.self)
3939
guard let response = NetworkLayer.cache?.cachedResponse(for: URLRequest(url: api.requestURL)) else { return nil }
4040
return UIImage(data: response.data)
4141
}
4242

4343
/// Downloads image and saves to the cache for future uses.
44-
open class func download(_ url: URL) {
44+
class func download(_ url: URL) {
4545
let api = APIConfiguration(url: url, responseBodyObject: ResponseImage.self, priority: .veryLow, isMainOperation: false)
4646
api.request { (_) in }
4747
}

Sources/UsefulNetworkLayer/Extensions/UIImageView+ImageURL.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
import UIKit
1010

11-
extension UIImageView {
11+
public extension UIImageView {
1212

1313
/// Creates and sets Image to the ImageView from given remote URL.
1414
///
1515
/// During the loading process, this method is also capable to add activity indicator.
1616
/// Change tag value if other method will be called also to change image of the imageview to override again.
17-
open func imageFromUrl(urlString: String?, fallback: UIImage?, errorCompletion: ((_ error: NSError)->())? = nil){
17+
func imageFromUrl(urlString: String?, fallback: UIImage?, errorCompletion: ((_ error: NSError)->())? = nil){
1818
guard let urlStr = urlString, let url = URL(string: urlStr) else {
1919
self.image = fallback
2020
return
@@ -29,7 +29,7 @@ extension UIImageView {
2929
- parameter completion: Returns the image that set to imageview even it fallbacks to error. If `fallback` is set, at worst it will return the fallback.
3030
- parameter errorCompletion: This block will be called if any error happens
3131
*/
32-
open func imageFromUrl(url: URL?, fallback: UIImage?,
32+
func imageFromUrl(url: URL?, fallback: UIImage?,
3333
errorCompletion: ((_ error: NSError)->())? = nil,
3434
completion: ((_ image: UIImage?)->())?) {
3535
guard let url = url else {

0 commit comments

Comments
 (0)