iOS source code download: Draw the input words with animation

iOS source code download: Draw the input words with animation

Functional classification: Special effects

Supported platforms: iOS

Operating environment: iOS

Development language: Object-C

Development tools: Xcode

Source code size: 174.88KB

Source code download address: http://down..com/data/1975235

Source code introduction

To implement line drawing animation for a string, you can modify the animation size and position, as well as the color of the line drawing in the class method.

Source code running screenshot

Rendering

Source code snippet

  1. -( void )startDraw:(UIButton*)sender
  2. {
  3. for (id layer in self.view.layer.sublayers) {
  4. if ([layer isKindOfClass:[ZYAnimationLayer class ]])
  5. {
  6. [layer removeFromSuperlayer];
  7. }
  8. }
  9. [ZYAnimationLayer createAnimationLayerWithString:self.myTextField.text andRect: CGRectMake(20.0f, -100.0f,
  10. CGRectGetWidth(self.view.layer.bounds) - 40.0f,
  11. CGRectGetHeight(self.view.layer.bounds) - 84.0f) andView:self.view andFont:CTFontCreateWithName(CFSTR( "Helvetica-Bold" ), 80.0f, NULL) andStrokeColor:[UIColor colorWithRed:0.3 green:0.2 blue:0.5 alpha:1]];
  12. }
  13. - ( void )textFieldDidBeginEditing:(UITextField *)textField
  14. {
  15. self.myTextField.frame = CGRectMake(self.myTextField.frame.origin.x, self.myTextField.frame.origin.y - 252, self.myTextField.frame.size.width, self.myTextField.frame.size.height);
  16. }
  17. - ( void )textFieldDidEndEditing:(UITextField *)textField
  18. {
  19. self.myTextField.frame = CGRectMake(self.myTextField.frame.origin.x, self.myTextField.frame.origin.y + 252, self.myTextField.frame.size.width, self.myTextField.frame.size.height);
  20. }

Source code download address: http://down..com/data/1975235

<<:  Novel Reading Network: How does Tingyun Server ensure the performance of a high-concurrency website with tens of millions of users?

>>:  Android source code download: Five-piece elimination game

Recommend

Why are so many people waiting for the new iPad Pro?

April is almost a third of the way through, and t...

Recommended collection | 9 common fission gameplays!

Many people have a misunderstanding about fission...

Not only on the top of the head, why is human hair becoming thinner and thinner?

The evolution of hairlessness Orangutans, mice, c...

Is the jade rabbit on the moon the rabbit from Spicy Rabbit Head?

Legend has it that there is a jade rabbit living ...

How to quote for SEO website ranking optimization plan?

For SEO website optimization personnel (newbies),...

"Sacred Salt" and "Salt God": The Mysterious Salt Worship

The magical power that salt bestows on mankind an...

Why are we attracting new users but no highly active users are left?

Some operators may feel puzzled. Why do they spen...

collect! 8 ways to get social media traffic!

Whether it is Internet e-commerce or traditional ...

“Car keys” come first, will Apple cars be far behind?

In the past two days, Apple's iOS 13 beta sys...

The underlying logic of Qianchuan’s algorithm

This article will talk about how to launch a new ...