This repository was archived by the owner on Oct 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Attribute
Mattt edited this page Aug 2, 2020
·
7 revisions
A declaration attribute.
public struct Attribute: Hashable, CodableAttributes provide additional information about a declaration.
For example,
the @discardableResult attribute indicates that
a function may be called without using the result.
Codable, CustomStringConvertible, ExpressibleBySyntax, Hashable
Creates an instance initialized with the given syntax node.
public init(_ node: AttributeSyntax)The attribute name.
let name: StringAn attribute's name is everything after the at-sign (@)
and before the argument clause.
For example,
the name of the attribute in the following declaration is "available":
@available(macOS 10.15, iOS 13, *)The attribute's arguments, if any.
let arguments: [Argument]var description: StringGenerated at 2020-08-02T12:14:07+0000 using swift-doc 1.0.0-beta.3.
Types
- AssociatedType
- Attribute
- Attribute.Argument
- Class
- ConditionalCompilationBlock
- ConditionalCompilationBlock.Branch
- DeclarationCollector
- Deinitializer
- Enumeration
- Enumeration.Case
- Extension
- Function
- Function.Parameter
- Function.Signature
- GenericParameter
- GenericRequirement
- GenericRequirement.Relation
- Import
- Initializer
- Modifier
- Operator
- Operator.Kind
- PrecedenceGroup
- PrecedenceGroup.Associativity
- PrecedenceGroup.Relation
- Protocol
- Structure
- Subscript
- Typealias
- Variable
- Variable.Accessor
- Variable.Accessor.Kind