Swiftpack.co - heroesofcode/MagicImages as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by heroesofcode.
heroesofcode/MagicImages 1.5.0
Magic Image is a library to facilitate the development of the image in various ways for iOS & tvOS
⭐️ 4
🕓 4 days ago
iOS tvOS
.package(url: "https://github.com/heroesofcode/MagicImages.git", from: "1.5.0")

CI SPM compatible License

Overview

  • ☑ A library to facilitate the development of the image in various ways.
  • ☑ Provides caching support.
  • ☑ SwiftUI support.

Requirements

  • iOS 13.0+ / tvOS 13.0+ / visionOS 1.0+

Usage

First Example

You can use it to view an image through a url, follow the example below

MagicImages(image: imageView).start(url: "IMAGE URL")
    
// OR

MagicImages(image: imageView).start(url: "IMAGE URL", placeholder: "PhotoLocal")

// OR
    
MagicImages(image: imageView).start(name: "IMAGE NAME")
    
// OR
    
MagicImages(image: imageView).start(uiImage: UIImage(systemName: "heart.fill"))

Example SwiftUI

var body: some View {
     MagicImagesUI(url: "www.example.com/image.jpg")
        .frame(width: 300, height: 300)
        .cornerRadius(20)
}

Second Example

You can use it to view a circular image. Measure is the width and height, follow the example below. Here you don't need to put width and height in the constraint, in the measure parameter Magic Images is already doing that.

MagicImages(image: imageView).start(url: "IMAGE URL").isCircle(measure: 100)

Third Example

You can use it to see an image with rounded edges. Measure is rounded edges, follow the example below

MagicImages(image: imageView).start(url: "IMAGE URL").isRounded(measure: 20)

Last Example

You can use it to see an image with some sides of the rounded edges. Measure is rounded edges, follow the example below

MagicImages(image: imageView).start(url: "IMAGE URL").isSides([.topLeft, .bottomRight], measures: 50)

Installation

Swift Package Manager (SPM)

import PackageDescription
let package = Package(
    name: "<Your Product Name>",
    dependencies: [
       .package(url: "https://github.com/heroesofcode/MagicImages", .upToNextMajor(from: "1.5.0"))
    ],
    targets: [
        .target(
            name: "<Your Target Name>",
            dependencies: ["MagicImages"]),
    ]
)

Contributing

To contribute, just fork this project and then open a pull request, feel free to contribute, bring ideas and raise any problem in the issue tab.

Contributors

License

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

GitHub

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

Release Notes

visionOS Support
4 days ago

What's new?

  • Added visionOS Support

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