Realize various gesture operations for visualization

Realize various gesture operations for visualization

Source code introduction

Realize various visual gesture operations, that is, add trajectory effects to gesture operations, including click, slide, long press, etc.

Source code running screenshot

Code Snippet

  1. _- (COSTouchVisualizerWindow *)window
  2. {
  3. static COSTouchVisualizerWindow *customWindow = nil;
  4. if (!customWindow) {
  5. customWindow = [[COSTouchVisualizerWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  6. [customWindow setFillColor:[UIColor yellowColor]];
  7. [customWindow setStrokeColor:[UIColor purpleColor]];
  8. [customWindow setTouchAlpha: 0.4 ];
  9.       
  10. [customWindow setRippleFillColor:[UIColor yellowColor]];
  11. [customWindow setRippleStrokeColor:[UIColor purpleColor]];
  12. [customWindow setRippleAlpha: 0.1 ];
  13. }
  14. return customWindow;
  15. }
  16.   
  17. - ( void )COSTouchVisualizerWindow_commonInit {
  18. self.strokeColor = [UIColor blackColor];
  19. self.fillColor = [UIColor whiteColor];
  20.   
  21. self.rippleStrokeColor = [UIColor whiteColor];
  22. self.rippleFillColor = [UIColor blueColor];
  23.   
  24. self.touchAlpha = 0.5 ;
  25. self.fadeDuration = 0.3 ;
  26.   
  27. self.rippleAlpha = 0.2 ;
  28. self.rippleFadeDuration = 0.2 ;
  29.   
  30. self.stationaryMorphEnabled = YES;
  31.   
  32. [[NSNotificationCenter defaultCenter] addObserver:self
  33. selector: @selector (screenConnect:)
  34. name:UIScreenDidConnectNotification
  35. object:nil];
  36.   
  37. [[NSNotificationCenter defaultCenter] addObserver:self
  38. selector: @selector (screenDisconnect:)
  39. name:UIScreenDidDisconnectNotification
  40. object:nil];
  41.   
  42. // Set up active now, in case the screen was present before the window was created (or application launched).  
  43. [self updateFingertipsAreActive];
  44. }

Source code link: http://download..com/data/1968752

<<:  Android open source time selection control

>>:  【Android】Implement the auto-complete function for search

Recommend

Beware! Wildfires are more likely to occur in autumn!

Wildfires are more likely to occur in autumn Ente...

What are the tasks that Zhaoqing SEO personnel have to do every day?

Many people say that SEO is no longer effective, ...

Wild watermelon seedlings are neither watermelons nor seedlings.

Speaking of wild watermelon seedlings Hibiscus tr...

Case analysis of programmatic creative delivery of information flow advertising!

This is the best era. With the support of AI, inf...

You have acquired countless skills, but why have you achieved nothing?

[[163186]] A few days ago, I saw a sentence from ...

The best marketing channel selection strategy for advertising!

"If I give you 10 million, how would you spe...

The legendary snail that disappeared for a century reappears in the world!

Recently, Chinese researchers discovered sessile ...