Swift: UICollectionViewCell didSelectItemAtIndexPath Change backgroundColor

前端 未结 4 1033
傲寒
傲寒 2021-02-09 15:39

I\'m easily able to change the background color of a cell in the CellForItemAtIndexPath method

func collectionView(collectionView: UICollectionView,         


        
4条回答
  •  暖寄归人
    2021-02-09 16:16

    cell.backgroundColor = UIColor.redColor()
    
    let startTime = DateUtils.getDispatchTimeByDate(NSDate(timeIntervalSinceNow: 0.1))
    dispatch_after(startTime, dispatch_get_main_queue()) {[weak self] in
        //there is the code redirect to other viewcontroller
        openOtherVC()
    }
    

提交回复
热议问题