---
title: "version(forClassName:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscoder/version(forclassname:)"
---

# version(forClassName:)

This method is present for historical reasons and is not used with keyed archivers.

## Declaration

```swift
func version(forClassName className: String) -> Int
```

## Return Value

Return Value The version in effect for the class named className or NSNotFound if no class named className exists.

## Discussion

Discussion The version number does apply not to NSKeyedArchiver/NSKeyedUnarchiver.  A keyed archiver does not encode class version numbers.

## See Also

### Getting Version Information

- [systemVersion](foundation/nscoder/systemversion.md)
