Skip to content

Instantly share code, notes, and snippets.

View nroberson's full-sized avatar
🔳

Nolan Roberson nroberson

🔳
View GitHub Profile
@mattt
mattt / NSRange-Conventional.h
Last active January 22, 2020 23:32
Re-declaration of existing `NSRange` functions and implementation of new functions to match conventions of comparable Foundation and Core Foundation types.
NS_INLINE NSRange NSRangeMake(NSUInteger loc, NSUInteger len) {
return NSMakeRange(loc, len);
}
NS_INLINE NSUInteger NSRangeMax(NSRange range) {
return NSMaxRange(range);
}
NS_INLINE BOOL NSRangeContainsLocation(NSUInteger loc, NSRange range) {
return NSLocationInRange(loc, range);