Skip to content

Latest commit

 

History

History
executable file
·
42 lines (34 loc) · 817 Bytes

Animal.md

File metadata and controls

executable file
·
42 lines (34 loc) · 817 Bytes

YsSwift

This library supply some normal Swift base functions, likes String catgory, Data catgory etc.


  • Usage
    • String Functions or Methods
    • UIView category
    • UIImage category

Usage

More features, read Demo

String Functions or Methods

import YsSwift

let s = "         hello world      "
print("\(s.ys.trim())")   // hello world

//string to double
var d = "0.11"
print("\(d.ys.double())") //0.11
d = "abc"
print("\(d.ys.double())") //0.0

UIView category

let v = UIView()
let s = v.ys.screenshot()

UIImage category

//resize image
image.ys.resizeImage(size: size)
//compress image to count
image.ys.compressImage(length: 1024)