Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSData *thumbData = UIImageJPEGRepresentation(thumbnail, 0.5);
- NSString *filePath = [[NSBundle mainBundle] pathForResource: @"gifFileName" ofType: @"gif"];
- NSData *gifData = [NSData dataWithContentsOfFile: filePath];
- NSString *pathForFile = [[NSBundle mainBundle] pathForResource: @"myGif" ofType: @"gif"];
- NSData *dataOfGif = [NSData dataWithContentsOfFile: pathForFile];
- NSLog(@"Data: %@", dataOfGif);
- UIImage *image = ...;
- NSData *data = [AnimatedGIFImageSerialization animatedGIFDataWithImage:image
- duration:1.0
- loopCount:1
- error:nil];
- let path = Bundle.main.path(forResource: "loader", ofType: "gif")!
- let data = try! Data(contentsOf: URL(fileURLWithPath: path))
- return data
Add Comment
Please, Sign In to add comment