Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Hide Warnings in Xcode

Tags:

xcode

ios

swift

Yes I know that warnings are useful and should not be disabled and I usually correct all of them, but in XCode they mingle with my code and get on my nerves. I want to see warnings when I need them not all the time and in my face!

I'm ticked by the warnings displayed for Swift since they change the language constructs all the time! They have now obsoleted the for loop (I have never heard of a language that changes it's most basic constructs, but I suppose Apple could get away with anything) and now I get warnings embedded in my code every were.

It will be much better if the warnings would not expand in my code when I do a compile so I can expand them manually if I need them. Is this possible without disabling them in settings?

like image 653
Cosmin Avatar asked May 04 '16 09:05

Cosmin


People also ask

How do I silence a warning in Swift?

I want "Jump to Next Error" (a way to skip the warnings), but it doesn't seem to exist. If you want to disable all warnings, you can pass the -suppress-warnings flag (or turn on "Suppress Warnings" under "Swift Compiler - Warning Policies" in Xcode build settings).

How do I change my build settings in Xcode?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.


2 Answers

I don't know if there are this option on Xcode 7, but in Xcode 8 just click at this icon on bottom at left side (blue icon) and it will filter only errors:

enter image description here

like image 130
Hernani Fernandes Avatar answered Sep 30 '22 19:09

Hernani Fernandes


First of all, it's a really bad idea: warnings exist for a reason, you really should check each of them.

There are few ways to try.

  1. Select Target -> select Build settings search as Warnings

Here you can change the Selected warnings to NO by selecting the dropdown.

enter image description here

  1. If you want to hide Objective c warnings follow the second image.

enter image description here

  1. If you want to hide Storyboard and XIBs warnings see the below image.

enter image description here

  1. If you want to hide Assets warning see the below image.

enter image description here

I hope this may help you :)

like image 33
Ramesh_T Avatar answered Sep 30 '22 20:09

Ramesh_T