Skip to content

Commit

Permalink
Prefix method to avoid conflicts with potential future UIKit functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
timonus committed Oct 14, 2017
1 parent d53f904 commit ffeef94
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add the UIImage+HEIC.h and UIImage+HEIC.m source files to your project. At the m

## Usage

This adds a function named `UIImageHEICRepresentation` that behaves just like `UIImageJPEGRepresentation`. The method returns `nil` in the event that HEIC encoding isn't possible on the current device.
This adds a function named `tj_UIImageHEICRepresentation` that behaves just like `UIImageJPEGRepresentation`. The method returns `nil` in the event that HEIC encoding isn't possible on the current device.

So, where you used to have

Expand All @@ -21,7 +21,7 @@ You could now have

```
UIImage *image = /**/;
NSData *imageData = UIImageHEICRepresentation(image, 0.8);
NSData *imageData = tj_UIImageHEICRepresentation(image, 0.8);
if (imageData.length == 0) {
imageData = UIImageJPEGRepresentation(image, 0.8);
}
Expand Down
2 changes: 1 addition & 1 deletion UIImage+HEIC.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
NS_ASSUME_NONNULL_BEGIN

/// Returns and NSData HEIC representation of the image if possible, otherwise returns nil.
NSData *_Nullable UIImageHEICRepresentation(UIImage *const image, const CGFloat compressionQuality);
NSData *_Nullable tj_UIImageHEICRepresentation(UIImage *const image, const CGFloat compressionQuality);

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion UIImage+HEIC.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "UIImage+HEIC.h"
#import <AVFoundation/AVMediaFormat.h>

NSData *_Nullable UIImageHEICRepresentation(UIImage *const image, const CGFloat compressionQuality)
NSData *_Nullable tj_UIImageHEICRepresentation(UIImage *const image, const CGFloat compressionQuality)
{
NSData *imageData = nil;
if (@available(iOS 11.0, *)) {
Expand Down

0 comments on commit ffeef94

Please sign in to comment.