CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2016 |
Maintained by Ezfen Zhang.
EZHeartForLike in Objective-C.
EZHeartForLike show the animation between two different view. As you can see in the following Pics, the Heart is generated in the UIImageView, and finally move to the UIView under.
EZHeartForLike 是点赞动画的实现,但是值得注意的是动画的执行位置,从下图可以看出,大桃心和小桃心所在的View是不同的View。因此解决动画的跨View实现才是EZHeartForLike的真正目的。具体实现的方式请看我的博文
而且这个动画也是萌萌哒,希望你喜欢,哈哈哈哈
You can install EZHeartForLike in a traditional way -- drag the EZHeartForLike/EZHeartForLike/Module/View/EZHeartForLike and EZHeartForLike/EZHeartForLike/Module/Resources into your project. However, it is strongly recommended that you install via CocoaPods.
你可以直接在 EZHeartForLike/EZHeartForLike/Module/View/EZHeartForLike文件夹中将EZHeartForLike的.h、.m和EZHeartForLike/EZHeartForLike/Module/Resources两张桃心图加入到项目中直接使用
Import the "EZHeartForLike.h" to your controller.
#import "EZHeartForLike.h"
Init the EZHeartForLike into your controller.
EZHeartForLike *heart = [[EZHeartForLike alloc] initWithFrame:CGRectMake(0, 0, 24, 24) DisplayBigHeartOnView:self.tweetImageView];
If you want to do something after invoking the EZHeartForLike, set up the delegate.
一般来说,需要在动画执行结束后完成相关操作,设置代理并实现相关方法。
heart.delegate = self;
创建的EZHeartForLike是右下角的小桃心(见图1)
指定的displayView是上图的ImageView,可实现双击(见图2)
If you want the EZHeartForLike to show your own image, just set the likeImage and the unlikeImage using follow function (nonessential):
如果你想使用自己的图片,就使用此方法设置(非必须):
[heart setLikeImage:[UIImage imageNamed:@"liked"] unLikeImage:[UIImage imageNamed:@"unlike"]];
add the EZHeartForLike to your view;
[self.view addSubview:heart];
enjoy. :)
-(void)tapLike;
You can do something anter the like animation done.
- (void)tapLike {
....
}
-(void)tapUnlike;
As "tapLike" function, you can do something after the unlike animation done;
- (void)tapUnlike {
....
}
1.0.1 修复快速点击会卡死的bug。
Open an issue
EZHeartForLike is available under the MIT license. See the LICENSE file for more info.