Emptyable
public protocol Emptyable
Describes an object that be empty.
let str = ""
let retval = str.isEmpty
// so something with str which is true
-
Returns whether the receiver is empty.
Declaration
Swift
var isEmpty: Bool { get }
-
isNotEmpty
Extension methodReturns whether the receiver is NOT empty.
Declaration
Swift
var isNotEmpty: Bool { get }
-
nilIfEmpty
Extension methodReturns
nil
if the receiver is empty, otherwise returns the receiver.Declaration
Swift
var nilIfEmpty: Self? { get }