UIView-Copy icon indicating copy to clipboard operation
UIView-Copy copied to clipboard

Adding a copy method to UIView.

UIView+Copy

Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

#import <UIView+Copy/UIView+PMCopy.h>

//If you need drawRect: drawing
UIView *copiedView = [originalView pm_copy];

//if you need mask layer property
UIView *copiedViewWithDrawRect = (UIView *)[originalView pm_copyWithNeedsDrawRect:YES];

//copy using the snapshot api. iOS 7 only
UIView *copiedViewFromSnapshot = (UIView *)[originalView pm_copyToImage];

Requirements

iOS 6.0+ and ARC. 

Installation

UIView+Copy is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UIView+Copy"

Author

pierremarcairoldi, [email protected]

License

UIView+Copy is available under the MIT license. See the LICENSE file for more info.