0

I get a ton of errors in Swift that I don't want to be notified of every time.

For example, I get a little yellow triangle at the top of my screen every time I use var instead of let and the value of the variable does not change. I prefer using var to let and for the app I'm working on, I need to use var.

Here's a pic of the problem.

The problem is, I don't want to be notified of these errors! Is there a way to disable Swift from yelling at me for certain errors?

halfer
  • 19,824
  • 17
  • 99
  • 186
bdn
  • 421
  • 1
  • 4
  • 10
  • 1
    Why? The compiler is helping you save memory. Why do you need to use `var` if you aren't changing it (the warning only appears if you never change it)? Why do you prefer `var` anyways? – tktsubota Apr 01 '16 at 21:14
  • 2
    it might interest you : http://stackoverflow.com/a/34932152/5433235 Hope it helps :) – kamwysoc Apr 01 '16 at 21:42

1 Answers1

0

There is no way to get rid of these errors and warnings. If you need to use var instead of let, the error would go away, realizing that you do, in fact, need var. If the warning persists, try changing var to let and make sure that you don't get any error or warning on the line where you read or write to the variable (get the variable = to or set the variable = to). You want to make sure that you get rid of these errors and warnings before submitting the app to the app store.

Dan Levy
  • 3,931
  • 4
  • 28
  • 48