kk-vv / ZeroXmas

Common UI Config/Utils For iOS Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZeroXmas

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ZeroXmas is available through CocoaPods. To install it, simply add the following line to your Podfile:

swift >= 4.2
pod 'ZeroXmas'

IMG

  • Demo
IMG1 IMG2 IMG3
1 2 3
  • Config
CONFIG
config

Usage

import ZeroXmas

Tint Color

UIColor.zx.tint
UIColor.zx.subTint
UIColor.zx.background
UIColor.zx.border
UIColor.zx.empty
UIColor.zx.customA
UIColor.zx.customB
UIColor.zx.customC
  • Config
ZXTintColorConfig.plist
c

Font

  • Color
UIColor.zx.title
UIColor.zx.body
UIColor.zx.mark
  • Font
UIFont.zx.titleFont()
UIFont.zx.markFont()
UIFont.zx.bodyFont()

//more:
UIFont.zx.bodyFont(18)
UIFont.zx.bodyFont(fix: -1)//size = ZXFontConfig.bodyFontSize - 1
UIFont.zx.bodyFont(fix: 1) //size = ZXFontConfig.bodyFontSize + 1

//iconFont
UIFont.zx.iconFont()
  • Config
ZXFontConfig.plist
c

NavBar

  • Load
ZXConfig.loadNavBarConfig()
  • Color
UIColor.zx.navBar.xxx
  • Extension fo vc
self.zx.addNavBarButtonItems(textNames: ["关闭"], font: nil, color: UIColor.yellow, at: .left)

self.zx.addNavBarButtonItems(textNames: ["\u{e673}"], font: UIFont.zx.iconFont(30), color: UIColor.zx.subTint, at: .right, fixSpace: 5)
TEST
t
  • Config
ZXNavBarConfig.plist
c

TabBar

  • Load
ZXConfig.loadTabBarConfig()
  • Usage
tabBar = UITabBarController()
tabBar.zx.addChild(T1ViewController(), fromPlistItemIndex: 0, imageAsTemplate: true)
tabBar.zx.addChild(T2ViewController(), fromPlistItemIndex: 1)
tabBar.zx.addChild(T3ViewController(), fromPlistItemIndex: 2)//showAsPresent
tabBar.zx.addChild(T4ViewController(), fromPlistItemIndex: 3, imageAsTemplate: true)
tabBar.zx.addChild(T5ViewController(), fromPlistItemIndex: 4, imageAsTemplate: true)
...
  • Config
ZXTabBarConfig.plist
c

Tiny Network

ZXNetwork.async(...)
ZXNetwork.uploadImage(...)
ZXNetwork.fileupload(...)

Common Extension

Bundle
NSAttributedString
ReusableView
String
Timer
UIAlertController
...

Use ZX

extension ZeroXmas where Base: XXX {
	static func sFunc() {}
	func Func() {}
}

XXX.zx.sFunc()
XXX().zx.Func()

Author

iFallen, hulj1204@yahoo.com

License

ZeroXmas is available under the MIT license. See the LICENSE file for more info.

About

Common UI Config/Utils For iOS Swift

License:MIT License


Languages

Language:Swift 99.2%Language:Ruby 0.8%