Journal

SwiftUI NFC Reader with a Bottom Sheet Result

Core NFC reads tags, not payment cards. The system shows its own scan sheet; your bottom sheet shows the result.

SwiftUI NFC Reader with a Bottom Sheet Result: a glass app tile showing the VP0 logo on a pink and blue gradient

TL;DR

A SwiftUI NFC reader uses Core NFC (NFCNDEFReaderSession) to scan NDEF tags. iOS shows its own system scan UI, so your job is a clean SwiftUI bottom sheet (presentationDetents) for the result, retry, and next action. You need the NFC capability, an entitlement, and a usage description. Core NFC reads and writes tags but never reads payment cards, which is Tap to Pay. Start from a free VP0 design.

An NFC reader on iOS is simpler and more constrained than people expect. Core NFC scans NDEF tags, and the system presents its own scan sheet while it listens. Your interface job is what happens around that: a clean SwiftUI bottom sheet that shows the scanned result, offers a retry, and points to the next action. VP0 is the free, AI-readable iOS design library builders use as the visual starting point for that sheet, so you can focus on wiring Core NFC instead of designing from scratch.

Who this is for

You are building a SwiftUI app that scans NFC tags on posters, products, stickers, or access points, and you want a native result sheet plus the correct entitlements. This is the pattern, and the honest limits.

Core NFC reads tags, not cards

The single most important truth: Core NFC reads tags, it does not read payment cards. Apple’s Core NFC documentation covers NDEF messages and several tag technologies, but the EMV data on a credit card is off limits. Accepting an in-person card tap is Tap to Pay on iPhone, a separate capability that needs an approved payment-platform SDK and a special entitlement, the same boundary covered in our Core NFC and Tap to Pay guide. Decide which one you actually need before writing code, because they share a name and almost nothing else.

What Core NFC can and cannot do

CapabilityCore NFCNote
Read NDEF tagsYesPosters, stickers, products
Write NDEF tagsYesEncode a URL or text to a blank tag
Background tag readingYes on iPhone XS and newerA tap opens your app, no session needed
Read payment cardsNoThat is Tap to Pay, a separate entitlement
Work on SimulatorNoRequires a physical iPhone 7 or newer

Background tag reading is a quiet superpower: on iPhone XS and later, tapping a tag can launch your app through a URL without any session UI at all.

Wiring the scan and the sheet

Start an NFCNDEFReaderSession when the user taps Scan. iOS shows its system scan sheet; you cannot fully theme that part. When a tag is read, dismiss the system sheet and present your own SwiftUI bottom sheet with presentationDetents so the result slides up at a comfortable height. Show the decoded payload, a clear success or error state, and a retry button. This is the same native-sheet discipline used in a Bluetooth pairing flow, where the connection states drive the UI.

Set up the entitlement

Two pieces of setup trip everyone up. First, add the Near Field Communication Tag Reading capability in Xcode, which writes the entitlement. Second, add an NFCReaderUsageDescription string to Info.plist explaining why you scan, or the session fails without an obvious error. The global NFC market is projected to pass $30 billion in the coming years, and most of that is tag reading like this, not payments. Once the capability and usage string are in place, the system scan sheet appears on a real device.

A worked example: scan a poster

Say you put an NFC sticker on an event poster. The user taps Scan in your app, the system scan sheet appears, and they hold the phone near the sticker. Core NFC reads the NDEF record, which holds a URL, and your app dismisses the system sheet and slides up the result bottom sheet showing the event name and a View details button. If the read fails, the sheet shows a friendly retry instead of an error code. For a hands-free version, encode the same URL so iPhone XS and newer launch your app on a background tap, with no in-app Scan button required. The reading code is a few dozen lines; the polish lives entirely in that result sheet. Field-service apps often scan an asset tag like this and then generate paperwork such as a plumbing invoice.

Common mistakes and fixes

  • Expecting to read a credit card. Use Tap to Pay for payments; Core NFC is for tags.
  • Missing the usage description. Add NFCReaderUsageDescription or the session silently fails.
  • Testing on Simulator. Core NFC needs a physical iPhone 7 or newer.
  • Theming the system scan sheet. You cannot; put your branding in the result bottom sheet instead.
  • Ignoring write mode. You can encode a URL onto a blank tag, useful for a LiDAR-style scan-to-info flow.

