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 extensionReturns
an Optional String for the content typeDeclaration
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 fileReturns
an Optional String for the content typeDeclaration
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 typeParameter
Parameter ofType: the description of the typeReturns
true if the types matchedDeclaration
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