欢迎光临
我们一直在努力

分享朋友圈封装(带动画)

建站超值云服务器,限时71元/月

分享朋友圈封装(带动画)

项目介绍:

自定义弹出视图,附带弹性动画效果,分享到朋友圈。本Demo采用代理协议传值的方式。相互学习。

主要分享代码:
[Objective-C] 查看源文件 复制代码

#import "ViewController.h"
#import "XFPublishView.h"
@interface ViewController ()<XFPublishViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIButton * btn =[UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 100,100, 40);
    [btn setTitle:@"分享" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(shareBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}

-(void)shareBtnClick
{
    XFPublishView *publishView = [[XFPublishView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    publishView.delegate = self;
    [publishView show ];
}
-(void)didSelectBtnWithBtnTag:(NSInteger)tag
{
    if (tag==1)
    {
        NSLog(@"111");
    }else if (tag==2)
    {
        NSLog(@"222");
    }else{
        NSLog(@"CLOSE");
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 分享朋友圈封装(带动画)
分享到: 更多 (0)