Latest 1.0.0
Homepage https://github.com/fuji2013/PlaceholderImage
License MIT
Platforms ios 8.0
Authors

use to display temporary images in development.

Carthage compatible

Features

  • use to display temporary images in development.

screenshot01

How to use

if need memory cache, use singleton object to create image.
if don’t need memory cache, use class methods.

/// MARK: if need memory cache, use singleton object to create image.
// create a placeholder image of rectangle
let rectangleImage = PlaceholderImage.shared.rect(width: 100, height: 100, color: UIColor.black)
let rectangleImageView = UIImageView(image: rectangleImage)
rectangleImageView.frame = CGRect(x: 50, y: 50, width: 100, height: 100)
view.addSubview(rectangleImageView)

// create a placeholder image of circle
let circleImage = PlaceholderImage.shared.circle(width: 50, height: 50, color: UIColor.red, textColor: UIColor.black)
let circleImageView = UIImageView(image: circleImage)
circleImageView.frame = CGRect(x: 50, y: 150, width: 50, height: 50)
view.addSubview(circleImageView)

/// MARK:  if don't need memory cache, use class methods.
let rectangleImage2 = PlaceholderImage.rect(width: 100, height: 100, color: UIColor.black)
let rectangleImageView2 = UIImageView(image: rectangleImage2)
rectangleImageView2.frame = CGRect(x: 100, y: 250, width: 100, height: 100)
view.addSubview(rectangleImageView2)

// create a placeholder image of circle
let circleImage2 = PlaceholderImage.circle(width: 50, height: 50, color: UIColor.red, textColor: UIColor.black)
let circleImageView2 = UIImageView(image: circleImage2)
circleImageView2.frame = CGRect(x: 100, y: 350, width: 50, height: 50)
view.addSubview(circleImageView2)

Runtime Requirements

  • iOS 8.0 or later
  • Xcode 9.2 – Swift4

Installation and Setup

Installing with Carthage

Just add to your Cartfile:

github "fuji2013/PlaceholderImage"

Installing with CocoaPods

CocoaPods is a centralised dependency manager that automates the process of adding libraries to your Cocoa application. You can install it with the following command:

$ gem update
$ gem install cocoapods
$ pods --version

To integrate PlaceholderImage into your Xcode project using CocoaPods, specify it in your Podfile and run pod install.

platform :ios, '8.0'
use_frameworks!
pod "PlaceholderImage", '~>1.0.0'

Manual Installation

To install PlaceholderImage without a dependency manager, please add PlaceholderImage.swift to your Xcode Project.

Contribution

Please file issues or submit pull requests for anything you’d like to see! We’re waiting! :)

License

PlaceholderImage.swift is released under the MIT license. Go read the LICENSE file for more information.

Latest podspec

{
    "name": "PlaceholderImage",
    "version": "1.0.0",
    "summary": "use to display temporary images in development.",
    "description": "- use to display temporary images in development.",
    "homepage": "https://github.com/fuji2013/PlaceholderImage",
    "screenshots": "https://user-images.githubusercontent.com/4578511/34076567-a08b619a-e32e-11e7-8042-f8b14e277631.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "hf": "[email protected]"
    },
    "social_media_url": "https://github.com/fuji2013",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/fuji2013/PlaceholderImage.git",
        "tag": "1.0.0"
    },
    "source_files": "PlaceholderImage/**/*.swift",
    "requires_arc": false,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This