TestsTested | ā |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ā |
Maintained by konojunya.
ImageFit is a library that optimize UIImage according to vertical and horizontal size.
Extend UIImage and resize it while keeping the aspect raito of the image according to the larger width and height.
import ImageFit
ImageFit.drawInImage(image: <UIImage>, imageView: <UIImageView>)
ImageFit.drawInImage(image: <UIImage>, width: <CGFloat>, height: <CGFloat>)
sample code
import ImageFit
class ViewController: UIViewController {
@IBOutlet weak var imageView:UIImageView!
override func viewDidLoad(){
super.viewDidLoad()
let image = UIImage(named: "sample")
self.imageView.image = ImageFit.drawInImage(image: image,imageView: self.imageView)
}
}
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate Alamofire into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https:/github.com/CocoaPods/Spec.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'ImageFit', '~> 0.0.4'
end
Then, run the following command:
$ pod install
ImageFit is released under the MIT license. See LICENCE for details.
Iām a student at HAL Osaka.