<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCWindowSceneEvent",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core NFC",
      "UIKit"
    ],
    "preciseIdentifier" : "s:14_CoreNFC_UIKit19NFCWindowSceneEventO"
  },
  "title" : "NFCWindowSceneEvent"
}
-->

# NFCWindowSceneEvent

An NFC-related event that your app uses to update its user interface.

```
enum NFCWindowSceneEvent
```

## Overview

When the device is eligible to receive NFC-related events, this type indicates the type of received event. The event may indicate the presence of an NFC reader or a gesture by the person using the app to initiate a contactless transaction. [`NFCWindowSceneEvent`](/documentation/CoreNFC/NFCWindowSceneEvent) represents these as the [`NFCWindowSceneEvent.readerDetected`](/documentation/CoreNFC/NFCWindowSceneEvent/readerDetected) and [`NFCWindowSceneEvent.presentation`](/documentation/CoreNFC/NFCWindowSceneEvent/presentation) cases, respectively.

You can receive this event in two scenarios:

- When the system calls <doc://com.apple.documentation/documentation/UIKit/UISceneDelegate> method <doc://com.apple.documentation/documentation/UIKit/UISceneDelegate/scene(_:willConnectTo:options:)>, the system created a new scene in response to the event. In this case, check the `connectionOptions` parameter for the presence of the <doc://com.apple.documentation/documentation/UIKit/UIScene/ConnectionOptions/nfcEvent> member, which is an instance of [`NFCWindowSceneEvent`](/documentation/CoreNFC/NFCWindowSceneEvent).
- When the system calls the [`NFCWindowSceneDelegate`](/documentation/CoreNFC/NFCWindowSceneDelegate) method [`windowScene(_:didReceiveNFCWindowSceneEvent:)`](/documentation/CoreNFC/NFCWindowSceneDelegate/windowScene(_:didReceiveNFCWindowSceneEvent:)), the system delivered the event to an existing scene.

In either case, store the event and use it to update the UI for an NFC interaction. The following example shows a scene delegate that handles both scenarios, using a `ViewModel` class to store the event for use by an appropriate view:

```swift
import UIKit
import SwiftUI
import CoreNFC

class SceneDelegate: UIResponder, UIWindowSceneDelegate, NFCWindowSceneDelegate {

    var window: UIWindow?
    var myViewModel = ViewModel()

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        
        // Check the connection options to see if the scene is being created
        // in response to an NFC event.
        guard let nfcEvent = connectionOptions.nfcEvent  else { return }
        // If there's an event, update the view model.
        myViewModel.receivedNFCEvent = nfcEvent

        // Update the view hierarchy by using myViewModel to create a new
        // view.
    }

    func windowScene(_ windowScene: UIWindowScene, didReceiveNFCWindowSceneEvent event: NFCWindowSceneEvent) {
        // Update the view model with the NFC event.
        myViewModel.receivedNFCEvent = event
        // Update the view hierarchy by using myViewModel to create a new
        // view.
     }
}
```

## Topics

### Events

[`case readerDetected`](/documentation/CoreNFC/NFCWindowSceneEvent/readerDetected)

The eligible device detected the RF field of an NFC reader.

[`case presentation`](/documentation/CoreNFC/NFCWindowSceneEvent/presentation)

The user performed a gesture to present an NFC display.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Decodable`](/documentation/Swift/Decodable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

---

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)