// Mark: -UIViewController: UINavigationControllerDelegate extension UIViewController: UINavigationControllerDelegate {} // Mark: -UIViewController: UIImagePickerControllerDelegate extension UIViewController: UIImagePickerControllerDelegate { public func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]){ let mediaType = info[UIImagePickerControllerMediaType] as! String if mediaType == kUTTypeMovie as String { let videoURL = info[UIImagePickerControllerMediaURL] as! NSURL } } public func imagePickerControllerDidCancel(picker: UIImagePickerController){ dismissViewControllerAnimated(true, completion: nil) } }
Display a GIF in a UIImage
#import "WelcomViewController.h" #import "UIViewController+Record.h" @interface WelcomeviewController() @property (nonatomic) NSURL *squareURL; @end @implementation WelcomeviewController - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; Gif *firstLaunchGif = [[Gif alloc] initWithName:@"tinaFeyHiFive"]; self.defaultGifImageView.image = firstLaunchGif.gifImage; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WelcomeViewSeen"]; } @end
WelcomeViewController
import UIKit class WelcomViewController: UIViewController { @IBOutlet weak var gifImageView: UIImageView! override func viewWillAppear(animated: Bool){ // Return an animated UIImage } override func viewDidLoad(){ super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning(){ super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }