I'd like Xcode to show a warning if I have unused functions in my project. I'm using Swift.
I went to Project / Build settings
and in section Apple LLVM 8.1 - Warnings - All Languages
I've set Unused functions
to Yes
.
But I'm not getting any warning for unused functions in my project.
How can I set Xcode correctly to show me warnings for unused functions?
I don't believe that any of those warning flags apply to Swift; they mostly apply to the C-based languages (C, C++, Objective-C). My understanding is that the Swift team wants to avoid creating "dialects" of the language, so all the warnings and errors that the Swift compiler supports are always on, and there aren't really ways to turn individual warnings on or off. So given that, my supposition is that the Swift compiler doesn't currently have any way to check for unused functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With