//
// IMAdditions.m
// Project
//
// Created by haibara on 1/12/16.
//
//

#import "IMAdditions.h"

@implementation IMAdditions
@end

@implementation NSString (SuppressWarnings)

- (NSString *)im_stringByAppendingString:(NSString *)aString {
	return [self stringByAppendingString:[aString isKindOfClass:[NSString class]] ? aString : @""];
}

@end

@implementation NSMutableString (SuppressWarnings)

+ (NSString *)im_stringWithString:(NSString *)aString {
	return [self stringWithString:[aString isKindOfClass:[NSString class]] ? aString : @""];
}

- (void)im_appendString:(NSString *)aString {
	[self appendString:[aString isKindOfClass:[NSString class]] ? aString : @""];
}

@end

@implementation NSAttributedString (SuppressWarnings)

- (instancetype)im_initWithString:(NSString *)aString {
	return [self initWithString:[aString isKindOfClass:[NSString class]] ? aString : @""];
}

- (instancetype)im_initWithString:(NSString *)aString attributes:(NSDictionary *)attributes {
	return [self initWithString:[aString isKindOfClass:[NSString class]] ? aString : @"" attributes:attributes];
}

@end
