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

Uncovering the 6 “new” languages ​​of brand marketing

Six major trends and three values ​​interpret the...

Hey! You "sons of the earth" in armor and helmets, you have good news again

The Chinese pangolin (Manis pentadactyla) is dist...

Help! Why do dogs always like to eat poop? The reason is not simple...

This article was reviewed by Lin Zhideng, PhD in ...

2015 Android Development New Technology

Development Tools Android Studio: Google official...

How did the iPhone 6 break the record by pre-selling 4 million units in one day?

Apple said in a statement last Friday that the iP...

Case: How to use product thinking to carry out fission activities?

In the second half of the Internet , the user div...

These unpopular iOS apps unlock new ways to use iPhone

The launch of the iPhone in 2007 not only ushered...

New strategy for promoting brands on Xiaohongshu!

Double Eleven is coming soon. According to the la...

Changsha tea delivery, tea service vx, tea tasting venue sharing, audition mode

Changsha tea delivery, tea service vx, tea tastin...

How to have high-quality sleep? Do these things and you will have sweet dreams!

It is very important to form good sleeping habits...

How do you start to create an offline event?

1. To organize a successful offline event , we ne...

Fired on the third day of probation?

Recently, there was a very popular post on the V2...

EK releases Intel 750 hard drive water cooling head

HDD mechanical hard disks use high-speed motors, ...

How to promote and market APP? What are the common methods?

2019 marks the 11th anniversary of the App Store ...