Contents

loadData(completionHandler:)

Loads the game data from the file.

Declaration

func loadData(completionHandler handler: (@Sendable (Data?, (any Error)?) -> Void)? = nil)
func loadData() async throws -> Data

Parameters

  • handler:

    The block that this method calls when it completes the request.

    The block receives the following parameters:

    data

    The data object that you saved to the file using the Savegamedata(_:withname:completionhandler:) method

    error

    Describes an error if it occurs, or nil if the operation completes.

Mentioned in