<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4" -->

---
title: How to use raw identifiers in Swift | daily.dev
description: Swift 6.2 introduces raw identifiers via SE-0451, extending backtick syntax so names can contain spaces, leading digits, and punctuation. This lets developers...
canonical: https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to use raw identifiers in Swift | daily.dev
og:description: Swift 6.2 introduces raw identifiers via SE-0451, extending backtick syntax so names can contain spaces, leading digits, and punctuation. This lets developers...
og:url: https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4
og:image: https://api.daily.dev/og/posts/uqwKA7ZO4.png
og:image:alt: How to use raw identifiers in Swift
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use raw identifiers in Swift

**[Sarunw](https://daily.dev/sources/sarunw)** · [@sarunw](https://daily.dev/sarunw) · 6 min read · 0 upvotes · 0 comments

## Summary

Swift 6.2 introduces raw identifiers via SE-0451, extending backtick syntax so names can contain spaces, leading digits, and punctuation. This lets developers name swift-testing functions with a full descriptive sentence instead of duplicating it as a camelCase name, gives numeric enum cases a natural spelling, and lets code generators map foreign names (like SF Symbols) directly into Swift without lossy transformations. The piece covers what characters are disallowed, a property wrapper gotcha where sigils go inside the backticks, and guidance on when raw identifiers are worth using versus when they burden callers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://sarunw.com/posts/how-to-use-raw-identifiers-in-swift>

## Questions this post answers

### What are raw identifiers in Swift 6.2 and what do they let you do?

Raw identifiers, introduced in Swift 6.2 through proposal SE-0451, extend the existing backtick syntax so names can contain characters normally disallowed in identifiers, such as spaces, leading digits, and punctuation. Wrapping a name in backticks makes it the real declared name, not a display string, so tools like the debugger, linker, and crash logs all see the same name.

_Developers adopting new Swift language features can track releases like this one on daily.dev._

### Why would I use a raw identifier instead of the @Test description string in swift-testing?

Using a raw identifier for the function name itself means you only write the test description once instead of duplicating it as both a @Test string and a camelCase function name. The @Test description only reaches the test report, while the actual function name is what the compiler, linker, and backtraces see, so naming the function directly keeps every tool consistent.

_Teams standardizing on swift-testing patterns can follow syntax changes like this via daily.dev._

### What characters are not allowed inside a Swift raw identifier?

A raw identifier cannot contain a backtick, a backslash, a newline, carriage return, or NUL and other non-printable ASCII control characters. It also cannot consist entirely of whitespace or entirely of operator characters, though a name that merely contains an operator character, like an asterisk within a sentence, is fine as long as it isn't operator characters only.

_Developers navigating Swift syntax edge cases can keep up with language changes on daily.dev._

## Similar posts on daily.dev

- [Memberwise Initializer in Swift explained with Code Examples](https://daily.dev/posts/memberwise-initializer-in-swift-explained-with-code-examples-oywf9uwcf) · SwiftLee · 1 upvotes · 0 comments
- [Advanced techniques in Swift macros](https://daily.dev/posts/advanced-techniques-in-swift-macros-arv3wzyg6) · Point-Free Pointers · 6 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#swift](https://daily.dev/tags/swift)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to use raw identifiers in Swift","url":"https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4"},"datePublished":"2026-08-28T03:48:34.802Z","dateModified":"2026-08-29T00:00:15.662Z","description":"Swift 6.2 introduces raw identifiers via SE-0451, extending backtick syntax so names can contain spaces, leading digits, and punctuation. This lets developers...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5730546111962e5fba16bd23605d14c0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5730546111962e5fba16bd23605d14c0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sarunw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Sarun Wongpatcharapakorn","url":"https://daily.dev/sarunw","image":"https://avatars.githubusercontent.com/u/795368?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":20}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,swift","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sarunw","item":"https://daily.dev/sources/sarunw"},{"@type":"ListItem","position":3,"name":"How to use raw identifiers in Swift"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-use-raw-identifiers-in-swift-uqwka7zo4#faq","mainEntity":[{"@type":"Question","name":"What are raw identifiers in Swift 6.2 and what do they let you do?","acceptedAnswer":{"@type":"Answer","text":"Raw identifiers, introduced in Swift 6.2 through proposal SE-0451, extend the existing backtick syntax so names can contain characters normally disallowed in identifiers, such as spaces, leading digits, and punctuation. Wrapping a name in backticks makes it the real declared name, not a display string, so tools like the debugger, linker, and crash logs all see the same name. Developers adopting new Swift language features can track releases like this one on daily.dev."}},{"@type":"Question","name":"Why would I use a raw identifier instead of the @Test description string in swift-testing?","acceptedAnswer":{"@type":"Answer","text":"Using a raw identifier for the function name itself means you only write the test description once instead of duplicating it as both a @Test string and a camelCase function name. The @Test description only reaches the test report, while the actual function name is what the compiler, linker, and backtraces see, so naming the function directly keeps every tool consistent. Teams standardizing on swift-testing patterns can follow syntax changes like this via daily.dev."}},{"@type":"Question","name":"What characters are not allowed inside a Swift raw identifier?","acceptedAnswer":{"@type":"Answer","text":"A raw identifier cannot contain a backtick, a backslash, a newline, carriage return, or NUL and other non-printable ASCII control characters. It also cannot consist entirely of whitespace or entirely of operator characters, though a name that merely contains an operator character, like an asterisk within a sentence, is fine as long as it isn't operator characters only. Developers navigating Swift syntax edge cases can keep up with language changes on daily.dev."}}]}
```

