Okay, so I am only able to scroll outside the borders of the UIImageViews, but I need to be able to scroll on top of those views. The UIImageView contains Pan Gestures, Pinch Gestures, and I am unsure if that is causing the error. I will paste my cell code below:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
imageIndex = indexPath.row
var cell : XpandDraggableCell = tableView.dequeueReusableCellWithIdentifier("XpandDraggableCell", forIndexPath: indexPath) as! XpandDraggableCell
cell.imgview.backgroundColor = UIColor(red: 210, green: 211, blue: 213, alpha: 1.0)
if (horizontal) {
defaultX = defaultSpacingX * imageIndex; /* E.g 70 * 2 = 140 from origin X. */
}else{
defaultY = defaultSpacingY * imageIndex; /* E.g 70 * 2 = 140 from origin Y. */
}
cell.imgview.frame = CGRect(x: cell.imgview.frame.origin.x, y: cell.imgview.frame.origin.y, width: 75.0, height: 75.0)
var cellWidth : CGFloat = cell.contentView.frame.width
var cellHeight : CGFloat = cell.contentView.frame.height
cell.imgview.center = CGPoint(x: cell.contentView.frame.origin.x + (cellWidth / 2), y: cell.contentView.frame.origin.y + (cellHeight / 2))
cell.imgview.image = UIImage(named: images[imageIndex]) /*Image provided*/
cell.imgview.contentMode = UIViewContentMode.ScaleAspectFit
cell.imgview.userInteractionEnabled = true
cell.imgview.tag = imageIndex
var addToViewPanGesture : UIPanGestureRecognizer = UIPanGestureRecognizer(target: self, action: Selector("imageViewPanned:"))
cell.imgview.addGestureRecognizer(addToViewPanGesture)
var doubleTapAddGesture : UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: Selector("cellDoubleTapped:"))
doubleTapAddGesture.numberOfTapsRequired = 2
cell.imgview.addGestureRecognizer(doubleTapAddGesture)
cell.imgview.backgroundColor = UIColor.clearColor()
cell.imgview.layer.backgroundColor = UIColor.clearColor().CGColor
cell.imgviewbtn.backgroundColor = UIColor.clearColor()
cell.backgroundColor = UIColor(red: 210, green: 211, blue: 213, alpha: 1.0)
return cell
}
class XpandDraggableCell : UITableViewCell{
@IBOutlet var imgviewbtn: UIButton!
@IBOutlet var imgview: UIImageView!
}