MagicImages

1.5.0

Magic Image is a library to facilitate the development of the image in various ways for iOS & tvOS
heroesofcode/MagicImages

What's New

visionOS Support

2024-03-24T17:29:57Z

What's new?

  • Added visionOS Support

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

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.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Nov 20 2024 22:55:09 GMT-1000 (Hawaii-Aleutian Standard Time)