Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- if indexPath.row + 1 < EnabledID {
- cell.backgroundView = UIImageView(image: UIImage(named: "CorrectMark"))
- cell.isUserInteractionEnabled = false
- cell.cellLabel.text = ""
- QV.score += 2
- QV.lblScoreCoins.text = String(score)
- UserDefaults.standard.set(lblScoreCoins.text, forKey: "Key")
- UserDefaults.standard.synchronize()
- lblScoreCoins.text = UserDefaults.standard.string(forKey: "Key")
- }
- return cell
- }
- func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
- let QV : QuestionView = self.storyboard?.instantiateViewController(withIdentifier: "QuestionView") as! QuestionView
- QV.idFromCollection = indexPath.row + 1
- self.present(QV, animated: true, completion: nil)
- QV.lblScoreCoins.text = UserDefaults.standard.string(forKey: "Key")
- }
Add Comment
Please, Sign In to add comment