Array
extension Array: WrapperCompatible
extension Array: AnyModel
extension Array: BasicType
extension Array: ArrayParameter
extension Array where Element: AnyModel
extension Array where Element: JSONModel
public extension Array where Element: JSONModel
extension Array where Element: Equatable
public extension Array where Element: WebSocketArrayType & UnsignedInteger
@_spi(FW) extension Array where Element: UIView
-
Undocumented
Declaration
Swift
func decoded<T>(using decoder: JSONDecoder = JSONDecoder(), as type: T.Type = T.self) throws -> T where T : Decodable
-
Undocumented
Declaration
Swift
public var isNotEmpty: Bool { get }
-
Undocumented
Declaration
Swift
public func safeElement(_ index: Int) -> Element?
-
Undocumented
Declaration
Swift
public subscript(safe index: Int) -> Element? { get }
-
Undocumented
Declaration
Swift
public var arrayValue: Array<Element> { get }
-
从Object解码成可选Model数组,当object为字典和数组时支持具体路径
Declaration
Swift
public static func decodeModel(from object: Any?, designatedPath: String? = nil) -> Array<Element>?
-
从Object安全解码成Model数组,当object为字典和数组时支持具体路径
Declaration
Swift
public static func decodeSafeModel(from object: Any?, designatedPath: String? = nil) -> Array<Element>
-
从数组Model编码成Object
Declaration
Swift
public func encodeObject() -> Any?
-
默认实现从Object解码成可选Model数组,当object为字典和数组时支持具体路径
Declaration
Swift
public static func decodeModel(from object: Any?, designatedPath: String? = nil) -> Array<Element>?
-
从数组Model编码成Object
Declaration
Swift
public func encodeObject() -> Any?
-
if the JSON field finded by
designatedPath
injson
is representing a array, such as[{...}, {...}, {...}]
, this method converts it to a Models arrayDeclaration
Swift
static func deserialize(from json: String?, designatedPath: String? = nil) -> [Element?]?
-
deserialize model array from dictionary
Declaration
Swift
static func deserialize(from dict: [AnyHashable : Any]?, designatedPath: String? = nil) -> [Element?]?
-
deserialize model array from array
Declaration
Swift
static func deserialize(from array: [Any]?, designatedPath: String? = nil) -> [Element?]?
-
deserialize model array from object
Declaration
Swift
static func deserializeAny(from object: Any?, designatedPath: String? = nil) -> [Element]?
-
safe deserialize model array from array
Declaration
Swift
static func safeDeserialize(from array: [Any]?, designatedPath: String? = nil) -> [Element]
-
if the JSON field finded by
designatedPath
injson
is representing a array, such as[{...}, {...}, {...}]
, this method safe converts it to a Models arrayDeclaration
Swift
static func safeDeserialize(from string: String?, designatedPath: String? = nil) -> [Element]
-
safe deserialize model array from dictionary
Declaration
Swift
static func safeDeserialize(from dict: [AnyHashable : Any]?, designatedPath: String? = nil) -> [Element]
-
safe deserialize model array from object
Declaration
Swift
static func safeDeserializeAny(from object: Any?, designatedPath: String? = nil) -> [Element]
-
Undocumented
Declaration
Swift
@discardableResult public mutating func removeAll(_ item: Element) -> [Element]
-
Undocumented
Declaration
Swift
@discardableResult public mutating func removeAll(_ items: [Element]) -> [Element]
-
Read a UInt16 from a buffer.
Declaration
Swift
func readUint16(offset: Int) -> UInt16
Parameters
offset
is the offset index to start the read from (e.g. buffer[0], buffer[1], etc).
Return Value
a UInt16 of the value from the buffer
-
Read a UInt64 from a buffer.
Declaration
Swift
func readUint64(offset: Int) -> UInt64
Parameters
offset
is the offset index to start the read from (e.g. buffer[0], buffer[1], etc).
Return Value
a UInt64 of the value from the buffer
-
Undocumented
Declaration
Swift
func unmaskData(maskStart: Int, offset: Int, length: Int) -> Data
-
批量链式布局闭包
Declaration
Swift
public func fw_layoutMaker(_ closure: (_ make: LayoutChain) -> Void)
-
批量对齐布局,适用于间距固定场景,尺寸未设置(可手工指定),若只有一个则间距不生效
Declaration
Swift
public func fw_layoutAlong(_ axis: NSLayoutConstraint.Axis, itemSpacing: CGFloat, leadSpacing: CGFloat? = nil, tailSpacing: CGFloat? = nil, itemLength: CGFloat? = nil, equalLength: Bool = false)
-
批量对齐布局,适用于尺寸固定场景,间距自适应,若只有一个则尺寸不生效
Declaration
Swift
public func fw_layoutAlong(_ axis: NSLayoutConstraint.Axis, itemLength: CGFloat, leadSpacing: CGFloat, tailSpacing: CGFloat)
-
批量对齐布局,用于补齐Along之后该方向上的其他约束
Declaration
Swift
public func fw_layoutAlong(_ axis: NSLayoutConstraint.Axis, alignCenter: Bool = false, itemWidth: CGFloat? = nil, leftSpacing: CGFloat? = nil, rightSpacing: CGFloat? = nil)