 
 // MARK: - FileType
 
-public enum FileType: String, Equatable, CaseIterable {
+public enum FileType: String, Equatable {
     case h, json, m, markdown = "md", mm, pbxproj, plist, storyboard, swift, xcscheme, yaml, yml
 }
+
+#if swift(>=4.2)  // Use compiler-generated allCases when available
+    extension FileType: CaseIterable {}
+#else
+    extension FileType {
+        static var allCases: [FileType] {
+            return [.h, .json, .m, .markdown, .mm, .pbxproj, .plist, .storyboard, .swift, .xcscheme, .yaml, .yml]
+        }
+    }
+#endif
 
 // MARK: - FileType extensions
 

        else {
            return nil
        }
        
        let rawValue = match.replacingOccurrences(of: ".", with: "")
        self.init(rawValue: rawValue)
    }

    public var fileType: FileType? {
        return FileType(from: self)
    }

    public var name: String {
        return String(self)
    }
