StyleKit 可配置 UI Style 工具库

程序名称:StyleKit

授权协议: MIT

操作系统: OS X

开发语言: Swift

StyleKit 介绍

StyleKit 是能让你使用一个简单的 JSON 文件美化你的应用的微框架。

它如何工作?

按如下格式创建一个 JSON 文件:

{
    "UILabel": {
        "font": "HelveticaNeue-Bold:30.0",
        "backgroundColor": "#000FFF"
    },
    "StyleKitDemo.SKView": {
        "StyleKitDemo.SKLabel": {
            "font": "HelveticaNeue-Bold:20.0",
            "backgroundColor": "#FFF000",
            "color": "#fff"
        },
        "StyleKitDemo.SKButton": {
            "font": "HelveticaNeue-Light:20.0",
            "titleColor:normal": "#FFFFFF",
            "titleColor:highlighted": "#000000"
        }
    },
    "StyleKitDemo.SKNavigationBar": {
        "titleTextAttributes": {
            "NSColor": "#000FFF",
            "NSFont": "HelveticaNeue-Bold:30.0"
        }
    },
    "StyleKitDemo.SKTextField": {
        "font": "HelveticaNeue-Light:20.0",
        "textColor": "#000FFF"
    }
}

加载 JSON 文件

func application(application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    if let styleFile = NSBundle.mainBundle().URLForResource("style", withExtension: "json") {
        StyleKit(fileUrl: styleFile)?.apply()
    }
    return true
}

安装:

Carthage

github "146BC/StyleKit" ~> 0.3

CocoaPods

Add the 146BC Source

source 'https://github.com/146BC/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'


pod 'StyleKit', '~> 0.3

StyleKit 官网

https://github.com/146BC/StyleKit

相关编程语言

BBGestureBack Full screen return gesture(全屏手...
Framework7 或者叫 F7 是全功能的绑定 iOS 7 应用的...
iOS 调试库,支持 iOS8+,无需添加任何代码,方便 i...
DarkModeKit是在Apple官方的深色模式发布之前设计和...
SimpleNote iOS 版客户端。SimpleNote 是一款在多平...
Kivy iOS,此工具旨在为 iOS 编译必要的库以运行应用...