ImageFit 1.1.1

ImageFit 1.1.1

TestsTested āœ—
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2017
SwiftSwift Version 3.0
SPMSupports SPM āœ—

Maintained by konojunya.



ImageFit 1.1.1

  • By
  • Junya Kono

ImageFit is a library that optimize UIImage according to vertical and horizontal size.

Description

Extend UIImage and resize it while keeping the aspect raito of the image according to the larger width and height.

DEMO

Usage

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)
        
    }
    
}

Installation

CococaPods

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

LICENSE

ImageFit is released under the MIT license. See LICENCE for details.

Author

I’m a student at HAL Osaka.

@konojunya