效果
使用方法
1.匯入標頭檔案
#import "AddShoppingCartAnimationTool.h"
複製程式碼
2.呼叫startAnimationand...方法
[[AddShoppingCartAnimationTool shareTool] startAnimationandFromView:self.addShoppingCart toView:self.shoppingCartBtn imgView:self.imgView];
複製程式碼
/**
開始動畫
@param fromView 開始view(加入購物車按鈕)
@param toView 結束view(購物車view)
@param imgView 商品圖片view
*/
- (void)startAnimationandFromView:(UIView *)fromView toView:(UIView *)toView imgView:(UIView *)imgView;
複製程式碼
github地址,AddShoppingCartAnimationTool.m中有註釋。