Skip to content

Instantly share code, notes, and snippets.

@pablasso
Created April 18, 2012 16:59
Show Gist options
  • Save pablasso/2415016 to your computer and use it in GitHub Desktop.
Save pablasso/2415016 to your computer and use it in GitHub Desktop.
Copy an UIView by archiving and unarchiving
NSData *archivedData = [NSKeyedArchiver archivedDataWithRootObject:originalView];
UIView *viewCopy = [NSKeyedUnarchiver unarchiveObjectWithData:archivedData];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment