Guest User

Untitled

a guest
Mar 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. NSData *thumbData = UIImageJPEGRepresentation(thumbnail, 0.5);
  2.  
  3. NSString *filePath = [[NSBundle mainBundle] pathForResource: @"gifFileName" ofType: @"gif"];
  4.  
  5. NSData *gifData = [NSData dataWithContentsOfFile: filePath];
  6.  
  7. NSString *pathForFile = [[NSBundle mainBundle] pathForResource: @"myGif" ofType: @"gif"];
  8.  
  9. NSData *dataOfGif = [NSData dataWithContentsOfFile: pathForFile];
  10.  
  11. NSLog(@"Data: %@", dataOfGif);
  12.  
  13. UIImage *image = ...;
  14. NSData *data = [AnimatedGIFImageSerialization animatedGIFDataWithImage:image
  15. duration:1.0
  16. loopCount:1
  17. error:nil];
  18.  
  19. let path = Bundle.main.path(forResource: "loader", ofType: "gif")!
  20. let data = try! Data(contentsOf: URL(fileURLWithPath: path))
  21. return data
Add Comment
Please, Sign In to add comment