Structure
NonEmpty
@propertyWrapper
public struct NonEmpty
NonEmpty
as PropertyWrapper
example
struct User {
@NonEmpty
var email: String?
init(email: String?) {
self.email = email
}
}
if value email is string empty, then it will automatically set to nil
Relationships
Conforms To
Equatable
ExpressibleByStringLiteral
Hashable
Initializers
init(_:)
public init(_ wrappedValue: String?)
init(stringLiteral:)
public init(stringLiteral value: String)
Properties
wrappedValue
public var wrappedValue: String?
Methods
hash(into:)
public func hash(into hasher: inout Hasher)