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

What do bidding promoters need to do every day? How to do bidding promotion?

For many friends who have just entered the biddin...

iPad air 2 is coming: is the gravedigger of notebooks coming?

Recently, there have been media reports that acco...

Weibo Marketing: 3 tips to help you follow the hot topics on Weibo!

Whether you can capture Weibo hot spots in time i...

Rare! New discovery in Hoh Xil

Hoh Xil, located on the Qinghai-Tibet Plateau, is...

5 tips for running promotional events!

Usually when it comes to operational activities, ...

Revealing the secret of Toutiao’s user growth!

Toutiao has always been criticized for its vulgar...

Is it really true that the more search terms an APP covers, the better?

From some statistical systems, you can see the nu...

Douyin Training Camp Project Practice (Operation)

As the pressure of employment competition becomes...