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

Jing Wei: "Short Video Camera Lighting Practical Teaching"

Jing Wei's "Short Video Camera Lighting ...

Electric rays: the "Pikachu" and "generator" of the ocean

Electric rays are cartilaginous fish belonging to...

up to date! Tencent Advertising Platform Practical Guide

Today I bring you "AD Delivery Platform Usag...

Top 10 SaaS Product Operation Trends in 2021

Many companies and businesses came to a standstil...

iOS 9 Learning Series: Split Screen Multitasking

A major change in iOS 9 is the addition of multit...

The fifth episode of the Aite tribe clinic: data collection and front-end application

【51CTO.com original article】 Activity description...

Science in the spotlight this week | Desert lakes seen from space

1. Desert lakes seen from space Recently, my coun...