SwiftKit Documentation

Structure Non​Empty

@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

%15 NonEmpty NonEmpty ExpressibleByStringLiteral ExpressibleByStringLiteral NonEmpty->ExpressibleByStringLiteral Hashable Hashable NonEmpty->Hashable Equatable Equatable NonEmpty->Equatable

Conforms To

Equatable
ExpressibleByStringLiteral
Hashable

Initializers

init(_:​)

public init(_ wrappedValue: String?)  

init(string​Literal:​)

public init(stringLiteral value: String)  

Properties

wrapped​Value

public var wrappedValue: String?  

Methods

hash(into:​)

public func hash(into hasher: inout Hasher)  

Operators

==

public static func == (lhs: NonEmpty, rhs: NonEmpty) -> Bool