<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIActivityCollaborationModeRestriction"
  },
  "title" : "UIActivityViewController.CollaborationModeRestriction"
}
-->

# UIActivityViewController.CollaborationModeRestriction

An object that disables the sharing mode and optionally displays an alert.

```
class CollaborationModeRestriction
```

## Topics

### Creating a disabled mode

[`init(disabledMode: UIActivityCollaborationMode)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(disabledMode:))

Copies the provided disabled mode.

[`init(disabledMode: UIActivityCollaborationMode, alertTitle: String, alertMessage: String)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(disabledMode:alertTitle:alertMessage:))

Creates a disabled mode that displays an alert when someone tries to select that mode.

[`init(disabledMode: UIActivityCollaborationMode, alertTitle: String, alertMessage: String, alertDismissButtonTitle: String)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(disabledMode:alertTitle:alertMessage:alertDismissButtonTitle:))

Creates a disabled mode that displays an alert with a customized dismiss button.

[`init(disabledMode: UIActivityCollaborationMode, alertTitle: String, alertMessage: String, alertDismissButtonTitle: String, alertRecoverySuggestionButtonTitle: String, alertRecoverySuggestionButtonLaunch: URL)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(disabledMode:alertTitle:alertMessage:alertDismissButtonTitle:alertRecoverySuggestionButtonTitle:alertRecoverySuggestionButtonLaunch:))

Creates a disabled mode that displays an alert with a recovery suggestion.

### Accessing the disabled mode’s properties

[`var alertDismissButtonTitle: String?`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/alertDismissButtonTitle)

A title for the alert’s dismiss button.

[`var alertMessage: String?`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/alertMessage)

A message displayed by the alert

[`var alertRecoverySuggestionButtonLaunchURL: URL?`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/alertRecoverySuggestionButtonLaunchURL)

A launch URL that the system passes to your app when someone taps the recovery suggestion button.

[`var alertRecoverySuggestionButtonTitle: String?`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/alertRecoverySuggestionButtonTitle)

A title for the alert’s recovery suggestion button.

[`var alertTitle: String?`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/alertTitle)

A title for the alert that the system displays when someone selects the disabled mode.

[`var disabledMode: UIActivityCollaborationMode`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/disabledMode)

The mode that is disabled.

[`func description() -> String`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/description())

Returns a description of the disabled mode.

### Initializers

[`init?(coder: NSCoder)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(coder:))

[`init(disabledMode: UIActivityCollaborationMode, alertTitle: String, alertMessage: String, alertDismissButtonTitle: String, alertRecoverySuggestionButtonTitle: String, alertRecoverySuggestionButtonLaunchURL: URL)`](/documentation/UIKit/UIActivityViewController/CollaborationModeRestriction/init(disabledMode:alertTitle:alertMessage:alertDismissButtonTitle:alertRecoverySuggestionButtonTitle:alertRecoverySuggestionButtonLaunchURL:))

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)