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

Where on Earth can you see the clearest starry sky?

Author: Xingliang (University of Chinese Academy ...

Apple iOS's closed system has created an unknown gray industry chain

At the end of 2015, with the imprisonment of Xu, ...

8 strategies to make your content marketing explode!

When I think of promoting content online, I imagi...

How to carry out brand promotion on Bilibili?

Bilibili is facing the new generation of young pe...

Does brand marketing only involve advertising?

When promoting their brands, they should not just...

The oldest forest fossils push the forest's "birthday" forward millions of years!

□ Feng Weimin Recently, the international geologi...

Best recommendation for Chengdu 90-minute unlimited studio, worth collecting

Reservation arrangements for 90-minute unlimited ...

How to implement a user growth plan from 0 to 100?

What exactly is user operation ? Literally speaki...

How can you socialize if you don’t follow hot topics?

There is an interesting phenomenon in the marketi...