Advertisement
sophtwhere

UIView+cloneSerialization.h

Oct 28th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  UIView+cloneSerialization.h
  3. //
  4. //  Created by Jonathan Annett on 9/10/13.
  5. //  Copyright (c) 2013 Sophtwhere. All rights reserved.
  6. //
  7.  
  8. #import <UIKit/UIKit.h>
  9.  
  10. @interface UIView (cloneSerialization)
  11.  
  12.  
  13.  
  14.  
  15. // returns the data needed to reserialize the view.
  16. -(NSData*) serializedData;
  17.  
  18. // instantiates a (generic) UIView object from the given serilzation data.
  19. + (UIView *) UIViewFromSerializedData:(NSData *)data;
  20.  
  21. // instantiates the derived class from previously serialized data.
  22. + (id) viewFromSerializedData:(NSData *)data;
  23.  
  24. //creates an on the fly copy of the view, as it is. (will be a generic UIView object)
  25. -(UIView*) cloneAsUIView ;
  26.  
  27. //creates an on the fly copy of the view, as it is. (will be the same class as instance you call it on)
  28. -(id) clone;
  29.  
  30. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement