Fixed errors and changed minimum version
NerdzUtils is a list of useful classes and extensions for simplifying development with Swift language and UIKit framework
NerdzUtils
Swift
UIKit
LoadableImageView
Simple loading image from url
avatarImageView.loadableImage = .fromUrl(object.url)
Loading image from url with caching
let blurInfo = BlurHashInfo( hash: object.hash, size: CGSize(width: 16, height: 16 ) avatarImageView.loadableImage = .fromUrl( object.url, storingPolicy: .cache(timeout: 3600), blurHash: blurInfo)
placeholderImage
UIImage?
read-write
IBInspectable
loadableImage
LoadableImage
LoadableImageView.LoadableImage
TYPE: enum
enum
An enum that represents different ways of loading image for LoadableImageView
.fromUrl( _ url: URL?, storingPolicy: ImageStoringPolicy, blurHash: BlurHashInfo? = nil, completion: ((UIImage?) -> Void)? = nil )
Representation of an image in URL format
URL
url
URL?
storingPolicy
ImageStoringPolicy
blurHash
BlurHashInfo?
nil
blur.sh
completion
((UIImage?) -> Void)?
.fromData( _ data: Data?, scale: CGFloat = 1 )
Representation of an image in Data format
Data
data
Data?
scale
CGFloat
1
.named(_ name: String)
Representation of a local image that can be retrived by name
name
String
.image(_ image: UIImage)
UIImage representation
UIImage
image
.placeholder
Setting image to placeholder state
LoadableImageView.ImageStoringPolicy
Represents a way of storing loaded image by LoadableImageView class
For more imformation follow the docummentation of LoadableImageView
.none
No storing needed
.cache(timeout: TimeInterval? = nil)
Loaded image needs to be cached
If timeout is not provided - image will be cached while target exist
timeout
TimeInterval?
Weak<T>
TYPE: class
class
Adding a possibility of having a weak referance in strong wrapper. Useful for cases when you need a weak referance for objects in Array or Dictionary
Array
Dictionary
class SomeClass { // All objects stored in this array will be storred with weak reference private let weekArray = Array<Weak<AnotherClass>>() }
object
T?
init(_ object: T?)
Initialize wrapper with wrapped object
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
NerdzUtils
NerdzUtils
is a list of useful classes and extensions for simplifying development withSwift
language andUIKit
frameworkLoadableImageView
Simple loading image from url
Loading image from url with caching
Properties
placeholderImage
UIImage?
read-write
IBInspectable
loadableImage
LoadableImage
read-write
@
LoadableImageView.LoadableImage
enumTYPE:
enum
An enum that represents different ways of loading image for
LoadableImageView
Cases
Representation of an image in
URL
formaturl
URL?
storingPolicy
ImageStoringPolicy
blurHash
BlurHashInfo?
nil
blur.sh
if it is supported by imagecompletion
((UIImage?) -> Void)?
nil
Representation of an image in
Data
formatdata
Data?
scale
CGFloat
1
Representation of a local image that can be retrived by name
name
String
UIImage
representationimage
UIImage
Setting image to placeholder state
@
LoadableImageView.ImageStoringPolicy
enumTYPE:
enum
Represents a way of storing loaded image by
LoadableImageView
classCases
No storing needed
Loaded image needs to be cached
timeout
TimeInterval?
nil
@
Weak<T>
classTYPE:
class
Adding a possibility of having a weak referance in strong wrapper. Useful for cases when you need a weak referance for objects in
Array
orDictionary
Usage examples
Properties
object
T?
read-write
Methods
Initialize wrapper with wrapped object
object
T?