XCode 13 SortOrder is ambiguous

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.

1 answer

  • answered 2021-09-23 12:39 George

    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
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum