- A library to facilitate the development of the image in various ways.
- Provides caching support.
- SwiftUI support.
- iOS 13.0+ / tvOS 13.0+ / visionOS 1.0+
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"))
var body: some View {
MagicImagesUI(url: "www.example.com/image.jpg")
.frame(width: 300, height: 300)
.cornerRadius(20)
}
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)
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)
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)
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"]),
]
)
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.
MagicImages is released under the MIT license. See LICENSE for details.