Resizin is iOS SDK for Ackee's image server resizin.com
Resizin requires iOS 8 and later.
Resizin is available through CocoaPods. To install it, simply add the following line to your Podfile:
Resizin is also available through Carthage. To install it, simply add the following line to your Cartfile
At the beginning you need to set up the shared
ResizinManager using your project name and client key. Typically you do this in your
let projectName = "ackee" // put your project name here let clientKey = "ackee_test_key" // put your client key here ResizinManager.setupSharedManager(projectName: projectName, clientKey: clientKey)
When you have your shared manager set up you can then obtain direct url to you image.
let imageURL = ResizinManager.shared.url(for: "image_key")
This url just obtains url to the image "as is", if you want to apply any transformations you need to provide
You can request various transformations:
- crop mode
- upscale flag
- background color
let size = ResizinSize(cgSize: CGSize(width: 100, height: 200), scale: Int(UIScreen.main.scale)) let settings = ResizinSettings(size: Constants.resizinSize, cropMode: .fill) let imageURL = ResizinManager.shared.url(for: "image_key", settings: settings)
Resizin is available under the MIT license. See the LICENSE file for more info.