Currency

@objcMembers
public final class Currency : NSObject

Currency structure.

  • Lowercased 3-letters currency ISO code.

    Declaration

    Swift

    public let isoCode: String
  • Pretty printed object description.

    Declaration

    Swift

    public override var description: String { get }
  • Initializes currency with 3-lettered ISO code.

    Throws

    Invalid currency exception.

    Declaration

    Swift

    @objc(initWithISOCode:error:)
    public init(isoCode: String) throws

    Parameters

    isoCode

    ISO code.

  • Initializes the currench with 3-lettered ISO code.

    Warning

    This method returns nil if ISO code is not valid.

    Declaration

    Swift

    @objc(initWithISOCode:)
    public convenience init?(_ isoCode: String)

    Parameters

    isoCode

    3-lettered ISO code.

  • Creates and returns an instance of Currency with the given isoCode.

    Declaration

    Swift

    @objc(withISOCode:)
    public static func with(isoCode: String) -> Currency?

    Parameters

    isoCode

    Three-lettered currency ISO code.

    Return Value

    An instance of Currency or nil if ISO code is invalid.

  • Checks if 2 objects are equal.

    Declaration

    Swift

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

    Parameters

    lhs

    First object.

    rhs

    Second object.

    Return Value

    true if 2 objects are equal, false otherwise.

  • Checks if the receiver is equal to object.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

    Parameters

    object

    Object to test equality with.

    Return Value

    true if the receiver is equal to object, false otherwise.

  • Declaration

    Swift

    public static let allCases: [Currency]
  • Encodes the contents of the receiver.

    Throws

    EncodingError

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    Encoder.

  • Declaration

    Swift

    public convenience init(from decoder: Decoder) throws
  • Creates a copy of the receiver.

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    Zone.

    Return Value

    Copy of the receiver.