Latest 0.0.3
Homepage https://github.com/inloop/MIMEResolver
License MIT
Platforms ios 10.0, osx 10.11, watchos 3.0, tvos 10.0
Frameworks Foundation
Authors

Build Status [CocoaPods]() Carthage compatible [Platforms]() GitHub license

µ framework for resolving MIME type from Data objects.

Usage

// Import module
import MIMEResolver

// create MIMEResolver instance
let resolver = MIMEResolver()

// register types that you are interested in
resolver.register(mimeType: Gif.self)
resolver.register(mimeType: Png.self)

// resolve MIME type
let mime = resolver.resolve(data) 

// do something
print(mime.signature)
print(mime.contentType)
print(mime.validExtensions)

if mime is Gif.Type {
  playGif(from: data)
}

Supported MIME Types

  • [x] image/x-ms-bmp
  • [x] image/gif
  • [x] image/jpeg
  • [x] image/png
  • [x] image/iff
  • [x] image/vnd.microsoft.icon

Requirements

  • iOS | watchOS | tvOS | macOS
  • Xcode 8+
  • Swift 3

Installation

Carthage

Specify MIMEResolver repo in your Cartfile:

github "inloop/MIMEResolver"

Run carthage update --platform [your platform of choice]

Cocoapods

Add the following line to your target’s dependencies in Podfile:

pod 'MIMEResolver'

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

License

Copyright (c) Inloop, s.r.o.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Latest podspec

{
    "name": "MIMEResolver",
    "version": "0.0.3",
    "license": "MIT",
    "summary": "u00b5 framework for resolving MIME type from Data objects",
    "homepage": "https://github.com/inloop/MIMEResolver",
    "authors": {
        "Jakub Petrik": "[email protected]"
    },
    "source": {
        "git": "https://github.com/inloop/MIMEResolver.git",
        "tag": "0.0.3"
    },
    "platforms": {
        "ios": "10.0",
        "osx": "10.11",
        "watchos": "3.0",
        "tvos": "10.0"
    },
    "source_files": "Sources/*.{h,swift}",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This