Ported from FMSwiftBundle