marrioa marrioa - 1 year ago 245
iOS Question

Swift : Tap image to expand it like Facebook on tableviewcell

I want user to tap on image in a tableviewcell to expand it I tried
4 libraries on github didn't work well with autolayout.

Also I found but it is in objective-c and even doesn't works with Xcode 7 MHFacebookImageViewer.

enter image description here

also but in objective-c

Is there any library for swift?

Answer Source

For above this library if you want to use in swift you have to Add Bridging Header

AKImageViewer - for e.g i am taking little bit code from this library

var aKImageViewerViewController: AKImageViewerController = AKImageViewerViewController()
aKImageViewerViewController.image = UIImage.imageName("lion.png")
aKImageViewerViewController.imgCancel = UIImage.imageNamed("btn_cancel.png")
aKImageViewerViewController.centerPictureFromPoint(CGPointMake(0, 0), ofSize: CGSizeMake(30, 30), withCornerRadius: 1.0)

MHFacebookImageViewer - for e.g I am taking one method from this library you can use it in swift like

func setupImageViewer() {

   // Some code


func setupImageViewerWithCompletionOnOpen(open: MHFacebookImageViewerOpeningBlock, onClose close: MHFacebookImageViewerClosingBlock) {

  // Some code

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download