override func encodeRestorableState(with coder: NSCoder) {
coder.encode(selectedSuperheroId.rawValue, forKey: "imageId")
super.encodeRestorableState(with: coder)
}
This function in the sample app attached saves the id.
override func encodeRestorableState(with coder: NSCoder) {
coder.encode(selectedSuperheroId.rawValue, forKey: "imageId")
super.encodeRestorableState(with: coder)
}
This function in the sample app attached saves the id.
--
Software Developer(iOS), Speaker & Writer at Swift India
Love podcasts or audiobooks? Learn on the go with our new app.