abiaad/PASImageView

can not trigger collectionView() as a collectionViewCell

TangSirOnGit opened this issue · 1 comments

Hi, I used PASImageView to load image for the collectionViewCell as below:

override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath:      NSIndexPath) -> UICollectionViewCell{
.......

var imageView = PASImageView(frame: CGRectMake(0, 0, 100, 136))
    //imageView.center = CGPointMake(cell.bounds.width / 2, cell.bounds.height / 2)

    imageView.backgroundProgressColor(UIColor.whiteColor())
    imageView.progressColor(UIColor.redColor())
    cell.addSubview(imageView)

    if let anURL = NSURL(string: EPGServices.PicServer + item.Icon1) {
        imageView.imageURL(anURL)
    }
    return cell
}

the imageView work well. but when I click the image on the collectionViewCell, it can not trigger the function

override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath).

it come the result that I can't switch to another viewController when I click the collectionViewCell.

Can you help me to look at this?

Thanks a lot.

ADD:
I changed these functions in PASImageView.swift(change all radius to 0):

override func layoutSubviews() {
    self.layer.cornerRadius = 0.0//self.bounds.width/2.0
    progressContainer.layer.cornerRadius = 0.0//self.bounds.width/2.0
    containerImageView.layer.cornerRadius = 0.0//self.bounds.width/2.0

    updatePaths()
}

func updatePaths() {
    let arcCenter   = CGPoint(x: CGRectGetMidX(self.bounds), y: CGRectGetMidY(self.bounds))
    let radius      =  0.0//Float(min(CGRectGetMidX(self.bounds) - 1, CGRectGetMidY(self.bounds)-1))
    let circlePath = UIBezierPath(arcCenter: arcCenter,
        radius: CGFloat(radius),
        startAngle: CGFloat(-rad(Float(90))),
        endAngle: CGFloat(rad(360-90)),
        clockwise: true)

    backgroundLayer.path           = circlePath.CGPath
    progressLayer.path             = backgroundLayer.path

}

Old. Re-open if needed. Thx