PerAppSampleApp-iOS
This sample app based on PerApp language feature provided by Apple for iOS 13 and above. This also contains state restoration feature. After changing app language from App Settings, app will relaunch and it preserves previous UI state.
State Restoration
- Storyboard: This is added in interface builder. In view controller's indentity inspector restoration identifier added same name as VC.
- Programmatically:
- Restoration Identifier: While creating VC programmatically, the restoration identifier should be given manually either while creating instance or in viewDidLoad life cycle method.
- Restoration Class: We need to provide restoration class.
- UIViewControllerRestoration: ViewController should implement 'UIViewControllerRestoration' method. For all the deatils see 'ProfileSettingsVC' class.
DemoVideo
![](https://private-user-images.githubusercontent.com/5211430/239064093-c720345a-f17d-4c8b-b116-c41d88ed9109.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDEyNzY0NDMsIm5iZiI6MTcwMTI3NjE0MywicGF0aCI6Ii81MjExNDMwLzIzOTA2NDA5My1jNzIwMzQ1YS1mMTdkLTRjOGItYjExNi1jNDFkODhlZDkxMDkuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQUlXTkpZQVg0Q1NWRUg1M0ElMkYyMDIzMTEyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyMzExMjlUMTY0MjIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDFkMzVmMTMzMzM5ZjkyOGI3NzM4ZTE2MzRmMjU2OTM0ODVmYjY2YWU2OTEwZTQ0NjlhZWYwZDdmMzY2YjAxMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.aM5t2br9DO_PcmPyAmN5L6aDo1Pw1eo0HrMmtaiSo2g)