---
title: "setObjects(_:localOnly:expirationDate:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipasteboard/setobjects(_:localonly:expirationdate:)-3h3iz"
---

# setObjects(_:localOnly:expirationDate:)

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

## Declaration

```swift
func setObjects(_ objects: [any NSItemProviderWriting], localOnly: Bool, expirationDate: Date?)
```

## 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.

## See Also

### Getting and setting item providers

- [itemProviders](uikit/uipasteboard/itemproviders.md)
- [setItemProviders(_:localOnly:expirationDate:)](uikit/uipasteboard/setitemproviders(_:localonly:expirationdate:).md)
- [setObjects(_:)](uikit/uipasteboard/setobjects(_:)-lljo.md)
- [setObjects(_:)](uikit/uipasteboard/setobjects(_:)-fjg8.md)
- [setObjects(_:localOnly:expirationDate:)](uikit/uipasteboard/setobjects(_:localonly:expirationdate:)-26u8o.md)
