One Quickie

Swift if case let (Swift->General)
Because I can never remember the syntax: Given
enum FilterOptionValue {
    case oneSided(value: Double)
    case twoSided(low: Float, high: Double)
You can unpack it piecewise on demand with
        if case let .twoSided(low, high) = thingieOption.value {
            minThingie = Int(low)
            upperThingie = Int(high)

borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book