What are the differences between Restoration ID and identifier to a UITableViewCell that set in storyboard

怎甘沉沦 提交于 2019-12-21 03:09:07

问题


When I drag a UITableViewCell to a tableView in storyboard, I find there are two ID to be set in the inspector. One is in the Identity Inspector(Restoration ID) and the other is in Attributes Inspector(identity).

What's the difference between them?


回答1:


Restoration IDs are used for state restoration, i.e. making your view look like it did when you quit the app-often used for re-creating objects. Storyboard IDs, on the other hand, simply identify objects on the storyboard-these are often used for creating objects.




回答2:


A restoration identifier is a string that you need to assign to any view controller or view that you want preserved and restored. During state preservation any view controllers or views in the view hierarchy that have a restoration identifier will be saved to disk.

The Identity in the Identity Inspector, are used to instantiate objects from Storyboard



来源:https://stackoverflow.com/questions/37107972/what-are-the-differences-between-restoration-id-and-identifier-to-a-uitableviewc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!