Latest 2.1.0
Homepage https://github.com/tiwoc/SwiftyMimeTypes
License Apache 2.0
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

SwiftyMimeTypes is a database of MIME types and filename extensions.
Use it if you need to know the appropriate MIME type for a given filename
or the extensions associated with a given MIME type.

Example

SwiftyMimeTypes is a really small library with a simple interface.

Get a filename extension for a given MIME type

// prints "js"
print(MimeTypes.filenameExtension(forType: "application/javascript"))

Get all known filename extensions for a given MIME type

// prints ["md", "markdown"]
print(MimeTypes.filenameExtensions(forType: "text/markdown"))

Get the MIME type for a given filename extension

// prints "application/javascript"
print(MimeTypes.mimeType(forExtension: "js"))

Requirements

Xcode 9.x and Swift 4.x (use version 1.x or the swift3 branch for Xcode 8 and Swift 3 compatibility)

Installation

SwiftyMimeTypes is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SwiftyMimeTypes"

Swift Package Manager (SPM)

There’s no SPM support yet, as there’s currently no way to include resources (the mime.types file) with targets. See bug SR-2866 for details.

Author

Daniel Seither, [email protected]

License

Copyright 2016, 2017, 2018 Daniel Seither <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Latest podspec

{
    "name": "SwiftyMimeTypes",
    "version": "2.1.0",
    "summary": "A database of MIME types and their filename extensions",
    "description": "SwiftyMimeTypes is a database of MIME types and filename extensions.nUse it if you need to know the appropriate MIME type for a given filenamenor the extensions associated with a given MIME type.",
    "homepage": "https://github.com/tiwoc/SwiftyMimeTypes",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Daniel Seither": "[email protected]"
    },
    "source": {
        "git": "https://github.com/tiwoc/SwiftyMimeTypes.git",
        "tag": "2.1.0"
    },
    "social_media_url": "https://twitter.com/danielseither",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SwiftyMimeTypes/Classes/**/*",
    "resource_bundles": {
        "SwiftyMimeTypes": [
            "SwiftyMimeTypes/Assets/mime.types"
        ]
    }
}

Pin It on Pinterest

Share This