Xcode Lag Issue When Using Custom rawValue in Enum

I've encountered a performance issue in Xcode related to the use of a custom rawValue in enums. When attempting to create a variable using rawValue as its name inside the enum, Xcode exhibits significant lag and performance degradation.

This only use to happen in medium to large projects.

Steps to Reproduce:

  • Define an enum with a custom rawValue property.
  • Navigate through your codebase, especially in models.
    enum Example {
        case test1, test2, test3

        var rawValue: Int {
            0
        }
    }

Renaming rawValue into anything else solves the issue.

It's possible that Xcode has optimizations or behaviors associated with certain conventional names, such as rawValue.

Xcode Lag Issue When Using Custom rawValue in Enum
 
 
Q