---
title: requiresSecureCoding
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nscoder/requiressecurecoding
---

# requiresSecureCoding

Indicates whether the archiver requires all archived classes to resist object substitution attacks.

## Declaration

```swift
var requiresSecureCoding: Bool { get }
```

## Discussion

Discussion true if this coder requires secure coding; false otherwise. Secure coders check a set of allowed classes before decoding objects, and all objects must implement the NSSecureCoding protocol.

## See Also

### Related Documentation

- [allowsKeyedCoding](foundation/nscoder/allowskeyedcoding.md)

### Secure Coding

- [allowedClasses](foundation/nscoder/allowedclasses.md)
