Multi image downloader with priority in Swift

Overview

Vulcan

Build Status Carthage compatible Version Platform

Multi image downloader with priority in Swift

Features

  • Very light
  • Multi image download with priority
  • Caching images
  • Pure Swift
  • Composable image
  • Support WebP
Single download Multi download with priority
demo_01 demo_02

Installation

CocoaPods

Setup CocoaPods:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Vulcan

Podfile

platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'Vulcan'
end

Then, run the following command:

$ pod install

Carthage

Setup carthage:

$ brew update
$ brew install carthage

Cartfile

github "jinSasaki/Vulcan"

Usage

Image downloading and show

import Vulcan

// Single downloading
imageView.vl.setImage(url: URL(string: "/path/to/image")!)

// Multi downloading
// This image will be overridden by the image of higher priority URL.
imageView.vl.setImage(urls: [
    .url(URL(string: "/path/to/image")!, priority: 100),
    .url(URL(string: "/path/to/image")!, priority: 1000)
    ])

WebP image

If you installed via CocoaPods, add pod 'Vulcan/WebP'. If you installed via Carthage, add SwiftWebP.framework to project.

import Vulcan
import SwiftWebP // Only installed via Carthage

extension WebPDecoder: ImageDecoder {
    public func decode(data: Data, response: HTTPURLResponse, options: ImageDecodeOptions?) throws -> Image {
        let contentTypes = response.allHeaderFields.filter({ ($0.key as? String ?? "").lowercased() == "content-type" })
        guard
            let contentType = contentTypes.first,
            let value = contentType.value as? String,
            value == "image/webp",
            let image = WebPDecoder.decode(data) else {
                return try DefaultImageDecoder().decode(data: data, response: response, options: options)
        }
        return image
    }
}

// Set decoder to shared ImageDownloader
Vulcan.defaultImageDownloader.decoder = WebPDecoder()

// Request image with URL
imageView.vl.setImage(url: URL(string: "/path/to/image")!)

Requirements

  • iOS 9.0+
  • Xcode 8.1+
  • Swift 3.0.1+
You might also like...
A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

Convert the image to hexadecimal to send the image to e-paper

ConvertImageToHex Convert the image to hexadecimal to send the image to e-paper Conversion Order // 0. hex로 변환할 이미지 var image = UIImage(named: "sample

Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Image-cropper - Image cropper for iOS

Image-cropper Example To run the example project, clone the repo, and run pod in

An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.
Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.

GPUImage 2 Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview GPUImage 2 is the second generation of th

GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.

GPUImage 3 Janie Clayton http://redqueengraphics.com @RedQueenCoder Brad Larson http://www.sunsetlakesoftware.com @bradlarson contact@sunsetlakesoftwa

A lightweight and fast image loader for iOS written in Swift.

ImageLoader ImageLoader is an instrument for asynchronous image loading written in Swift. It is a lightweight and fast image loader for iOS. Features

Comments
  • Failed `carthage build Vulcan` 0.3.0

    Failed `carthage build Vulcan` 0.3.0

    Vulcan fails Release build by LLVM ERROR. (but succeeds Debug build)

    PHI node operands are not the same type as the result!
      %756 = phi %CSo8URLCache* [ %768, %767 ], [ %749, %751 ], !dbg !486
    PHI node operands are not the same type as the result!
      %768 = phi %CSo8URLCache* [ %702, %699 ], [ %749, %750 ], !dbg !502
    LLVM ERROR: Broken function found, compilation aborted!
    
    bug 
    opened by jinSasaki 0
  • load pixel single image

    load pixel single image

    some time singe image appear like pixel image

     let url = URL(string: "https://www.greetingsisland.com/images/invitations/profesional%20events/white%20string%20lights.jpg")!
            imageView.vl.setImage(url: url)
    

    Screen Shot 2019-10-27 at 11 49 37 PM

    opened by AMJ-7 0
  • Swift Compiler Error

    Swift Compiler Error

    I got a error while running:

    Initializer 'init()' is internal and cannot be referenced from a default argument value

    public init(cache: ImageCachable? = ImageCache(), configuration: URLSessionConfiguration = URLSessionConfiguration.default) {
            self.cache = cache
            self.configuration = configuration
    
            self.session = URLSession(configuration: configuration)
            self.configuration.urlCache = URLCache(memoryCapacity: cache?.memoryCapacity ?? 0, diskCapacity: cache?.diskCapacity ?? 0, diskPath: cache?.diskPath ?? nil)
    
            self.decoder = DefaultImageDecoder()
        }
    

    Swift 4.0,4.1 and 5.0

    opened by AMJ-7 0
  • Crashes and doesn't load multiple webp images on CATiledLayer

    Crashes and doesn't load multiple webp images on CATiledLayer

    Crashes on file Vulcan.swift line 148 self.dummyView?.removeFromSuperview() no console error message was show.

    All tiles in CATiledLayer are webp images and I'm trying to load them using Vulcan library. Only few tiles are rendered correctly.

    opened by bibinjacobpulickal 1
Releases(0.3.3)
Owner
Jin Sasaki
iOS Application Developer
Jin Sasaki
Asynchronous image downloader with cache support as a UIImageView category

This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like UIImageView, UIButton, M

null 24.4k Jan 5, 2023
Async image downloader with Mem&Disk cached as a UIImageView extension

HBWebImage Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation HBWebIm

haoboxuxu 1 Oct 22, 2022
DGImageView - Asynchronous image downloader with cache. Supports gif too

DGImageView Installation Usage DGImageView Asynchronous image downloader with cache. Supports gif, memory cache, disk cache features. Installation Xco

donggyu 1 Jan 1, 2022
Rounded async imageview downloader lightly cached and written in Swift

PASImageView ============ **Rounded async imageview downloader lightly cached and written in Swift 3 ** Objective-C version here Snapshot Usage //XIB

Pierre Abi-aad 173 Nov 6, 2022
SocialDownloaderApp - An exact copy of Social Downloader App by Sulton Handaya For Pelorous

SocialDownloaderApp It is a copy of Social Downloader App by Sulton Handaya For

prashant-humney 0 Jan 12, 2022
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 330 Sep 9, 2022
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

Adnan Yousaf 11 Jan 10, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023
AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Dmytro Anokhin 1k Jan 4, 2023