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

From 0 to 1, how to create a product community that can sell products?

While I am alive, I want to be the master of my l...

8 key words for smart home in 2015

Keywords: low power consumption You may be famili...

There is no UV ray in winter, but be careful about getting sunburned!

As winter approaches, many friends will ask, the ...

Craftsmanship in the Marketing Circle VS Market Style

Marketing has really become a job that is becomin...

How many flowers and trees related to dad do you know?

When it comes to Mother's Day, people will th...

The first "willow catkins forecast"! You read that right, it's here again

Spring is here The flowers are in full bloom in B...

7 routines for brand event marketing!

Advertising is like practicing Kung Fu. If you wa...