ContentType

public class ContentType
  • Shared singleton instance

    Declaration

    Swift

    public static let sharedInstance = ContentType()
  • Get the content type for the given file extension

    Parameter

    Parameter forExtension: the file extension

    Returns

    an Optional String for the content type

    Declaration

    Swift

    public func getContentType(forExtension ext: String) -> String?

    Parameters

    forExtension

    the file extension

    Return Value

    an Optional String for the content type

  • Get the content type for the given file based on its extension

    Parameter

    Parameter forFileName: the file

    Returns

    an Optional String for the content type

    Declaration

    Swift

    public func getContentType(forFileName fileName: String) -> String?

    Parameters

    forFileName

    the file

    Return Value

    an Optional String for the content type

  • Check if the message content type matches the type descriptor

    Parameter

    Parameter messageContentType: the content type

    Parameter

    Parameter ofType: the description of the type

    Returns

    true if the types matched

    Declaration

    Swift

    public func isContentType(_ messageContentType: String, ofType typeDescriptor: String) -> Bool

    Parameters

    messageContentType

    the content type

    ofType

    the description of the type

    Return Value

    true if the types matched