<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPasteboard/setObjects(_:localOnly:expirationDate:)-26u8o",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So12UIPasteboardC5UIKitE10setObjects_9localOnly14expirationDateySayxG_Sb10Foundation0H0VSgts21_ObjectiveCBridgeableRzSo21NSItemProviderWriting01_J5CTypeRpzlF"
  },
  "title" : "setObjects(_:localOnly:expirationDate:)"
}
-->

# setObjects(_:localOnly:expirationDate:)

Sets and configures an array of item providers for the pasteboard, based on a specified array of objects.

```
func setObjects<T>(_ objects: [T], localOnly: Bool, expirationDate: Date?) where T : _ObjectiveCBridgeable, T._ObjectiveCType : NSItemProviderWriting
```

## Parameters

`objects`

An array of item providers for the pasteboard.

`localOnly`

If <doc://com.apple.documentation/documentation/Swift/false>, the pasteboard items are available to other devices through the Handoff feature; if <doc://com.apple.documentation/documentation/Swift/true>, the pasteboard items are only available to the local device.

`expirationDate`

An <doc://com.apple.documentation/documentation/Foundation/NSDate> value that specifies the time and date that you want the system to remove the pasteboard items from the pasteboard.

---

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)