-2
TWPhotoPickerController *photoPicker = [[TWPhotoPickerController alloc] init];
photoPicker.cropBlock = ^(UIImage *image) {
    //do something
};
[self presentViewController:photoPicker animated:YES completion:NULL];

Been stuck on this for way too long. I have imported all the correct header files into my bridging header file... just need to know how do I translate this block into swift syntax?

1 Answers1

2

It should be something like this:

var photoPicker = TWPhotoPickerController()
photoPicker.cropBlock = { (image: UIImage) -> () in
// do something
}    
presentViewController(photoPicker, animated: true, completion: nil)
Marius Fanu
  • 6,589
  • 1
  • 17
  • 19