Latest0.1.0
Homepagehttps://github.com/Raizlabs/RZAffirm
LicenseMIT
Platformsios 8.0
Authors, ,

Build Status
Version
License
Platform

RZAffirm adds ease of implementation and clarity of intent to your assertions. RZAffirm defines functions which – like comments – express intent, but never go out of date. RRZAFFIRM_TRUE, RZAFFIRM_FALSE, RZAFFIRM_NOT_NIL, and RZAFFIRM_NONEMPTY_STRING all do exactly what you think they do.

RZAffirm includes more exciting assertions that come in handy in a variety of contexts. For example:

You define a method on a class, but you want that method to ONLY be called by subclasses. Use RZAFFIRM_SUBCLASSES_MUST_OVERRIDE to throw an exception if the method is called from the class itself:

class RZSuperclass

func aMethodThatShouldBeCalledFromSubclassesOnly -> Void {
  RZAFFIRM_SUBCLASSES_MUST_OVERRIDE(self);
}

You define a switch statement with a case that should never occur. Use RZAFFIRM_SHOULD_NEVER_GET_HERE to throw an exception if your program passes the undesired case to the switch statement:

enum AwesomeMode {
    case AwesomeModeNotSet
    case AwesomeModeIsAwesome
}

func configureThingsForAwesomeMode(awesomeMode:AwesomeMode) -> Void {
    switch awesomeMode {
        case .AwesomeModeNotSet:
            RZAFFIRM_SHOULD_NEVER_GET_HERE(self)
            break
        case .AwesomeModeIsAwesome:
            break
    }
}

Usage

A demo project is available in the Example directory. Open RZAffirm.xcodeproj and check out the demo!

Installation

‘RZAffirm’ is now available through the dependency manager CocoaPods. CocoaPods version 0.36.0 is required. At this moment this can be installed as a pre release by executing:

`[sudo] gem install cocoapods --pre`

To install RZAffirm with CocoaPods 0.36.0, simply add the following line to your Podfile:

pod RZAffirm, '~> 0.1'

Import RZAffirm at the top of your swift file by adding this code:

`import RZAffirm`

Authors

Michael Gorbach, [email protected]

Joe Howard, [email protected]

Matt Buckley, [email protected]

License

See the LICENSE file for more info.

Latest podspec

{
    "name": "RZAffirm",
    "version": "0.1.0",
    "summary": "Useful assertion functions from the fine folks at Raizlabs.",
    "description": "                       Assertion functions for a range of conditions. Use RZAffirm to confirm equality, type, and much more.n",
    "homepage": "https://github.com/Raizlabs/RZAffirm",
    "license": "MIT",
    "authors": {
        "Michael Gorbach": "[email protected]",
        "Joe Howard": "[email protected]",
        "Matt Buckley": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Raizlabs/RZAffirm.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/raizlabs",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": false,
    "source_files": "src"
}

Pin It on Pinterest

Share This