<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIActivityViewController/init(activityItems:applicationActivities:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIActivityViewController(im)initWithActivityItems:applicationActivities:"
  },
  "title" : "init(activityItems:applicationActivities:)"
}
-->

# init(activityItems:applicationActivities:)

Initializes a new activity view controller object that acts on the specified data.

```
init(activityItems: [Any], applicationActivities: [UIActivity]?)
```

## Parameters

`activityItems`

The array of data objects on which to perform the activity. The type of objects in the array is variable and dependent on the data your application manages. For example, the data might consist of one or more string or image objects representing the currently selected content.

    Instead of actual data objects, the objects in this array can be objects that adopt the [`UIActivityItemSource`](/documentation/UIKit/UIActivityItemSource)     protocol, such as [`UIActivityItemProvider`](/documentation/UIKit/UIActivityItemProvider)     objects. Source and provider objects act as proxies for the corresponding data in situations where you do not want to provide that data until it is needed. Note that you should not reuse an activity view controller object that includes a [`UIActivityItemProvider`](/documentation/UIKit/UIActivityItemProvider)     object in its     `activityItems`     array.

    This array must not be     `nil`     and must contain at least one object.

`applicationActivities`

An array of [`UIActivity`](/documentation/UIKit/UIActivity) objects representing the custom services that your application supports. This parameter may be `nil`.

## Return Value

The activity view controller to present.

## Discussion

It is your responsibility to present and dismiss the view controller using the appropriate means for the given device idiom. On iPad, you must present the view controller in a popover. On other devices, you must present it modally.

---

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)