Latest 0.1
Homepage https://github.com/djmadcat/NSNumber-CGFloat
License BSD
Platforms ios 4.3, osx 10.6, requires ARC
Authors

NSNumber-CGFloat

NSNumber+CGFloat is an category to get CGFloat value from NSNumber object and create NSNumber object with CGFloat value.

Overview

Many developers forget that type CGFloat is defined and just assume that CGFloat is float, but it is not so.

See CoreGraphics/CGBase.h for further information:

/* Definition of `CGFLOAT_TYPE', `CGFLOAT_IS_DOUBLE', `CGFLOAT_MIN', and
   `CGFLOAT_MAX'. */

#if defined(__LP64__) && __LP64__
# define CGFLOAT_TYPE double
# define CGFLOAT_IS_DOUBLE 1
# define CGFLOAT_MIN DBL_MIN
# define CGFLOAT_MAX DBL_MAX
#else
# define CGFLOAT_TYPE float
# define CGFLOAT_IS_DOUBLE 0
# define CGFLOAT_MIN FLT_MIN
# define CGFLOAT_MAX FLT_MAX
#endif

/* Definition of the `CGFloat' type and `CGFLOAT_DEFINED'. */

typedef CGFLOAT_TYPE CGFloat;
#define CGFLOAT_DEFINED 1

Contact

Alexey Aleshkov

License

NSNumber-CGFloat is available under the BSD 2-Clause license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NSNumber+CGFloat",
    "version": "0.1",
    "authors": {
        "Alexey Aleshkov": "[email protected]"
    },
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/djmadcat/NSNumber-CGFloat",
    "summary": "NSNumber+CGFloat is an category to get CGFloat value from NSNumber object and create NSNumber object with CGFloat value.",
    "source": {
        "git": "https://github.com/djmadcat/NSNumber-CGFloat.git",
        "tag": "0.1"
    },
    "requires_arc": true,
    "source_files": "NSNumber+CGFloat/*.{h,m}",
    "platforms": {
        "ios": "4.3",
        "osx": "10.6"
    }
}

Pin It on Pinterest

Share This