Latest 1.1.0
Homepage https://github.com/Meniny/ImageFactory
License MIT
Platforms ios 8.0
Frameworks Foundation, UIKit
Authors




VersionAuthorBuild PassingSwift
PlatformsMIT
CocoapodsCarthageSPM

Introduction

What’s this?

ImageFactory is an easy way to make UIImage objects.

Requirements

  • iOS 8.0+
  • Xcode 8 with Swift 3

Installation

CocoaPods

pod 'ImageFactory'

Contribution

You are welcome to fork and submit pull requests.

License

ImageFactory is open-sourced software, licensed under the MIT license.

Usage

public func += (lhs: inout [ImageFactory], rhs: ImageFactory) {
    lhs.append(rhs)
}
import ImageFactory
var factoryArray: [ImageFactory] = []
let sizeType = CGSizeType.fixed(CGSize(width: 100, height: 100))

factoryArray += ImageFactory(fillColor: .brown)
factoryArray += ImageFactory(fillGradient: [.red, .green])

factoryArray += ImageFactory(borderColor: .red, width: 10, size: sizeType)
factoryArray += ImageFactory(border: .yellow, width: 10, background: .green, size: sizeType)
factoryArray += ImageFactory(borderGradient: [.green, .yellow, .red], width: 10, size: sizeType)
factoryArray += ImageFactory(border: .red, width: 10, alignment: .inside, background: .purple, size: sizeType, cornerRadius: CGCornerRadius(.all, radius: 15))

let image = factoryArray.first!.image // UIImage?

let finder = #imageLiteral(resourceName: "finder")

let _ = ImageFactory.clipEllipse(image: finder) // UIImage?
let _ = ImageFactory.clipRect(image: finder, rect: CGRect(x: 10, y: 10, width: 30, height: 30)) // UIImage?
let _ = ImageFactory.scale(image: finder, to: size / 10) // UIImage?
let _ = ImageFactory.clipRect(image: finder, cornerRadius: CGCornerRadius(.all, radius: 50)) // UIImage?

Latest podspec

{
    "name": "ImageFactory",
    "version": "1.1.0",
    "summary": "An easy way to make UIImage objects.",
    "description": "EnumCollection is an easy way to make UIImage objects.",
    "homepage": "https://github.com/Meniny/ImageFactory",
    "license": "MIT",
    "authors": {
        "Elias Abel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Meniny/ImageFactory.git",
        "tag": "1.1.0"
    },
    "social_media_url": "https://meniny.cn/",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ImageFactory/**/*.{h,swift}",
    "public_header_files": "ImageFactory/**/*{.h}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This