Like button animation similar to Zhihu

Like button animation similar to Zhihu

Source code introduction:

NumberScrollAnimatedView.swift This file encapsulates the animation effect similar to the counter and can be used separately.

The ZanButton.swift file encapsulates the entire like animation process. Just find a UIView and set it to this class.

For details, please see the project's comments and examples.

PS PopView with arrows has not been implemented yet, it should not be difficult. I will continue to improve it next time

Source code effect:

Source code snippet:

  1. <br>
  2. <br>
  3. /**<br>
  4. * Set the like action<br>
  5. */ <br>
  6. zanView.zanAction = {(zhanNumber)->Void in<br>
  7. self.label.text = "(zhanNumber)" <br>
  8. self.label.textColor = UIColor(red: 0.098 , green: 0.565 , blue: 0.827 , alpha: 1 )<br>
  9. }<br>
  10. <br>
  11. /**<br>
  12. * Set the action to cancel the like<br>
  13. */ <br>
  14. zanView.unzanAction = {(zhanNumber)->Void in<br>
  15. self.label.text = "(zhanNumber)" <br>
  16. self.label.textColor = UIColor.blackColor()<br>
  17. }<br>
  18. <br>
  19. //Set the initial value<br>  
  20. zanView.initNumber = 5 <br>
  21. <br>

Download address: http://download..com/data/2070284

<<:  Material Design: Flat but not level

>>:  A brief analysis of the conspiracy theory behind the App Store's 1 Yuan selection

Recommend

How to formulate SEM bidding promotion strategy?

The same applies to SEM bidding. Don’t use dilige...

High-conversion live broadcast script design!

Recently, many anchors have been asking me what t...

From 0 to 1, how to plan your own promotion channels?

As a newbie in the operation circle, I still don’...

Operation strategy after publishing Xiaohongshu notes

What is the general process for us to publish not...

China, a karst country

Karst landforms are widely distributed in the wor...

4 Things I Learned Developing My First Swift App

My app development project this summer is Instant...

Those practical skills for APP operation and promotion are worth collecting!

Regarding the operation and promotion of APP, the...

In the mobile era, the opportunity for community 3.0 has arrived

The ancients said that things never happen in thr...