Swiftpack.co - nnsnodnb/MultipleImageView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nnsnodnb.
nnsnodnb/MultipleImageView 0.2.0
:framed_picture: Displaying multiple images like 𝕏 (previously know as Twitter).
⭐️ 4
🕓 1 year ago
iOS
.package(url: "https://github.com/nnsnodnb/MultipleImageView.git", from: "0.2.0")

MultipleImageView

Swift 5.x Cocoapods platforms Cocoapods Carthage compatible Swfit Package Manager supported
Actions Lint CocoaPods Trunk Podspec Swift build SwiftLint

Displaying multiple images like Twitter.

Installation

CocoaPods

pod 'MultipleImageView'

Carthage

github "nnsnodnb/MultipleImageView"

Swift Package Manager

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "SampleApp",
    dependencies: [
        .package(name: "MultipleImageView",
                 url: "https://github.com/nnsnodnb/MultipleImageView.git",
                 from: "0.2.0")
    ],
    .targets: [
        .target(name: "SampleApp,
                dependencies: ["MultipleImageView"])
    ]
)

Usage

import MultipleImageView

final class SomeView: UIView, MultipleImageViewDelegate {

    func configure() {
        let imageView = MultipleImageView(frame: .zero)
        addSubview(imageView)
        // Autolayout
        imageView.sources = [
            .uiimage(anyImage),
            .url(anyURL),
            .custom { imageView in
                // something fetch image
                imageView.image = image
            }
        ]
        imageView.delegate = self
    }

    // MARK: - MultipleImageViewDelegate
    func multipleImageViewShouldGetImage(_ imageView: UIImageView, sourceForURL url: URL, index: Int) {
        // Your project's image fetch & cache algorithm.
    }

    func multipleImageViewDidSelect(_ imageView: UIImageView, index: Int) {
    }
}

And please see Example project.

License

MultipleImageView is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 4
Last commit: 2 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v0.2.0
1 year ago

What's Changed

Full Changelog: https://github.com/nnsnodnb/MultipleImageView/compare/0.1.3...0.2.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics