Makes math operations in Swift easier by adding automatic casting between Int, Float, CGFloat, and Double. Use with care.
Swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
EasyCast.swift
LICENSE
README.md

README.md

EasyCast

Makes math operations in Swift easier by adding automatic casting between Int, Float, CGFloat, and Double

Usage

Instead of:

var sum = CGFloat(myInt) + CGFloat(myFloat)

Just do:

var sum = myInt + myFloat

That's pretty much it

When to use this

  • Swift's type-safety is littering your code base with obvious casts.
  • You are working on something where making some type assumption isn't a problem.
  • You know how it works.

When not to use this

  • You want type-safety above all else.
  • You are working on scientific or academic software.
  • You don't know how it works,