Swiftpack.co - Package - jezzmemo/JJSwiftExtension

CocoaPods Compatible Carthage Compatible Platform License MIT

JJSwiftExtension

收集一些常用的扩展,方便开发,提高开发效率,所有的扩展都是基于jje命名域

安装要求

  • Swift4+
  • iOS9
  • Xcode 8.0+

如何安装

Cocoapod

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'JJSwiftExtension'
end

Cartfile

github "jezzmemo/JJSwiftExtension"

Swift Package Manager

添加依赖的地址和版本

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    targets: [],
    dependencies: [
        .package(url: "https://github.com/jezzmemo/JJSwiftExtension.git", from: "0.0.1")
    ]
)

Target添加依赖的名称:

.target(
    name: "YOUR_TARGET_NAME",
    dependencies: [
        "JJSwiftExtension",
    ]
),
swift package update

手动

将工程里的Source文件件复制自己的工程里即可

如何使用

Foundation

String

"test".jje.trim()
"test".jje.utf8String()
"test".jje.length

FileManager

FileManager.default.jje.documentPath
FileManager.default.jje.libraryPath
FileManager.default.jje.cachePath

UIKit

UIApplication

UIApplication.shared.jje.appVersion
UIApplication.shared.jje.buildVersion
UIApplication.shared.jje.appDisplayName
UIApplication.shared.jje.currentViewController

UIColor

UIColor.jje.random
UIColor.jje.hexIntColor(0x121212)
UIColor.jje.hexStringColor("0x757575")

UIScreen

UIScreen.jje.screenWidth
UIScreen.jje.screenHeight
UIScreen.jje.screenSize

UIView

view.jje.left
view.jje.right
view.jje.top
view.jje.bottom
view.jje.width
view.jje.height
view.jje.size

DispatchQueue

DispatchQueue.jje.main(block)
DispatchQueue.jje.delay(time,block)

UIDevice

UIDevice.jje.isPad
UIDevice.jje.isRetina
UIDevice.jje.deviceVersion()

License

JJSwiftExtension is released under the MIT license. See LICENSE for details.

Github

link
Stars: 4
Help us keep the lights on

Dependencies

Used By

Total: 0