Commit 1b69e6037a98c382f5f0f2ad7da4abd950e89f59

Authored by bryan ago
1 parent a6c1f3972d
Exists in master

remove unnecessary lines

Showing 1 changed file with 0 additions and 4 deletions Inline Diff

AnimatedWebpExample/ViewController.m View file @ 1b69e60
// 1 1 //
// ViewController.m 2 2 // ViewController.m
// AnimatedWebpExample 3 3 // AnimatedWebpExample
// 4 4 //
// Created by DongSoo Lee on 2015. 12. 4.. 5 5 // Created by DongSoo Lee on 2015. 12. 4..
// Copyright © 2015년 DongSoo Lee. All rights reserved. 6 6 // Copyright © 2015년 DongSoo Lee. All rights reserved.
// 7 7 //
8 8
#import "ViewController.h" 9 9 #import "ViewController.h"
#import "UIImage+animatedGIF.m" 10 10 #import "UIImage+animatedGIF.m"
11 11
@interface ViewController () 12 12 @interface ViewController ()
13 13
@end 14 14 @end
15 15
@implementation ViewController 16 16 @implementation ViewController
17 17
- (void)viewDidLoad { 18 18 - (void)viewDidLoad {
[super viewDidLoad]; 19 19 [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. 20 20 // Do any additional setup after loading the view, typically from a nib.
21 21
UIImage *image = [YYImage imageNamed:@"500_1562701_1441589347.webp"]; 22 22 UIImage *image = [YYImage imageNamed:@"500_1562701_1441589347.webp"];
// NSString *retinaPath = [[NSBundle mainBundle] pathForResource:@"500_1562701_1441589347" ofType:@"gif"]; 23 23 // NSString *retinaPath = [[NSBundle mainBundle] pathForResource:@"500_1562701_1441589347" ofType:@"gif"];
// NSData *data = [NSData dataWithContentsOfFile:retinaPath]; 24 24 // NSData *data = [NSData dataWithContentsOfFile:retinaPath];
// UIImage *image = [UIImage animatedImageWithAnimatedGIFData:data]; 25 25 // UIImage *image = [UIImage animatedImageWithAnimatedGIFData:data];
26 26
self.imageView = [[YYAnimatedImageView alloc] initWithImage:image]; 27 27 self.imageView = [[YYAnimatedImageView alloc] initWithImage:image];
self.imageView.frame = CGRectMake(self.imageView.frame.origin.x 28 28 self.imageView.frame = CGRectMake(self.imageView.frame.origin.x
, self.imageView.frame.origin.y 29 29 , self.imageView.frame.origin.y
, self.view.bounds.size.width 30 30 , self.view.bounds.size.width
, self.view.bounds.size.width * self.imageView.frame.size.width / self.imageView.frame.size.height); 31 31 , self.view.bounds.size.width * self.imageView.frame.size.width / self.imageView.frame.size.height);
self.imageView.contentMode = UIViewContentModeScaleAspectFit; 32 32 self.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.imageView.clipsToBounds = YES; 33 33 self.imageView.clipsToBounds = YES;
[self.imageView setImage:image]; 34
[self.imageView startAnimating]; 35
[self.imageView.layer setBorderColor:[[UIColor yellowColor] CGColor]]; 36 34 [self.imageView.layer setBorderColor:[[UIColor yellowColor] CGColor]];
[self.imageView.layer setBorderWidth:1]; 37 35 [self.imageView.layer setBorderWidth:1];
[self.view addSubview:self.imageView]; 38 36 [self.view addSubview:self.imageView];
39 37
UIImage *image2 = [YYImage imageNamed:@"500_1562701_1441589347.gif"]; 40 38 UIImage *image2 = [YYImage imageNamed:@"500_1562701_1441589347.gif"];
41 39
self.imageView2 = [[YYAnimatedImageView alloc] initWithImage:image2]; 42 40 self.imageView2 = [[YYAnimatedImageView alloc] initWithImage:image2];
self.imageView2.frame = CGRectMake(self.imageView2.frame.origin.x 43 41 self.imageView2.frame = CGRectMake(self.imageView2.frame.origin.x
, self.imageView.frame.origin.y + self.imageView.frame.size.height 44 42 , self.imageView.frame.origin.y + self.imageView.frame.size.height
, self.view.bounds.size.width 45 43 , self.view.bounds.size.width
, self.view.bounds.size.width * self.imageView2.frame.size.width / self.imageView2.frame.size.height); 46 44 , self.view.bounds.size.width * self.imageView2.frame.size.width / self.imageView2.frame.size.height);
self.imageView2.contentMode = UIViewContentModeScaleAspectFit; 47 45 self.imageView2.contentMode = UIViewContentModeScaleAspectFit;
self.imageView2.clipsToBounds = YES; 48 46 self.imageView2.clipsToBounds = YES;