CommonFunctionSwift 0.1.4

CommonFunctionSwift 0.1.4

Tests已测试
Lang语言 SwiftSwift
许可证 MIT
Released最后发布2017年4月
SwiftSwift 版本3.0
SPM支持 SPM

Tanakorn Phoochaliaw 维护。



CommonFunctionSwift

安装

CommonFunctionSwift 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'CommonFunctionSwift'

将 CommonFunctionSwift 导入到希望使用库的类中。

import CommonFunctionSwift

示例

颜色函数

  • UIColorFromRGB
self.backLabel.textColor = ColorFunction.colorFromRGB(rgbValue: 0xbb3af4)

文本函数

  • numberToCurency
self.number01.text = TextFunction.numberToCurency(amount: 3)  // return 3.00
self.number02.text = TextFunction.numberToCurency(amount: 3.3)  // return 3.30
self.number03.text = TextFunction.numberToCurency(amount: 3.33)  // return 3.33
self.number04.text = TextFunction.numberToCurency(amount: 3000)  // return 3,000.00
self.number05.text = TextFunction.numberToCurency(amount: 3.3333)  // return 3.33

图像函数

  • resizeImageSquare
let newImage01 = ImageFunction.resizeImageSquare(image: UIImage(), newSize: 20)  // New image size = 20x20
  • resizeImageCustom
let newImage02 = ImageFunction.resizeImageCustom(image: UIImage(), width: 100, height: 50)  // New image size = 100x50

作者

Tanakorn Phoochaliaw, [email protected]

许可证

CommonFunctionSwift 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。