taketin / DieCast

A convert the material (e.g. number) to the image library written in Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DieCast

Swift 3 Build Status Carthage compatible

DieCast is a library for convert the material (e.g. number) to the image in Swift.

ScreenShot

2016-02-01 23 56 02

Installation

Carthage

  • Insert github "taketin/DieCast" ~> 0.1.1 to your Cartfile.
  • Run carthage update.
  • Link your app with DieCast.framework in Carthage/Build

CocoaPods

  • Insert pod 'DieCast', '~> 0.1.1' to your Podfile.
  • Run pod install

Usage

Look at Demo App. very easy.

if let diecast = DieCast(material: 1234567890) {
    let diecastView = diecast.press()
    view.addSubview(diecastView)
}

If you want to use your own images with Asset Catalog, Please follow.

(The numbers of the image, please put the file name from 0 to 9 after the prefix.)

if let diecast = DieCast(material: 1234567890, type: IntCast.Custom, filenamePrefix: "your_image_prefix_") {
    ...
}

Custom settings

  • magnification
  • height
  • margin

Please follow.

if let diecast = DieCast(material: 1234567890) {
    // setting to magnification of image.
    diecast.magnification = 0.06

    // setting to height of image, width will be the same ratio.
    // (magnification will be applied in priority.)
    diecast.height = 50

    // setting to margin of each images.
    diecast.margin = 5.0

    let diecastView = diecast.press()
    view.addSubview(diecastView)
}

License

DieCast is released under the MIT license.

About

A convert the material (e.g. number) to the image library written in Swift.


Languages

Language:Swift 76.7%Language:Ruby 18.3%Language:Objective-C 5.0%