Latest 0.0.2
Homepage https://github.com/jezzmemo/JJSwiftExtension
License MIT
Platforms ios 9.0, osx 10.9
Authors

CocoaPods Compatible
Carthage Compatible
Platform
JJSwiftExtension
License MIT

收集一些常用的扩展,方便开发,提高开发效率,大部分扩展都是基于je命名域,简化常用操作

安装要求

  • 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.2")
    ]
)

Target添加依赖的名称:

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

手动

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

如何使用

SwiftStandLib

String

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

Foundation

FileManager

FileManager.default.je.documentPath
FileManager.default.je.libraryPath
FileManager.default.je.cachePath

UIKit

UIApplication

UIApplication.shared.je.appVersion
UIApplication.shared.je.buildVersion
UIApplication.shared.je.appDisplayName
UIApplication.shared.je.currentViewController

UIColor

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

UIScreen

UIScreen.je.screenWidth
UIScreen.je.screenHeight
UIScreen.je.screenSize

UIView

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

UIDevice

UIDevice.je.isPhone
UIDevice.je.isPad
UIDevice.je.isRetina
UIDevice.je.deviceVersion()

DispatchQueue

asyncMain(block)
delayAsyncMain(time,block)

TODO

  • 标准库的需要加强
  • 搜集更多扩展

License

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

Latest podspec

{
    "name": "JJSwiftExtension",
    "version": "0.0.2",
    "summary": "Commonly used Swift Extension.",
    "description": "JJSwiftExtension Commonly used Swift Extension.",
    "homepage": "https://github.com/jezzmemo/JJSwiftExtension",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u674eu6770": "[email protected]"
    },
    "platforms": {
        "ios": "9.0",
        "osx": "10.9"
    },
    "source": {
        "git": "https://github.com/jezzmemo/JJSwiftExtension.git",
        "tag": "0.0.2"
    },
    "default_subspecs": "All",
    "subspecs": [
        {
            "name": "All",
            "dependencies": {
                "JJSwiftExtension/JJSwiftExtensionBase": [],
                "JJSwiftExtension/UIKit+JJExtension": [],
                "JJSwiftExtension/Foundation+JJExtension": [],
                "JJSwiftExtension/SwiftStandLib": [],
                "JJSwiftExtension/DispatchQueue": []
            }
        },
        {
            "name": "UIKit+JJExtension",
            "requires_arc": true,
            "source_files": "JJSwiftExtension/Source/UIKit+JJExtension/*.{swift}",
            "dependencies": {
                "JJSwiftExtension/JJSwiftExtensionBase": []
            }
        },
        {
            "name": "Foundation+JJExtension",
            "requires_arc": true,
            "source_files": "JJSwiftExtension/Source/Foundation+JJExtension/*.{swift}",
            "dependencies": {
                "JJSwiftExtension/JJSwiftExtensionBase": []
            }
        },
        {
            "name": "SwiftStandLib",
            "requires_arc": true,
            "source_files": "JJSwiftExtension/Source/SwiftStandLib/*.{swift}",
            "dependencies": {
                "JJSwiftExtension/JJSwiftExtensionBase": []
            }
        },
        {
            "name": "DispatchQueue",
            "requires_arc": true,
            "source_files": "JJSwiftExtension/Source/DispatchQueue/*.{swift}"
        },
        {
            "name": "JJSwiftExtensionBase",
            "requires_arc": true,
            "source_files": "JJSwiftExtension/Source/*.{swift}"
        }
    ]
}

Pin It on Pinterest

Share This