We have CollectionView -> ViewController. In VC, we have a button that displays a picture that I saved via NSUserDefaults (as the correct answer). Of course, we have that in VC, the image stored in memory will pop up in each clicked cell: as it is in ViewDidLoad ()
let imgData1 = defaults.objectForKey("image2") as? NSData if imgData1 != nil { StarTextField.hidden = false TextFieldButton.hidden = true let image = UIImage(data: imgData1!) print("Star is Here") } else { print("Star not Here") } Well, finally, the Question itself. How to make sure that not every cell has a saved picture, but where was the check passed?
The issue is resolved, almost))) By adding extra. parameter in the dictionary with the Bool value and its insertion to the comparison. Now I think how to change the Bool parameter in the dictionary.
ViewControlleror inCollectionView? - VAndrJ