2 // LengTransformer.swift
5 // Created by Hori,Masaki on 2017/01/04.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 fileprivate enum LengType: Int {
19 final class LengTransformer: ValueTransformer {
21 override class func transformedValueClass() -> AnyClass {
26 override func transformedValue(_ value: Any?) -> Any? {
28 guard let v = value as? Int, let type = LengType(rawValue: v)
33 return NSLocalizedString("Short", comment: "Range, short")
36 return NSLocalizedString("Middle", comment: "Range, middle")
39 return NSLocalizedString("Long", comment: "Range, long")
42 return NSLocalizedString("Very Long", comment: "Range, very long")