SimpleMDM-Swift Documentation

Structure Related​ToMany

public struct RelatedToMany<Element: GettableResource>: Relationship, AsyncSequence  

A relation to a group of remote resources.

The related resources can be retrieved from the server either by id, by index, or by fetching the entire collection.

%95 RelatedToMany RelatedToMany Relationship Relationship RelatedToMany->Relationship AsyncSequence AsyncSequence RelatedToMany->AsyncSequence

Conforms To

AsyncSequence

Initializers

init(from:​)

public init(from decoder: Decoder) throws  

Creates a new instance by decoding from the given decoder.

This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

Parameters

decoder Decoder

The decoder to read data from.

Throws

DecodingError

Properties

related​Ids

public var relatedIds: [Element.ID]  

The identifiers of the related resources.

Accessing this property does not make a network request, so it can be used in some cases to optimize your application if you don't need the full related resources content.

count

public var count: Int  

Methods

next()

public mutating func next() 

make​Async​Iterator()

public func makeAsyncIterator() -> AsyncIterator