Search code examples
iosswiftxcodecocoapods

Why compiler display error on one project, and not on the other for the same library CDMarkdownKit?


I have two projects: FS and IL.

For both of them I use Xcode 11.5, Swift Language Version 4, cocoapod lib CDMarkdownKit and different Macbooks.

In podfile.lock there is the same version:

- CDMarkdownKit (1.2.1)

Now when I compile it on FS I got an error:

enter image description here

but on IL project everything compiles fine without error in the same place:

enter image description here

What makes the difference?


Solution

  • Looks to me that in the first case you don’t handle the ‘default’ case into the switch, and that’s why the compiler tells you to be more exhaustive in handling all the cases. In the second case you actually have default: break, which does the trick. Handling all the cases or adding the fallback ‘default: break’ should do the job