Key takeaways

  • Core NFC reads and writes NDEF tags; it never reads payment cards.
  • The system owns the scan sheet; your SwiftUI bottom sheet owns the result.
  • Enable the NFC capability and add NFCReaderUsageDescription, or scanning fails.
  • Test on a physical iPhone 7 or newer, and start from a free VP0 design.

Frequently asked questions

The FAQ above answers where to get a free template, whether Core NFC can read cards, what setup NFC needs, and why a scan fails to start.

Frequently asked questions

Where can I find a free SwiftUI NFC reader bottom sheet template?

VP0 is the free, AI-readable iOS design library builders start from for an NFC reader: it gives you the bottom sheet result layout (scan prompt, success, retry) that you wire to Core NFC. Pair the visual with NFCNDEFReaderSession for the scan and presentationDetents for the sheet, and you have a working pattern without paying for a kit.

Can Core NFC read credit cards on iPhone?

No. Core NFC reads NDEF and certain tag formats, not the EMV data on payment cards. Accepting an in-person card tap is Tap to Pay on iPhone, a separate capability that requires an approved payment platform SDK and a special entitlement. If your goal is reading product tags, posters, or stickers, Core NFC is correct; if it is taking payments, you need Tap to Pay.

What do I need to enable NFC reading in an iOS app?

Add the Near Field Communication Tag Reading capability in Xcode, which adds the entitlement, and include an NFCReaderUsageDescription string explaining why you scan. Without the usage description the session fails silently. Then start an NFCNDEFReaderSession from SwiftUI and present the result in your own bottom sheet.

Why does my NFC scan fail to start in SwiftUI?

The most common causes are a missing entitlement, a missing NFCReaderUsageDescription in Info.plist, testing on Simulator or an unsupported device, or starting the session off the main actor. Core NFC needs a physical iPhone 7 or newer, the capability enabled, and the usage string present; fix those and the system scan sheet appears.

Part of the Native Hardware, Sensors & Device Features hub. Browse all VP0 topics →

Keep reading

Apple HealthKit Step Counter in SwiftUI (Free Template): a vivid neon 3D App Store icon on an orange, pink and blue gradient
Guides 4 min read

Apple HealthKit Step Counter in SwiftUI (Free Template)

Build a step-counter UI on HealthKit in SwiftUI: permission, today's steps, a trend chart, and goals, from a free VP0 design. Private, and not medical.

Lawrence Arya · May 31, 2026
Bluetooth Device Pairing UI in SwiftUI (Free Template): the App Store logo as a glossy glass icon on a purple and blue gradient with floating bubbles
Guides 4 min read

Bluetooth Device Pairing UI in SwiftUI (Free Template)

A BLE pairing screen scans, lists nearby devices, and walks through connecting with clear states. Build it with Core Bluetooth from a free VP0 design.

Lawrence Arya · May 31, 2026
Core NFC and Tap to Pay for AI-Built iOS Apps: a glowing iPhone home-screen icon on a purple and blue gradient
Guides 5 min read

Core NFC and Tap to Pay for AI-Built iOS Apps

Can an AI-generated app read a physical credit card over NFC and charge it? The honest answer, plus the right way to accept a tap, built from a free VP0 design.

Lawrence Arya · May 31, 2026
watchOS AI Agent Widget Template (SwiftUI): a glass iPhone app-grid icon on a mint and teal gradient
Guides 4 min read

watchOS AI Agent Widget Template (SwiftUI)

Build an AI agent companion for Apple Watch in SwiftUI: a glanceable complication, quick actions, and a wrist-sized reply, from a free VP0 design.

Lawrence Arya · May 31, 2026
CarPlay Audio Player Template for iOS, Free: a glass iPhone UI wireframe icon on a holographic purple gradient
Guides 5 min read

CarPlay Audio Player Template for iOS, Free

Build a CarPlay audio player for iOS from a free template. Use CarPlay's list and now-playing templates the right way with Claude Code or Cursor.

Lawrence Arya · June 1, 2026
iPhone LiDAR Room Scanner UI Template (SwiftUI + RoomPlan): the App Store logo on a glass tile over a blue gradient with bubbles
Guides 4 min read

iPhone LiDAR Room Scanner UI Template (SwiftUI + RoomPlan)

Build a LiDAR room scanner UI in SwiftUI with RoomPlan: a guided scan, live coaching, and a 3D result, from a free VP0 design. With a graceful non-LiDAR fallback.

Lawrence Arya · May 31, 2026