Skip to content

iOS is sometimes stupid picky about a file extension. These are the ones it wants.

License

Notifications You must be signed in to change notification settings

zshannon/ZCSFileExtensionForMimeType

Repository files navigation

ZCSFileExtensionForMimeType

Add to your Podfile

pod 'ZCSFileExtensionForMimeType', '~> 0.0.1'

Use in your project

Setup

#import "ZCSFileExtensionForMimeType.h"

// Somewhere you've already gotten a mime_type for your file.
NSString *mime_type = @"audio/mp4";
// Now you want the correct file extension. Save your file at a path
// terminated with this extension so iOS won't crap the bed sometimes.
NSString *file_extension = [ZCSFileExtensionForMimeType extensionForMimeType:mime_type];
	

Contributing

Send me Pull Requests here, please.

About

iOS is sometimes stupid picky about a file extension. These are the ones it wants.

Resources

License

Stars

Watchers

Forks

Packages

No packages published