Commit 45735a06d079c61cd4acf32cc0e0c3a3cf0cb15a

Authored by bryan ago
1 parent 5eacb235c6
Exists in master

add another image view to check the performance

Showing 1 changed file with 18 additions and 1 deletions Side-by-side Diff

APNGExample/ViewController.swift View file @ 45735a0
... ... @@ -21,12 +21,29 @@
21 21 imageView.frame = CGRectMake(imageView.frame.origin.x
22 22 , imageView.frame.origin.y
23 23 , self.view.bounds.size.width
24   - , self.view.bounds.size.width * imageView.frame.size.width / imageView.frame.size.height);
  24 + , 210);
25 25 imageView.contentMode = .ScaleAspectFit
26 26 imageView.clipsToBounds = true;
  27 + imageView.layer.borderColor = UIColor.yellowColor().CGColor
  28 + imageView.layer.borderWidth = 1
27 29 view.addSubview(imageView)
28 30  
29 31 imageView.startAnimating()
  32 +
  33 + let image2:APNGImage = APNGImage(named: "500_1562701_1441589347.apng")!
  34 +
  35 + let imageView2: APNGImageView = APNGImageView(image: image2)
  36 + imageView2.frame = CGRectMake(imageView2.frame.origin.x
  37 + , imageView.frame.origin.y + imageView.frame.size.height
  38 + , self.view.bounds.size.width
  39 + , self.view.bounds.size.width * imageView2.frame.size.width / imageView2.frame.size.height);
  40 + imageView2.contentMode = .ScaleAspectFit
  41 + imageView2.clipsToBounds = true;
  42 + imageView2.layer.borderColor = UIColor.blueColor().CGColor
  43 + imageView2.layer.borderWidth = 1
  44 + view.addSubview(imageView2)
  45 +
  46 + imageView2.startAnimating()
30 47 }
31 48  
32 49 override func didReceiveMemoryWarning() {