Monday, May 5, 2014

Changing Text Color of UICollectionViewCell on selection programmatically

Have to overwrite the setSelected method of UICollectionView Class. Don't forget to call super as well. 

-(void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    if (selected) {
       self.tagLabel.textColor=[UIColor blackColor];
    }
    else
        
     self.tagLabel.textColor=[UIColor lightTextColor];
    

}

No comments:

Post a Comment