Latest 1.1.1
Homepage https://github.com/konojunya/ImageFit
License MIT
Platforms ios 10.0
Authors

CocoaPods
Carthage Compatible
[platform]()
[swift version]()
[CocoaPods]()
[Twitter]()

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

Description

Draw UIImage in the center while keeping aspect ratio of aspect ratio.

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', '~> 1.0.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Alamofire into your Xcode project using Carthage, specify it in your Cartfile:

github "konojunya/ImageFit" ~> 1.0.0

Run carthage update to build the framework and drag the built Alamofire.framework into your Xcode project.

LICENSE

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

Author

I’m a student at HAL Osaka.

Latest podspec

{
    "name": "ImageFit",
    "version": "1.1.1",
    "summary": "ImageFit is a library that optimize UIImage according to vertical and horizontal size.",
    "description": ""ImageFit is a library that optimize UIImage according to vertical and horizontal size."",
    "homepage": "https://github.com/konojunya/ImageFit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Junya Kono": "junya.developer@gmail.com"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/konojunya/ImageFit.git",
        "tag": "1.1.1"
    },
    "source_files": "ImageFit/*.swift",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This