Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove branches for iOS < 7 code #435

Merged
merged 2 commits into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Add your own contributions to the next release on the line below this with your name.
- [iOS11] Fix warnings [#428](https://github.com/pinterest/PINRemoteImage/pull/428) [Eke](https://github.com/Eke)
- [new] Add support for higher frame rate devices to animated images. [#417](https://github.com/pinterest/PINRemoteImage/pull/417) [garrettmoon](https://github.com/garrettmoon)
- Remove unused code that supported iOS < 7. [#435](https://github.com/pinterest/PINRemoteImage/pull/435) [Adlai-Holler](https://github.com/Adlai-Holler)

## 3.0.0 Beta 13
- [new] Support for webp and improved support for GIFs. [#411](https://github.com/pinterest/PINRemoteImage/pull/411) [garrettmoon](https://github.com/garrettmoon)
Expand Down
35 changes: 7 additions & 28 deletions Carthage/Checkouts/PINCache/Source/PINDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,12 @@ - (PINDiskCacheKeyEncoderBlock)defaultKeyEncoder
return @"";
}

if (@available(macOS 10.9, iOS 7.0, tvOS 9.0, watchOS 2.0, *)) {
NSString *encodedString = [decodedKey stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@".:/%"] invertedSet]];
return encodedString;
} else {
CFStringRef static const charsToEscape = CFSTR(".:/%");
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CFStringRef escapedString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(__bridge CFStringRef)decodedKey,
NULL,
charsToEscape,
kCFStringEncodingUTF8);
#pragma clang diagnostic pop

return (__bridge_transfer NSString *)escapedString;
}
static NSCharacterSet *allowedChars;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
allowedChars = [NSCharacterSet characterSetWithCharactersInString:@".:/%"].invertedSet;
});
return [decodedKey stringByAddingPercentEncodingWithAllowedCharacters:allowedChars];
};
}

Expand All @@ -323,18 +313,7 @@ - (PINDiskCacheKeyEncoderBlock)defaultKeyDecoder
return @"";
}

if (@available(macOS 10.9, iOS 7.0, tvOS 9.0, watchOS 2.0, *)) {
return [encodedKey stringByRemovingPercentEncoding];
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CFStringRef unescapedString = CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
(__bridge CFStringRef)encodedKey,
CFSTR(""),
kCFStringEncodingUTF8);
#pragma clang diagnostic pop
return (__bridge_transfer NSString *)unescapedString;
}
return [encodedKey stringByRemovingPercentEncoding];
};
}

Expand Down