CocoaPods trunk is moving to be read-only. Read more on the blog, there are 3 months to go.

CommonFunctionSwift 0.1.4

CommonFunctionSwift 0.1.4

TestsTested ✗
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.0
SPMSupports SPM ✗

Maintained by Tanakorn Phoochaliaw.



CommonFunctionSwift

Installation

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

pod 'CommonFunctionSwift'

And mmport CommonFunctionSwift into the class that wants to make use of the library.

import CommonFunctionSwift

Example

Color Function

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

Text Function

  • 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

Image Function

  • 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

Author

Tanakorn Phoochaliaw, [email protected]

License

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