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

Crow redeems emotions "Combo 3.0"

Crow Redemption Emotion "Combo 3.0" Res...

Huawei reportedly in talks with third-party app stores to replace Google Play

On May 23, according to Phone Arena, Huawei is ne...

Apple is also messing around. Why is the iPhone 6 32GB a bad move?

Earlier this week, without any official publicity,...

Taobao Art Training Camp for Beginners

The Taobao art training camp for beginners will a...

Geek Time_Personal Wealth Course for Programmers

Geek Time: Programmer's Personal Wealth Cours...

How much does it cost to invest in Anshan Sports Mini Program?

How much does it cost to attract investment in An...