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

How can humans achieve "banana freedom"? First, cure the "cancer" of bananas!

1. Overview 1.1 Banana’s function and value Banan...

Why does my girlfriend always think she is right? (Must read for boys)

One minute with the doctor, the postures are cons...

Machine Learning and Semantic Search What is Google's Ultimate Weapon?

The past few years have been exciting (or scary, ...

Why does it hurt when you see others getting hurt?

We may feel heartbroken for the tragic life of th...

What are the advantages and disadvantages of upgrading to iOS15.3?

Happy Chinese New Year! I believe everyone has re...

You must know these 5 promotion and operation tools commonly used by experts!

In the eyes of most operators, operations are dir...

iOS 12 full version jailbreak tool released: up to iPhone X supported

After months of compilation, the pwn20wnd team fi...

The top ten screen-sweeping crises in 2019!

Crisis public relations summaries are made every ...