Latest 0.0.2
Homepage https://github.com/YJManager/YJExtensions
License MIT
Platforms ios 8.0, requires ARC
Authors

YJExtensions

Language
CocoaPods
CocoaPods
Carthage Compatible
GitHub tag
license

YJExtensions 常用扩展集合

Adding YJSwiftExtensions to your project (添加 YJSwiftExtensions 到你的项目)

CocoaPods

  1. Add a pod entry for YJSwiftExtensions to your Podfile
    pod 'YJSwiftExtensions'
  2. Install the pod(s) by running
    pod install
  3. Include YJSwiftExtensions wherever you need it with
    import YJSwiftExtensions

Carthage

  1. Add YJSwiftExtensions to your Cartfile.
    github "YJManager/YJSwiftExtensions"
  2. Run
    carthage update
  3. Follow the rest of the standard Carthage installation instructions to add YJSwiftExtensions to your project.

Example举例:

由颜色生成图片

/// 颜色生成图片
public static func yj_createImage(_ color: UIColor) -> UIImage? {

let rect = CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
context?.setFillColor(color.cgColor)
context?.fill(rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image ?? nil
}

Latest podspec

{
    "name": "YJSwiftExtensions",
    "version": "0.0.2",
    "summary": "YJSwiftExtensions is commonly used extensions of swift",
    "description": "YJSwiftExtensions is commonly used extensions of swift, welcome to issue.",
    "homepage": "https://github.com/YJManager/YJExtensions",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "houmanager": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/YJManager/YJExtensions.git",
        "tag": "0.0.2",
        "submodules": true
    },
    "source_files": "YJSwiftExtensions/*.{swift}",
    "pushed_with_swift_version": "3.0",
    "subspecs": [
        {
            "name": "UIKit",
            "source_files": "YJSwiftExtensions/UIKit/*.{swift}"
        },
        {
            "name": "Foundation",
            "source_files": "YJSwiftExtensions/Foundation/*.{swift}"
        }
    ]
}

Pin It on Pinterest

Share This