Latest 1.1
Homepage https://github.com/ivanshevelev/HRAssert
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation
Authors

Version
License
Platform

Custom assert defines. Check for isKindOfClass: and conformsProtocol:.

Usage

Kind of class where waiting – NSMutableString and current – NSString instance:

NSString *string = @"test";

HRKindOfClassAssert(NSMutableString, string);

Kind of class where waiting – Class and current – Class:

Class stringClass = [NSString class];
Class mutableStringClass = [NSMutableString class];

HRKindOfClassAssert(mutableStringClass, stringClass);

Conforms to protocol where waiting – NSCopying and current NSString instance:

NSString *string = @"test";
HRConformsToProtocolAssert(NSCopying, string);

Conforms to protocol where waiting – Protocol and current NSString instance:

NSString *string = @"test";
Protocol *copyingProtocol = @protocol(NSCopying);
HRConformsToProtocolTypeAssert(copyingProtocol, string);

In case of HRKindOfClassAssert, arguments can be instance, Class type instance or class name(like NSString).

In case of HRConformsToProtocolAssert "waiting" argument must be protocol name(like NSCopying) and "current" argument can be instance, Class type instance or class name(like NSString).

In case of HRConformsToProtocolTypeAssert "waiting" argument must be Protocol type instance and "current" argument can be instance, Class type instance or class name(like NSString).

Requirements

Objective-C and iOS 7.0 or higher.

Installation

HRAssert is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "HRAssert"

Author

Ivan Shevelev, [email protected]

License

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

Latest podspec

{
    "name": "HRAssert",
    "version": "1.1",
    "summary": "Custom assert defines.",
    "description": "Custom assert defines. Check for isKindOfClass: and conformsProtocol:.",
    "homepage": "https://github.com/ivanshevelev/HRAssert",
    "license": "MIT",
    "authors": {
        "Ivan Shevelev": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ivanshevelev/HRAssert.git",
        "tag": "1.1"
    },
    "social_media_url": "https://twitter.com/antsy_ivan",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "HRAssert": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This