ATJSON
Undocumented
-
Creates a JSON using the data.
Declaration
Swift
public init(data:Data, options opt: JSONSerialization.ReadingOptions = .allowFragments, error: NSErrorPointer? = nil)Parameters
dataThe NSData used to convert to json.Top level object in data is an NSArray or NSDictionary
optThe JSON serialization reading options.
.AllowFragmentsby default.errorerror The NSErrorPointer used to return the error.
nilby default.Return Value
The created JSON
-
Create a JSON from JSON string - parameter string: Normal json string like ‘{
a
:b
}’Declaration
Swift
public static func parse(_ string:String) -> ATJSONParameters
stringNormal json string like ‘{“a”:“b”}’
Return Value
The created JSON
-
Creates a JSON using the object.
Declaration
Swift
public init(_ object: Any)Parameters
objectThe object must have the following properties: All objects are NSString/String, NSNumber/Int/Float/Double/Bool, NSArray/Array, NSDictionary/Dictionary, or NSNull; All dictionary keys are NSStrings/String; NSNumbers are not NaN or infinity.
Return Value
The created JSON
-
Creates a JSON from a [JSON]
Declaration
Swift
public init(_ jsonArray:[ATJSON])Parameters
jsonArrayA Swift array of JSON objects
Return Value
The created JSON
-
Creates a JSON from a [String: JSON]
Declaration
Swift
public init(_ jsonDictionary:[String: ATJSON])Parameters
jsonDictionaryA Swift dictionary of JSON objects
Return Value
The created JSON
-
Object in JSON
Declaration
Swift
public var object: Any -
json type
Declaration
Swift
public var type: Type -
Error in JSON
Declaration
Swift
public var error: NSError? -
Undocumented
-
The static null json
Declaration
Swift
public var startIndex: Index -
The static null json
Declaration
Swift
public var endIndex: Index -
The static null json
Declaration
Swift
public func index(after i: Index) -> IndexParameters
iA valid index of the collection.
imust be less thanendIndex.Return Value
The index value immediately after
i.
-
Find a json in the complex data structuresby using the Int/String’s array.
let json = JSON[data] let path = [9,
list
,person
,name
] let name = json[path]The same as: let name = json[9][
list
][person
][name
]Declaration
Swift
public subscript(path: [JSONSubscriptType]) -> ATJSONParameters
pathThe target json’s path. Example:
Return Value
Return a json found by the path or a null json with error
-
Find a json in the complex data structures by using the Int/String’s array.
let name = json[9,
list
,person
,name
]The same as: let name = json[9][
list
][person
][name
]Declaration
Swift
public subscript(path: JSONSubscriptType...) -> ATJSONParameters
pathThe target json’s path. Example:
Return Value
Return a json found by the path or a null json with error
-
Declaration
Swift
public init(stringLiteral value: StringLiteralType)Parameters
valueThe value of the new instance.
-
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: StringLiteralType)Parameters
valueThe value of the new instance.
-
Declaration
Swift
public init(unicodeScalarLiteral value: StringLiteralType)Parameters
valueThe value of the new instance.
-
Declaration
Swift
public init(integerLiteral value: IntegerLiteralType)Parameters
valueThe value to create.
-
Declaration
Swift
public init(booleanLiteral value: BooleanLiteralType)Parameters
valueThe value of the new instance.
-
Declaration
Swift
public init(floatLiteral value: FloatLiteralType)Parameters
valueThe value to create.
-
Declaration
Swift
public init(dictionaryLiteral elements: (String, Any)...)
-
Declaration
Swift
public init(arrayLiteral elements: Any...)
-
Declaration
Swift
public init(nilLiteral: ())
-
Declaration
Swift
public init?(rawValue: Any)Parameters
rawValueThe raw value to use for the new instance.
-
Declaration
Swift
public var rawValue: Any -
Undocumented
-
Undocumented
-
Declaration
Swift
public var description: String -
Declaration
Swift
public var debugDescription: String
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
ATJSON Struct Reference