I'm trying to execute both functions but when the first return true, the second function is not executed.
func run() {
if test1() || test2() {
doSomething()
}
}
func test1() -> Bool {
print("test1")
return true
}
func test2() -> Bool {
print("test2")
return false
}
func DoSomething() {
print("something")
}
Getting Result ::
test1
something
Wanted Result ::
test1
test2
something
In Android we can use one | do it. But not in swift, if someone knows how to do.