---
title: changedElements()
framework: gamecontroller
role: symbol
role_heading: Instance Method
path: gamecontroller/gcdevicephysicalinputstatediff/changedelements()-2zzwm
---

# changedElements()

Returns the elements that changed since the previous input state.

## Declaration

```swift
func changedElements() -> (some Sequence<any GCPhysicalInputElement>)?

```

## Mentioned in

Handling input events

## Return Value

Return Value A sequence that contains the changed elements in no particular order.

## Discussion

Discussion Returns nil if there’s no previous input state, either because this is the first input state or Game Controller discards the prior input state because the queue is full.

## See Also

### Getting changes

- [change(for:)](gamecontroller/gcdevicephysicalinputstatediff/change(for:).md)
- [GCDevicePhysicalInputElementChange](gamecontroller/gcdevicephysicalinputelementchange.md)
- [changedElements()](gamecontroller/gcdevicephysicalinputstatediff/changedelements()-9cdq4.md)
