if ([label.text isEqual:@”Hello World”]) {
label.text = @”Goodbye World”;
} else {
label.text = @”Hello World”;
}
An iOS Developer on React Native
Chalk + Chisel
1.4K62
You can use Conditional Operators in Objective-C also.
label.text = [label.text isEqual:@”Hello World”] ? @”Goodbye World” : @”Hello World”;
Nice article btw. It reminds me, when I was moving from Xcode to Titanium(apps written with Javascript for iOS and Android).
***Spoiler Alert*** I moved back to Xcode after a year :)