Loadability Documentation Beta

Protocol Simple​Network​Loader

public protocol SimpleNetworkLoader: Loader

A type that can load data from over the network and throw errors.

%3 SimpleNetworkLoader SimpleNetworkLoader Loader Loader SimpleNetworkLoader->Loader

Conforms To

Loader

A type that can load data from a source and throw errors.

Requirements

create​Request(for:​)

func createRequest(for key: Key) -> URLRequest

Creates a URLRequest for a network loading request.

Parameters

key Key

The key identifying the object to load.

decode(_:​key:​)

func decode(_ data: Data, key: Key) throws -> Object

Decodes data received from a network request into the object.

Parameters

data Data

The data received from the request.

key Key

The key identifying the object to load.