# `GSLayer pasteDict:format:selectedNodes:error:`

*Instance Method*

Adds content from a serialized selection dictionary.

## Declaration

```swift
func pasteDict(_ dictionary: [AnyHashable : Any], format: GSFormatVersion, selectedNodes: [GSNode]) throws
```

```objc
- (BOOL) pasteDict:(NSDictionary *) dictionary format:(GSFormatVersion) format selectedNodes:(NSArray<GSNode *> *) selectedNodes error:(NSError **) error;
```

```python
pasteDict_format_selectedNodes_error_(dictionary: dict, format: GSFormatVersion, selectedNodes: list[GSNode]) -> tuple[bool, NSError]
```

## Parameters

- `dictionary` — A decoded selection dictionary.
- `format` — The format version of the dictionary.
- `selectedNodes` — Target nodes used to attach pasted hints.
- `error` — On failure, information about the error.

## Return Value

Whether the complete selection was added.

## Discussion

The added elements become the selection.

## See Also

### Selection Serialization

- [`GSLayer selectedObjects`](/Core/GlyphsCore/GSLayer/selectedObjects) — Content representing the selected elements for serialization and paste.
- [`GSLayer selectedElementsMappings`](/Core/GlyphsCore/GSLayer/selectedElementsMappings) — Structural mappings for the selected elements.
- [`GSLayer removeMappedElements:`](/Core/GlyphsCore/GSLayer/removeMappedElements:) — Removes elements described by structural mappings.
- [`GSLayer removeElement:`](/Core/GlyphsCore/GSLayer/removeElement:) — Removes a selectable element from the layer.
- [`GSLayer removeNodesCutPath:`](/Core/GlyphsCore/GSLayer/removeNodesCutPath:) — Removes mapped nodes while preserving the unselected path portions.
- [`GSLayer selectedPaths:notSelected:`](/Core/GlyphsCore/GSLayer/selectedPaths:notSelected:) — Separates paths by whether they contain selected nodes.

