Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //based on http://stackoverflow.com/a/24402451/1447641
- func imagePickerController(picker: UIImagePickerController!, didFinishPickingImage image: UIImage!, editingInfo: NSDictionary!){
- println("i've got an image");
- self.mPhotoView.image = image
- picker.dismissViewControllerAnimated(true, completion: nil)
- }
- @IBAction func takePhoto(sender: AnyObject) {
- if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera){
- println("Button capture")
- var imag = UIImagePickerController()
- imag.delegate = self
- imag.sourceType = .Camera;
- imag.mediaTypes = NSArray(object: kUTTypeImage)
- imag.allowsEditing = false
- self.presentViewController(imag, animated: true, completion: nil)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement