Skip to content

Instantly share code, notes, and snippets.

@fumoboy007
fumoboy007 / AsyncImageView.swift
Created November 9, 2015 01:47
A UIImageView subclass that loads images from your app bundle completely off the main thread.
public class AsyncImageView: UIImageView {
private class ImageLoadOperation {
private(set) var isCancelled: Bool = false
func cancel() {
isCancelled = true
}
}
private var imageLoadOperation: ImageLoadOperation?
@ynechaev
ynechaev / gist:8123997
Last active June 9, 2017 23:18
UITableViewCell popular animation (flipping around Y axis, depending on scroll direction)
@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
UIImageOrientation scrollOrientation;
CGPoint lastPos;
}
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView.isDragging) {
UIView *myView = cell.contentView;
CALayer *layer = myView.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;