Question: I'm trying to initialise a value in dictionary as follow,

```
var og:image: String

```

But after `og:` it tries to assign the type considering `og` as the variable to site\_name, which is obviously wrong.

> 
> Is there a way to assign `og:image` as variable to `String` type using
>  special or escape characters?
> 
> 
> 

In [reference](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digits) to this, apple does not provide any meaningful explanations to variable naming conventions in such a situation.

Edit-1:

Here is code snippet to clarify dictionary `usage` is in JSON parsing data structure,

```
struct Metadata: Decodable{
    var metatags : [enclosedTags]
}
struct enclosedTags: Decodable{
    var image: String
    var title: String
    var description: String
    var og:site_name: String
}

```

Answer: 
You cannot use : (colon). But if you really want:

```
var ogCOLONimage: String

```

Joking apart. You could use a Dictionary or something like that: 

```
var images: [String: String] = ["og:image" : "your string"]

```

Now you can access your `og:image` data with `images["og:image"]`.
Swift allow you to use almost any character when naming variables. You can even use Unicode characters.

However, there are a few restrictions:

> 
> Constant and variable names can’t contain whitespace characters, mathematical symbols, arrows, private-use (or invalid) Unicode code points, or line- and box-drawing characters. Nor can they begin with a number, although numbers may be included elsewhere within the name.
> 
> 
> 

Said that, it is not possible to use `:` in the name of a variable. However, you can use a Unicode character similar to that symbol. Depending on what you want it for, this may be a valid solution. 

Here you have a list of the Unicode characters similar to `:` that can be used in the name of a variable: 

* `︓`
* `﹕`
* `：`

(<https://www.compart.com/en/unicode/based/U+003A>)

Based on the example you provided it would be this:

```
struct Metadata: Decodable{
    var metatags : [enclosedTags]
}
struct enclosedTags: Decodable{
    var image: String
    var title: String
    var description: String
    var og：site_name: String
}

```