Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Modifier

Mattt edited this page Aug 2, 2020 · 6 revisions

Modifier

A declaration modifier.

public struct Modifier:​ Hashable, Codable

A declaration may have one or more modifiers to specify access control (private / public / etc.), declare a type member (class / static), or designate its mutability (nonmutating). A declaration modifier may specify an additional detail within enclosing parentheses (()) following its name.

For example, the following property declaration has two modifiers:​

public private(set) var title:​ String
  • The first modifier has a name equal to "public", and a nil detail

  • The second modifier has a name equal to "private" and a detail equal to "set"

Inheritance

Codable, CustomStringConvertible, ExpressibleBySyntax, Hashable

Initializers

init(_:​)

Creates an instance initialized with the given syntax node.

public init(_ node:​ DeclModifierSyntax)

Properties

name

The declaration modifier name.

let name:​ String

detail

The modifier detail, if any.

let detail:​ String?

description

var description:​ String
Clone this wiki locally