Calculating risk levels
If you need risk level to be an enum (which sounds like good idea anyway), it would be nice to tightly couple the meaning of, say, Risk.Level2 with the range of raw values it represents, such as 1..&lt;5. In other words, the enum itself should define all the applicable ranges. Depending on your specific needs, one of the following two approaches may be along the lines of what you're looking for:

enum Risk {

    case Level1, Level2, Level3, Level4

    var range: Range&lt;Int&gt; {
        switch self {
        case Level1: return 0..&lt;1
        case Level2: return 1..&lt;5
        case Level3: return 5..&lt;10
        case Level4: return 10..&lt;Int.max
        }
    }

    init(_ risk: Int) {
        switch risk {
        case Level2.range: self = Level2
        case Level3.range: self = Level3
        case Level4.range: self = Level4
        default: self = Level1
        }
    }
}

Risk(5) //--&gt; Risk.Level3


Or:

enum Risk: Int {

    case Level1 = 0
    case Level2 = 1
    case Level3 = 5
    case Level4 = 10

    var range: Range&lt;Int&gt; {
        switch self {
        case Level1: return Level1.rawValue..&lt;Level2.rawValue
        case Level2: return Level2.rawValue..&lt;Level3.rawValue
        case Level3: return Level3.rawValue..&lt;Level4.rawValue
        case Level4: return Level4.rawValue..&lt;Int.max
        }
    }

    init(_ risk: Int) {
        switch risk {
        case Level2.range: self = Level2
        case Level3.range: self = Level3
        case Level4.range: self = Level4
        default: self = Level1
        }
    }
}

Risk(5) //--&gt; Risk.Level3


This would all be much nicer if we could have enum Risk: Range&lt;Int&gt;. Unfortunately, Range&lt;Int&gt; cannot be expressed as a literal, so cases could not be assigned rawValues...