I am wondering inside the statement if, can I have something like Python pass?
var num = 10
num > 5 ? doSomethingIfTrue(): doSomethingIfFalse()
The code above will be fine if both true and false methods are provided. What if I only want to execute only the true method? For instance:
num > 5 ? doSomethingIfTrue(): ***pass***
I hope to get something like instructions passin swift, so the program will continue to work if false is returned. I tried continueand fallthrough, but I assume that they are used only in the loop statement.
source
share