Latest 0.0.2
Homepage https://github.com/duynb92/DNCasting
License MIT
Platforms ios 9.0, requires ARC
Frameworks Foundation
Authors

Tired of casting from type to type, try this ! :see_no_evil:

Installation

  • For iOS 8+ projects with CocoaPods:

    pod 'DNCasting', :git => 'https://github.com/duynb92/DNCasting.git'
  • For iOS 8+ projects with Carthage:

    github "duynb92/DNCasting"
  • Using Swift Package Manager:

    Coming soon

API

  • String

    toInt()
    toInt32()
    toInt64()
    toDouble()
    toFloat()
    toBool()
    findAllInts() //Find all integers in string 
  • Int

    toString()
    toDouble()
    toFloat()
    toBool()
  • Double

    toString()
    toString(minDigits: Int, maxDigits: Int, roundingMode: NumberFormatter.RoundingMode = .halfEven, locale : Locale = Locale(identifier: "en_US"))
    toString(exactFractionDigits: Int, roundingMode: NumberFormatter.RoundingMode = .halfEven, locale : Locale = Locale(identifier: "en_US")) 
    toInt()
    toFloat()
    toBool()
  • Float

    toString()
    toString(minDigits: Int, maxDigits: Int, roundingMode: NumberFormatter.RoundingMode = .halfEven, locale : Locale = Locale(identifier: "en_US"))
    toString(exactFractionDigits: Int, roundingMode: NumberFormatter.RoundingMode = .halfEven, locale : Locale = Locale(identifier: "en_US")) 
    toInt()
    toBool()
  • Bool
    toString()
    toInt()
    toDouble()
    toFloat()

All are self-explanatory. No headache anymore :wink: !

License

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

Buy me a coffee

If this snippet really, i mean really, save your time.

DNCasting

Latest podspec

{
    "name": "DNCasting",
    "platforms": {
        "ios": "9.0"
    },
    "summary": "DNCasting replace default type-casting, obviously provide ultilities type-casting method come to rescue.",
    "requires_arc": true,
    "version": "0.0.2",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Duy Nguyen": "[email protected]"
    },
    "homepage": "https://github.com/duynb92/DNCasting",
    "source": {
        "git": "https://github.com/duynb92/DNCasting.git",
        "tag": "0.0.2"
    },
    "frameworks": "Foundation",
    "source_files": "DNCasting/**/*.{swift}",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This