Skip to content

jankase/UIRounding

Repository files navigation

UIRounding

Carthage compatible license Travis branch Test Maintainability Test Coverage

Simple rounding helper for pixel rounding based on your screen.

Standard way to obtain rounding helper.

let rh = ScreenRounding().roundingHelper

For rounding is used method on rounding helper like following:

let ceil = rh.ceil(0.2)
let round = rh.round(0.2)
let floor = rh.floor(0.2)

There is also extension of standard Core graphics structures:

let roundedPoint = CGPoint(x: 0.2, y: 2.0).round()
let ceilSize = CGSize(width: 0.2, height: 2.0).ceil()
let floorRect = CGRect(origin: CGPoint(x: 0.2, y: 2.0), size: CGSize(width: 0.2, height: 2.0)).floor()

About

Support for pixel perfect alignment

Resources

License

Stars

Watchers

Forks

Packages

No packages published