Initializer

init(firstPrice:secondPrice:currencyCode:)

Initializes the object with the specified range of prices.

Declaration

init(firstPrice: NSDecimalNumber, secondPrice: NSDecimalNumber, currencyCode: String)

Parameters

firstPrice

The first price. This parameter must not be nil.

secondPrice

The second price. This parameter must not be nil.

currencyCode

The ISO 4217 currency code to apply to the price information. You can get a list of possible currency codes using the isoCurrencyCodes method of NSLocale. For example, the string “USD” corresponds to United States dollars.

Return Value

An initialized price range object or nil if the object could not be created.

Discussion

This method assigns the lesser of the two price values to the minimumPrice property, and it assigns the greater of the two values to the maximumPrice property.

See Also

Creating a Price Range Object

init(price: NSDecimalNumber, currencyCode: String)

Initializes the object with the specified price information.

init(maximumPrice: NSDecimalNumber, currencyCode: String)

Initializes the object with the specified maximum price information.

init(minimumPrice: NSDecimalNumber, currencyCode: String)

Initializes the object with the specified minimum price information.