alvaromorales / tempconverter

Simple temperature converter app for iOS programming class at Yahoo!
MIT License
0 stars 0 forks source link

Review my app #1

Open alvaromorales opened 11 years ago

alvaromorales commented 11 years ago

My app is complete, please review. Not sure that this is the right way to indicate which textfield was selected, it feels a bit hacked /cc @nesquena @timothy1ee

timothy1ee commented 11 years ago

Nice work! Your implementation works, but it's not very semantic because the meaning of 0 or 1 is not very clear, nor is the tag property.

You can use the same logic you already have, but instead of using tag, you could have a property like:

@property (nonatomic, weak) UITextField *activeTextField;

and change your method to:

- (void)changeCurrentUnit {
    if ([self.cTextField isFirstResponder]) {
        self.activeTextField = self.cTextField;
    } else {
        self.activeTextField = self.fTextField;
    }
}