How can I clear the swift warning "will never be excuted"? -


now learning swift , when use if - else ,the xcode shows me warniing "will not excuted".though isn't big problem, don't want see this, how can clear warning in project?

this logic error compiler has picked , warning about.

it gives line number in code can never reached.

a) change logic of code

b) delete or comment out lines of code can never reached

the compiler not give message unnecessarily

example

if 1 == 2 {   = 3 }  else {   = 4 } 

obviously condition never met, a=3 assignment can never happen.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -