MKFoundationKit 是 NSFoundation
类别集合,用于加速开发。
此库通过 CocoaPods 提供。
该项目源代码可在标准 MIT 许可证下使用。请参阅 许可证文件。
- (void)mk_apply:(void (^)(id item))block;
- (void)mk_each:(void (^)(id item))block;
- (instancetype)mk_map:(id (^)(id item))block;
- (id)mk_match:(BOOL (^)(id item))block;
- (id)mk_reduce:(id (^)(id item, id aggregate))block;
- (id)mk_reduce:(id)initial withBlock:(id (^)(id item, id aggregate))block;
- (instancetype)mk_reject:(BOOL (^)(id item))block;
- (instancetype)mk_select:(BOOL (^)(id item))block;
- (BOOL)mk_all:(BOOL (^)(id item))block;
- (BOOL)mk_any:(BOOL (^)(id item))block;
- (BOOL)mk_none:(BOOL (^)(id item))block;
- (id)mk_firstObject;
- (id)mk_max;
- (id)mk_min;
- (instancetype)mk_reverse;
- (BOOL)mk_isEmpty;
- (void)mk_safeAddObject:(id)object;
- (void)mk_enqueueObject:(id)object;
- (id)mk_dequeueObject;
- (void)mk_pushObject:(id)object;
- (id)mk_pullObject;
- (NSString *)mk_build;
- (NSString *)mk_name;
- (NSString *)mk_version;
- (NSString *)mk_infoForKey:(id)key;
+ (NSData *)mk_dataWithBase64EncodedString:(NSString *)string;
- (NSString *)mk_base64DecodedString;
- (NSString *)mk_base64EncodedString;
- (BOOL)mk_isToday;
- (BOOL)mk_isTomorrow;
- (BOOL)mk_isYesterday;
- (BOOL)mk_isThisWeek;
- (BOOL)mk_isNextWeek;
- (BOOL)mk_isLastWeek;
- (BOOL)mk_isSameWeekAsDate:(NSDate *)other;
- (BOOL)mk_isThisYear;
- (BOOL)mk_isNextYear;
- (BOOL)mk_isLastYear;
- (BOOL)mk_isSameYearAsDate:(NSDate *)other;
- (BOOL)mk_isEarlierThanDate:(NSDate *)other;
- (BOOL)mk_isLaterThanDate:(NSDate *)other;
- (BOOL)mk_isEqualToDateIgnoringTime:(NSDate *)other;
- (NSInteger)mk_year;
- (NSInteger)mk_month;
- (NSInteger)mk_week;
- (NSInteger)mk_weekday;
- (NSInteger)mk_nthWeekday;
- (NSInteger)mk_day;
- (NSInteger)mk_hour;
- (NSInteger)mk_minutes;
- (NSInteger)mk_seconds;
- (NSDateComponents *)mk_components;
+ (NSDate *)mk_dateTomorrow;
+ (NSDate *)mk_dateYesterday;
+ (NSDate *)mk_dateWithoutTime;
+ (NSDate *)mk_dateWithDaysFromNow:(NSInteger)days;
+ (NSDate *)mk_dateFromString:(NSString *)string;
+ (NSDate *)mk_dateFromString:(NSString *)string withFormat:(NSString *)format;
- (NSDate *)mk_dateWithoutTime;
+ (NSString *)mk_dateFormatCCCCDDMMMYYYY;
+ (NSString *)mk_dateFormatCCCCDDMMMMYYYY;
+ (NSString *)mk_dateFormatDDMMMYYYY;
+ (NSString *)mk_dateFormatDDMMYYYYDashed;
+ (NSString *)mk_dateFormatDDMMYYYYSlashed;
+ (NSString *)mk_dateFormatDDMMMYYYYSlashed;
+ (NSString *)mk_dateFormatMMMDDYYYY;
+ (NSString *)mk_dateFormatYYYYMMDDDashed;
- (NSString *)mk_formattedString;
- (NSString *)mk_formattedStringUsingFormat:(NSString *)dateFormat;
- (NSDate *)mk_dateByAddingDays:(NSInteger)days;
- (NSDate *)mk_dateByAddingWeeks:(NSInteger)weeks;
- (NSDate *)mk_dateByAddingMonths:(NSInteger)months;
- (NSDate *)mk_dateByAddingYears:(NSInteger)years;
- (NSDate *)mk_dateByAddingHours:(NSInteger)hours;
- (NSDate *)mk_dateByAddingMinutes:(NSInteger)minutes;
- (NSDate *)mk_dateByAddingSeconds:(NSInteger)seconds;
- (NSDate *)mk_dateBySubtractingDays:(NSInteger)days;
- (NSDate *)mk_dateBySubtractingWeeks:(NSInteger)weeks;
- (NSDate *)mk_dateBySubtractingMonths:(NSInteger)months;
- (NSDate *)mk_dateBySubtractingYears:(NSInteger)years;
- (NSDate *)mk_dateBySubtractingHours:(NSInteger)hours;
- (NSDate *)mk_dateBySubtractingMinutes:(NSInteger)minutes;
- (NSDate *)mk_dateBySubtractingSeconds:(NSInteger)seconds;
- (NSInteger)mk_differenceInDaysToDate:(NSDate *)toDate;
- (NSInteger)mk_differenceInMonthsToDate:(NSDate *)toDate;
- (NSInteger)mk_differenceInYearsToDate:(NSDate *)toDate;
- (void)mk_apply:(void (^)(id item))block;
- (void)mk_each:(void (^)(id item))block;
- (instancetype)mk_map:(id (^)(id item))selectorBlock;
- (id)mk_match:(BOOL (^)(id key, id value))conditionBlock;
- (id)mk_reduce:(id)initial withBlock:(id (^)(id item, id aggregate))accumulatorBlock;
- (instancetype)mk_reject:(BOOL (^)(id key, id value))conditionBlock;
- (instancetype)mk_select:(BOOL (^)(id key, id value))conditionBlock;
- (BOOL)mk_all:(BOOL (^)(id key, id value))conditionBlock;
- (BOOL)mk_any:(BOOL (^)(id key, id value))conditionBlock;
- (BOOL)mk_none:(BOOL (^)(id key, id value))conditionBlock;
- (NSMutableDictionary *)mk_dictionaryWithKeys:(NSArray *)keys;
- (NSMutableDictionary *)mk_renameKeysUsingMapping:(NSDictionary *)mapping;
- (BOOL)mk_isEmpty;
- (void)mk_safeSetObject:(id)object forKey:(id)key;
- (BOOL)mk_isTheSame:(NSNumber *)other;
- (BOOL)mk_isGreaterThan:(NSNumber *)other;
- (BOOL)mk_isLessThan:(NSNumber *)other;
- (BOOL)mk_isEven;
- (BOOL)mk_isOdd;
+ (instancetype)mk_createFrom:(NSNumber *)number;
- (NSDecimalNumber *)mk_decimalNumber;
- (instancetype)mk_integralPart;
- (instancetype)mk_fractionalPart;
- (BOOL)mk_isInteger;
- (BOOL)mk_isFraction;
- (instancetype)mk_add:(NSNumber *)other;
- (instancetype)mk_subtract:(NSNumber *)other;
- (instancetype)mk_multiplyBy:(NSNumber *)other;
- (instancetype)mk_divideBy:(NSNumber *)other;
- (instancetype)mk_raiseToPower:(NSInteger)power;
+ (instancetype)mk_minusOne;
- (instancetype)mk_negative;
- (instancetype)mk_positive;;
- (instancetype)mk_negate;
- (BOOL)mk_isPositive;
- (BOOL)mk_isNegative;
+ (NSDecimalNumberHandler *)mk_decimalNumberHandlerWithScale:(short)scale;
- (instancetype)mk_roundedAsMoney;
- (instancetype)mk_roundedWithPrecision:(short)precision;
+ (NSArray *)mk_propertyList;
+ (NSArray *)mk_propertyList:(Class)clazz;
+ (NSArray *)mk_methodListOnly;
+ (NSArray *)mk_methodListOnly:(Class)clazz;
+ (NSArray *)mk_methodList;
+ (NSArray *)mk_methodList:(Class)clazz;
- (void)mk_printObject;
- (void)mk_printObjectKeys:(NSArray *)keys;
- (void)mk_printObjectMethods;
- (void)mk_printObjectMethodsOnly;
- (NSString *)mk_className;
- (void)mk_apply:(void (^)(id item))block;
- (void)mk_each:(void (^)(id item))block;
- (instancetype)mk_map:(id (^)(id item))selectorBlock;
- (id)mk_match:(BOOL (^)(id item))conditionBlock;
- (id)mk_reduce:(id)initial withBlock:(id (^)(id item, id aggregate))accumulatorBlock;
- (instancetype)mk_reject:(BOOL (^)(id item))conditionBlock;
- (instancetype)mk_select:(BOOL (^)(id item))conditionBlock;
- (BOOL)mk_all:(BOOL (^)(id item))conditionBlock;
- (BOOL)mk_any:(BOOL (^)(id item))conditionBlock;
- (BOOL)mk_none:(BOOL (^)(id item))conditionBlock;
- (NSString *)mk_base64DecodedString;
- (NSString *)mk_base64EncodedString;
- (NSData *)mk_base64DecodedData;
- (NSData *)mk_base64EncodedData;
- (NSNumber *)mk_numberWithInteger;
- (NSNumber *)mk_numberWithLongLong;
+ (BOOL)mk_isStringEmptyOrNil:(NSString *)value;
- (BOOL)mk_isEmpty;
- (NSString *)mk_trimmedString;
- (NSString *)mk_firstComponentUsingSeparators:(NSCharacterSet *)separators;
- (NSString *)mk_lastComponentUsingSeparators:(NSCharacterSet *)separators;
- (NSString *)mk_componentAtIndex:(NSInteger)index usingSeparators:(NSCharacterSet *)separators;
- (BOOL)mk_containsString:(NSString *)term caseSensitive:(BOOL)caseSensitive;
- (NSInteger)mk_countOccurencesOfString:(NSString *)term;
- (NSInteger)mk_countOccurencesOfString:(NSString *)term caseSensitive:(BOOL)caseSensitive;
- (NSInteger)mk_countOccurencesOfStrings:(NSArray *)terms;
- (NSInteger)mk_countOccurencesOfStrings:(NSArray *)terms caseSensitive:(BOOL)caseSensitive;
- (NSRange)mk_range;
+ (NSString *)mk_decodeUTF8String:(NSString *)value;
- (NSString *)mk_decodeUTF8;
+ (NSString *)mk_stringWithUUID;
+ (BOOL)mk_isStringValidEmail:(NSString *)email;
- (BOOL)mk_isValidEmail;
- (BOOL)mk_matchesRegex:(NSString *)regex;
git checkout -b new-feature
)。git commit -am 'Added new-feature'
)。git push origin new-feature
)。