Trying to extend IntegerType (and FloatingPointType); Why can't all Int types be converted to NSTimeInterval
问题 (This probably needs a better title...) I would like to have a set of accessors I can use in code to quickly express time durations. E.g: 42.seconds 3.14.minutes 0.5.hours 13.days This post illustrates that you can't just do it with a simple new protocol, extension, and forcing IntegerType and FloatingPointType to adopt that. So I thought I'd just go the more redundant route and just extend IntegerType directly (and then repeat the code for FloatingPointType ). extension IntegerType { var