Magic Image is a library to facilitate the development of the image in various ways.
iOS / tvOS
You can use it to view an image through a url, follow the example below
let photo: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(photo)
photo.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
photo.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
photo.widthAnchor.constraint(equalToConstant: 100).isActive = true
photo.heightAnchor.constraint(equalToConstant: 100).isActive = true
MagicImages(image: photo).start(url: "IMAGE URL")
}
You can use it to view a circular image. Measure is the width and height, follow the example below
let photo: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(photo)
photo.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
photo.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
MagicImages(image: photo).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
let photo: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(photo)
photo.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
photo.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
photo.widthAnchor.constraint(equalToConstant: 300).isActive = true
photo.heightAnchor.constraint(equalToConstant: 200).isActive = true
MagicImages(image: photo).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
let photo: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
return imageView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(photo)
photo.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
photo.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
photo.widthAnchor.constraint(equalToConstant: 300).isActive = true
photo.heightAnchor.constraint(equalToConstant: 200).isActive = true
MagicImages(image: photo).start(url: "IMAGE URL").isSides([.topLeft, .bottomRight], measures: 50)
}
dependencies: [
.package(url: "https://github.com/heroesofcode/MagicImages.git", .upToNextMajor(from: "0.4.3"))
]
import MagicImages
import MagicImages
target '<Your Target Name>' do
pod 'MagicImages'
end
OR
target '<Your Target Name>' do
pod 'MagicImages', :git => "https://github.com/heroesofcode/MagicImages.git"
end
$ pod install
github "heroesofcode/MagicImages"
Coded by João Lucas
MIT License
Copyright (c) 2021 Heroes of Code
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
link |
Stars: 2 |
Last commit: 2 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics