Contents

heroesofcode/magicimages

## Overview

Overview

  • [x] A library to facilitate the development of the image in various ways.
  • [x] Provides caching support.
  • [x] 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

<img src="https://github.com/heroesofcode/MagicImages/blob/main/assets/start.png" width="310" height="680" />

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.

<img src="https://github.com/heroesofcode/MagicImages/blob/main/assets/circle.png" width="310" height="680" />

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

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

<img src="https://github.com/heroesofcode/MagicImages/blob/main/assets/rounded.png" width="310" height="680" />

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. <b>Measure</b> is rounded edges, follow the example below

<img src="https://github.com/heroesofcode/MagicImages/blob/main/assets/sides.png" width="310" height="680" />

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.6.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.

License

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

Package Metadata

Repository: heroesofcode/magicimages

Default branch: main

README: README.md