<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/copy()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)copy"
  },
  "title" : "copy()"
}
-->

# copy()

Returns the object returned by `copy(with:)`.

```
func copy() -> Any
```

## Return Value

The object returned by the <doc://com.apple.documentation/documentation/Foundation/NSCopying> protocol method <doc://com.apple.documentation/documentation/Foundation/NSCopying/copy(with:)>,.

## Discussion

This is a convenience method for classes that adopt the <doc://com.apple.documentation/documentation/Foundation/NSCopying> protocol. An exception is raised if there is no implementation for <doc://com.apple.documentation/documentation/Foundation/NSCopying/copy(with:)>.

`NSObject` does not itself support the <doc://com.apple.documentation/documentation/Foundation/NSCopying> protocol. Subclasses must support the protocol and implement the <doc://com.apple.documentation/documentation/Foundation/NSCopying/copy(with:)> method. A subclass version of the <doc://com.apple.documentation/documentation/Foundation/NSCopying/copy(with:)> method should send the message to `super` first, to incorporate its implementation, unless the subclass descends directly from `NSObject`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)