Create a gist now

Instantly share code, notes, and snippets.

Restoring view controllers in a paged UI
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder {
[super encodeRestorableStateWithCoder:coder];
[coder encodeObject:self.firstViewController forKey:@"viewController1"];
[coder encodeObject:self.secondViewController forKey:@"viewController2"];
}
- (void)decodeRestorableStateWithCoder:(NSCoder *)coder {
[super decodeRestorableStateWithCoder:coder];
self.firstViewController = [coder decodeObjectForKey:@"viewController1"];
self.secondViewController = [coder decodeObjectForKey:@"viewController2"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment