CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

UIImageColorSwift 1.0.1

UIImageColorSwift 1.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Daniela Dias, Shagun Madhikarmi.



  • By
  • Shagun Madhikarmi and Daniela Dias

UIImage+Color.swift

An iOS helper class for creating a UIImage from a UIColor.

Dependencies

Installation

Manually

  • Add the UIImage+Color.swift file from the Sources folder to your Xcode project.

Usage

For creating a UIImage from a UIColor

let image = UIImage.imageFromColor(UIColor.blue)

// Applying the image to the background of a UIButton

button.setBackgroundImage(image, forState: .normal)

To specify the size of the image:

let image = UIImage.imageFromColor(UIColor.blue, width: 1.0, height: 2.0)

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See the Code of Conduct file.

Maintainers

License

UIImageColorSwift is released under the MIT License. See License.