fileURL = ... let source = CGImageSourceCreateWithURL( fileURL as CFURL, nil ) let count = CGImageSourceGetCount(gifSource) var images: [UIImage] = [] for index in 0..<count { let cgImage = CGImageSourceCreateImageAtIndex( source, index, nil ) images.append(UIImage(cgImage: cgImage)) } 16
observe, participate in, and affect the UI update process. // Update y every frame. let updateLink = UIUpdateLink(view: view) updateLink.addAction { link, info in // Code that runs each UI update, after processing input events, // but before `CADisplayLink` callbacks. self.view.center.y = sin(info.modelTime) * 100 + self.view.bounds.midY } 34