Instance Property

reasonForSnapshot

The reason for taking the upcoming snapshot.

Declaration

var reasonForSnapshot: WKSnapshotReason { get }

Discussion

You can use this property to change your application's appearance before a snapshot is taken. For example, if the property contains an WKSnapshotReason.appBackgrounded value, you'd probably want to capture the app's current state, and no changes are necessary. However, if the property contains a WKSnapshotReason.returnToDefaultState value, you may want to navigate back to the root view controller before taking the snapshot.

For a list of possible reasons for taking the snapshot, see WKSnapshotReason.