Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.15 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. iOS Scrollview detect Scrolling
  2. #import <UIKit/UIKit.h>
  3.  
  4. @interface MyApp_ViewController : UIViewController <UIScrollViewDelegate>
  5. {
  6.  
  7. }
  8. @property (weak, nonatomic) IBOutlet UIButton *otherButton;
  9. @property (weak, nonatomic) IBOutlet UIScrollView *otherScrollView;
  10. @property (weak, nonatomic) IBOutlet UITextView *txtViewHTML;
  11.  
  12. -(void)k_RootViewPrint:(NSString *) data;
  13.  
  14. -(void)ActionEventForButton: (id) sender;
  15.  
  16. @end
  17.        
  18. -(void)scrollViewDidScroll:(UIScrollView *)scrollView
  19. {
  20.  
  21.     NSLog(@"...");
  22. }
  23.  
  24. - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
  25. {
  26.     NSLog(@"2222");
  27. }
  28. - (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
  29. {
  30.     NSLog(@"touches ended BS");
  31. }
  32.        
  33. po [[(id)UIApp keyWindow] recursiveDescription]
  34.        
  35. po [0xc894d60 delegate]
  36.        
  37. - (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event
  38. {  
  39.     // If not dragging, send event to next responder
  40.     if (!self.dragging)
  41.         [self.nextResponder touchesEnded: touches withEvent:event];
  42.     else
  43.         [super touchesEnded: touches withEvent: event];
  44. }
  45. `
  46.        
  47. - (void)viewDidLoad
  48. {
  49. [super viewDidLoad];
  50. self.otherScrollView.delegate = self; // This is the KEY