Home > other >  XCode 13 SortOrder is ambiguous
XCode 13 SortOrder is ambiguous

Time:09-23

Check out this error in the most recently updated Xcode (13):

enter image description here

Did Apple screw something up? How do I fix this? I can see when I start typing SortOrder it shows a Protocol and an Enum.

CodePudding user response:

Because of the conflicting SortOrder enum and protocol, it's ambiguous to the compiler which one you want to use.

Because the SortOrder enum is part of the Foundation framework, you can do the following to explicitly use it:

Foundation.SortOrder

Example usage:

Foundation.SortOrder.forward

Or in your case, you needed SortOrder from CouchbaseLiteSwift:

CouchbaseLiteSwift.SortOrder
  • Related