I am making a basic quiz application.The choices are in the form of a table view. If the user moves to a previous question, I want to show him his previously selected choice. I have stored the choice in NSUserDefaults. How do I convert this int value to NSIndexpath and use it in my tableview?
See the NSINdexPath UIKit Additions
In your case you can use (Swift):
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
Swift 3.0:
let indexPath = IndexPath(row: 0, section: 0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With