RemoteImage

0.3.0

insub4067/RemoteImage

What's New

0.3.0

2023-12-18T16:02:13Z

Full Changelog: 0.2.1...0.3.0

Changed

  • refactoring : class CacheManager -> actor CacheManager

🛜 RemoteImage

🤔 What is RemoteImage?

You can get image from url and cache easily. Support options for cache and animation for Image

✔️ Basic SwiftUI Example

RemoteImage(url) { image in
    image
        .resizable()
        .scaledToFit()
        .frame(width: 200, height: 200)
        .clipShape(Circle())
} placeholder: {
    Image(systemName: "person")
        .resizable()
        .scaledToFit()
        .frame(width: 200, height: 200)
        .clipShape(Circle())
}

✔️ Basic UIKit Example

var imageView = UIImageView() 
imageView.remoteImage(url) {
    .init(systemName: "person")! // Placeholder  
}

✔️ Parameter Example

var imageView = UIImageView()
let url = URL(string: "https://www......")! // Image URL
let parameter = RemoteImageParamter( // Parameter for Cache, Transition, Resize
    cacheType: .disk,
    withAnimation: true,
    duration: 0.2,
    option: .curveEaseIn,
    resizeWidth: 500
)
imageView.remoteImage(with: url, parameter: parameter) {
    .init(systemName: "person")! // Placeholder
}

Description

  • Swift Tools 5.4.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Oct 20 2024 23:32:52 GMT-0900 (Hawaii-Aleutian Daylight Time)