Initial commit

This commit is contained in:
ifish
2017-08-15 16:59:01 +08:00
commit bdc83e07ef
5766 changed files with 423223 additions and 0 deletions
@@ -0,0 +1,15 @@
//
// IfishLevelUpView.h
// CollectionViewTest
//
// Created by imac on 17/3/3.
// Copyright © 2017年 xiang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishLevelUpView : UIView
@property (nonatomic,strong) NSString *imgName;
@end
@@ -0,0 +1,66 @@
//
// IfishLevelUpView.m
// CollectionViewTest
//
// Created by imac on 17/3/3.
// Copyright © 2017年 xiang. All rights reserved.
//
#import "IfishLevelUpView.h"
@interface IfishLevelUpView()
@property (nonatomic,strong) UIImageView *leveUpImageView;
@end
@implementation IfishLevelUpView
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor clearColor];
[self creatlevelUpImg];
UIView *holdView =[[UIView alloc] initWithFrame:frame];
holdView.backgroundColor = [UIColor blackColor];
holdView.alpha = 0.6;
[self addSubview:holdView];
[self bringSubviewToFront:self.leveUpImageView];
}
return self;
}
-(void)setImgName:(NSString *)imgName
{
self.leveUpImageView.image = [UIImage imageNamed:imgName];
}
-(void)creatlevelUpImg{
self.leveUpImageView = [[UIImageView alloc] init ];
[self addSubview:self.leveUpImageView];
[UIView animateWithDuration:0.36 delay:0 usingSpringWithDamping:25 initialSpringVelocity:20 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.leveUpImageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.width * 1.19);
} completion:^(BOOL finished){
}];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
self.leveUpImageView.userInteractionEnabled = YES;
[self.leveUpImageView addGestureRecognizer:tap];
}
-(void)dismissSelfViewTap{
__weak typeof (self)weakSelf = self;
[UIView animateWithDuration:0.36 delay:0 usingSpringWithDamping:25 initialSpringVelocity:20 options:UIViewAnimationOptionCurveEaseOut animations:^{
weakSelf.leveUpImageView.frame = CGRectMake(0, 0, 0, 0);
} completion:^(BOOL finished) {
[weakSelf removeFromSuperview];
}];
}
@end