See also the broader guidelines for Safer Swift. Here are some examples of how runtime problem cases can be prevented at compile time. You can extend this sort of pattern in all sorts of ways, e.g.