<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/moveToUbiquityContainer(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)moveDocumentToUbiquityContainer:"
  },
  "title" : "moveToUbiquityContainer(_:)"
}
-->

# moveToUbiquityContainer(_:)

Moves the document to the user’s iCloud storage.

```
@IBAction func moveToUbiquityContainer(_ sender: Any?)
```

## Parameters

`sender`

The control sending the message.

## Discussion

AppKit calls this method automatically in response to the user selecting the Move to iCloud… menu item in a document-based app. The default implementation presents the user with an alert asking to confirm the move before invoking the [`move(to:completionHandler:)`](/documentation/AppKit/NSDocument/move(to:completionHandler:)) method with a URL in the app’s default ubiquity container.

See Moving the Document for descriptions of methods for moving a document to a local path.

---

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)