DataFormat
public class DataFormat
Format constants for use with data protocols.
-
Represents the ATOM data format.
Declaration
Swift
public static let atom: Int = (1 as Int)
-
Represents the JSON data format.
Declaration
Swift
public static let json: Int = (2 as Int)
-
Represents the HTML data format.
Declaration
Swift
public static let html: Int = (3 as Int)
-
Represents the plain text format (MIME type
text/plain
).Declaration
Swift
public static let text: Int = (4 as Int)
-
Represents the XML data format.
Declaration
Swift
public static let xml: Int = (5 as Int)
-
See also
DataFormat
.Declaration
Swift
public static func mediaType(format: Int) -> String
Parameters
format
Data format.
Return Value
The MIME type for the specified data format (e.g.
application/json;charset=utf-8
). -
See also
DataFormat
.Declaration
Swift
public static func name(format: Int) -> String
Parameters
format
Data format.
Return Value
The simple name of the specified data format (e.g.
atom
,json
,html
,xml
).