Learning Center

Learning Center

Learn Menu

Pin

This article merely explains the pin syntax in Genesis. For more information about the feature itself, please read the pin article in the engine menu.

Syntax

When we pin something, we're overwriting the design module. Pinned expressions don't sync from the design module anymore. The syntax is an exclamation mark ! placed behind a pinned item.

Let's take a look at some examples.

Pinned property data type

  class User {
    var username: string!
}

This code pins the username to always be of type string

Pinned annotation

  class User {
    @index = true!
    var username: string
}

This code pins the index annotation to the username property.

Pinned mutable property

  class User {
    var! username: string
}

Even mutable/immutable property can be pinned.

We use cookies to track activity using Google Analytics & reCAPTCHA. It helps us understand what our visitors like about our product and how they interact with our website. For more information, check out our Privacy Policy.