Trait
A struct representing a package’s trait.
- SwiftPM
- 6.1+
struct Trait
Traits can be used for expressing conditional compilation and optional dependencies.
A struct representing a package’s trait.
struct Trait
Traits can be used for expressing conditional compilation and optional dependencies.
import PackageDescription
Create reusable code, organize it in a lightweight way, and share it across your projects and with other developers.
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByExtendedGraphemeClusterLiteral : ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single extended grapheme cluster.
protocol ExpressibleByStringLiteral : ExpressibleByExtendedGraphemeClusterLiteral
A type that can be initialized with a string literal.
protocol ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single Unicode scalar value.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
init(name: String, description: String? = nil, enabledTraits: Set<String> = [])
Initializes a new trait.
init(stringLiteral value: StringLiteralType)
static func `default`(enabledTraits: Set<String>) -> Trait
Declares the default traits for this package.
static func trait(name: String, description: String? = nil, enabledTraits: Set<String> = []) -> Trait
Initializes a new trait.
var description: String?
The trait’s description.
var enabledTraits: Set<String>
A set of other traits of this package that this trait enables.
var name: String
The trait’s canonical name.
init(extendedGraphemeClusterLiteral value: Self.StringLiteralType)
init(unicodeScalarLiteral value: Self.ExtendedGraphemeClusterLiteralType)
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.