Contents

init(fileNamed:)

Creates a new node by loading an archive file from the game’s main bundle.

Declaration

convenience init?(fileNamed filename: String)

Parameters

  • filename:

    The name of the file, without a file extension. The file must be in the app’s main bundle and have a .sks filename extension.

Mentioned in

Return Value

The unarchived node object.

Discussion

If you call this method on a subclass of the SKScene class and the object in the archive is an SKScene object, the returned object is initialized as if it is a member of the subclass. You use this behavior to create scene layouts in the Xcode Editor and provide custom behaviors in your subclass.

See Also

First Steps