Skip to content

Commit 7991e6b

Browse files
committed
use uttype rather than string for filename extension
1 parent 1f5ae38 commit 7991e6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/Sources/WPMediaPicker/WPMediaPickerViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
@import MobileCoreServices;
1313
@import AVFoundation;
14+
@import UniformTypeIdentifiers;
1415

1516
static CGFloat const IPhoneSELandscapeWidth = 568.0f;
1617
static CGFloat const IPhone7PortraitWidth = 375.0f;
@@ -999,7 +1000,8 @@ - (void)configureBadgeViewForCell:(WPMediaCollectionViewCell *)cell withAsset:(i
9991000
NSString *uttype = [asset UTTypeIdentifier];
10001001

10011002
if ([self.options.badgedUTTypes containsObject:uttype]) {
1002-
NSString *tagName = (__bridge_transfer NSString *)(UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)uttype, kUTTagClassFilenameExtension));
1003+
UTType *type = [UTType typeWithIdentifier:uttype];
1004+
NSString *tagName = type.preferredFilenameExtension;
10031005
cell.badgeView.label.text = [tagName uppercaseString];
10041006
cell.badgeView.hidden = NO;
10051007
return;

0 commit comments

Comments
 (0)