Sha256: 707c47e09504f011d084971f865fcd7d3c8e6710dc4743ad6089d4a987cc0dce

Contents?: true

Size: 1.57 KB

Versions: 2

Compression:

Stored size: 1.57 KB

Contents

#import "NSString+QCKSelectorName.h"

@implementation NSString (QCKSelectorName)

- (NSString *)qck_selectorName {
    static NSMutableCharacterSet *invalidCharacters = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        invalidCharacters = [NSMutableCharacterSet new];

        NSCharacterSet *whitespaceCharacterSet = [NSCharacterSet whitespaceCharacterSet];
        NSCharacterSet *newlineCharacterSet = [NSCharacterSet newlineCharacterSet];
        NSCharacterSet *illegalCharacterSet = [NSCharacterSet illegalCharacterSet];
        NSCharacterSet *controlCharacterSet = [NSCharacterSet controlCharacterSet];
        NSCharacterSet *punctuationCharacterSet = [NSCharacterSet punctuationCharacterSet];
        NSCharacterSet *nonBaseCharacterSet = [NSCharacterSet nonBaseCharacterSet];
        NSCharacterSet *symbolCharacterSet = [NSCharacterSet symbolCharacterSet];

        [invalidCharacters formUnionWithCharacterSet:whitespaceCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:newlineCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:illegalCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:controlCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:punctuationCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:nonBaseCharacterSet];
        [invalidCharacters formUnionWithCharacterSet:symbolCharacterSet];
    });

    NSArray *validComponents = [self componentsSeparatedByCharactersInSet:invalidCharacters];

    return [validComponents componentsJoinedByString:@"_"];
}

@end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-deintegrate-0.2.1 spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.m
cocoapods-deintegrate-0.2.0 spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.m