From ffeef94c6a24a817b3e8a7bd16acb7954bab1dbf Mon Sep 17 00:00:00 2001 From: Tim Johnsen Date: Sat, 14 Oct 2017 10:03:48 -0700 Subject: [PATCH] Prefix method to avoid conflicts with potential future UIKit functions. --- README.md | 4 ++-- UIImage+HEIC.h | 2 +- UIImage+HEIC.m | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 657a3a2..8c0519c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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); } diff --git a/UIImage+HEIC.h b/UIImage+HEIC.h index 0283e9c..e1aaa13 100644 --- a/UIImage+HEIC.h +++ b/UIImage+HEIC.h @@ -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 diff --git a/UIImage+HEIC.m b/UIImage+HEIC.m index f933f00..77759c7 100644 --- a/UIImage+HEIC.m +++ b/UIImage+HEIC.m @@ -9,7 +9,7 @@ #import "UIImage+HEIC.h" #import -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, *)) {