iOS 粒子效果点赞按钮,几行代码即可实现

PZXPraiseButton

下载地址:https://github.com/PZXforXcode/PZXPraiseButton
一款用粒子效果做的点赞按钮。使用方便

效果图

点击效果

效果图

//首先import项目
#import "PZXPraiseButton.h"

    PZXPraiseButton *button = [[PZXPraiseButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
    button.center = self.view.center;
    [button setImage:[UIImage imageNamed:@"桃心-3"] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:@"桃心-2"] forState:UIControlStateSelected];
    [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];

你可能感兴趣的:(iOS 粒子效果点赞按钮,几行代码即可实现)