Basically, what I want to do is detect when a user scrolls inside a text view, and then hide a label (Smoothly fade out, if possible). (The label indicates to scroll to view the rest of the text, but I don’t want it to still show after the user has done so.)
If you could include in your answer the code used in the h/m files, it would be greatly appreciated.
Updated code for future reference:
.h
@interface myViewController : UIViewController
@property(nonatomic,retain) IBOutlet UILabel *label;
.m
@synthesize label;
- (void)scrollViewDidScroll:(UIScrollView *)textView
{
[UIView animateWithDuration:1.0 animations:^{
label.alpha = 0;
}];
}
Then make sure to set the UITextView delegate to self.
You can use UIScrollView’s delegate method
– scrollViewDidScroll:to detect that the user has scrolled, and fade out your label with a UIView animation block, like so: