登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

BetterDribbble

[复制链接]
来自: 李世铿 分类: iOS精品源码 上传时间: 2016-6-6 15:36:29
Tag:客户端 动画

项目介绍:

Dribbble iOS 客户端弹性侧滑抽屉式菜单动画效果        github
1.gif

主要集成代码:
[Objective-C] 查看源文件 复制代码
#import "ViewController.h"
#import "BETHttCongifuration.h"

@interface ViewController ()<UIWebViewDelegate>
{
    CAShapeLayer *lineLayer;
}

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blueColor];
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)startURL:(id)sender
{
    NSString *urlString = [NSString stringWithFormat:@"%@?client_id=%@&scope=%@&redirect_uri=%@",
                           BETAuthorizeURL, BETClientID, BETOAuthScope, BETRedirectURL];
    NSURL *url = [NSURL URLWithString:urlString];
    
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }
}

- (void)handleEdgePanGesture:(UIScreenEdgePanGestureRecognizer *)gesture
{
    switch (gesture.state) {
        case UIGestureRecognizerStateBegan:
        {
            CGPoint beganPoint = [gesture locationInView:self.view];
            lineLayer.path = [self getLeftLinePathWithAmount:beganPoint.x withY:beganPoint.y];
        }
            
            break;
        case UIGestureRecognizerStateChanged:
        {
            CGPoint beganPoint = [gesture locationInView:self.view];
            lineLayer.path = [self getLeftLinePathWithAmount:beganPoint.x withY:beganPoint.y];
            break;
        }
        default:
            break;
    }
}

- (CGPathRef) getLeftLinePathWithAmount:(CGFloat)amount withY:(CGFloat)amountY {
    UIBezierPath *verticalLine = [UIBezierPath bezierPath];
    CGPoint topPoint = CGPointMake(0, 0);
    CGPoint midControlPoint = CGPointMake(amount, amountY);
    CGPoint bottomPoint = CGPointMake(0, self.view.bounds.size.height);
    
    [verticalLine moveToPoint:topPoint];
    [verticalLine addQuadCurveToPoint:bottomPoint controlPoint:midControlPoint];
    [verticalLine closePath];
    
    return [verticalLine CGPath];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
}

@end





DEMO下载:


相关源码推荐:

我来说两句
*滑动验证:
所有评论(49)
李伟鹏 2016-6-6 16:07:05
楼主威武啊,Code4App有你更给力!
回复
hsiangchou 2016-6-7 09:48:08
强烈支持楼主ing……
回复
王颖博 2016-6-7 10:41:02
感谢分享,Code4App有你更精彩
回复
stevee 2016-6-7 11:37:08
强烈支持楼主ing……
回复
EDCC 2016-6-7 19:33:39
楼主用心了,内容非常精彩。
回复
千雷引 2016-6-7 19:42:54
楼主用心了,内容非常精彩。
回复
jiushenghuo 2016-6-8 09:11:29
感谢分享,Code4App有你更精彩
回复
hunter858 2016-6-8 11:03:10
楼主威武啊,Code4App有你更给力!
回复
Reef 2016-6-8 17:53:58
我只是路过打酱油的。
回复
12345下一页
提取码:  下载次数:82 状态:已购或VIP 售价:0(原价:10)金钱 下载权限:初级码农 
2313 0 82
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| 广东互联网违法和不良信息举报中心|中国互联网举报中心|Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表