Created
April 3, 2012 15:09
-
-
Save emarashliev/2292796 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)copyItems:(id)sender { | |
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; | |
NSMutableArray *items = [NSMutableArray arrayWithCapacity:_selectionView.selection.count]; | |
for (TTShapeModelObject *shp in _selectionView.selection) { | |
[item setObject:[NSKeyedArchiver archivedDataWithRootObject:shp] forKey:@"TTShapeModelObject"]; | |
[items addObject:item]; | |
} | |
pasteboard.items = items; | |
} | |
- (void)pasteItems:(id)sender { | |
CGPoint pos = _flags.contextMenuTouchPosition; | |
NSArray *items = [UIPasteboard generalPasteboard].items; | |
for (NSDictionary* itemDict in items) { | |
TTShapeModelObject *item = [NSKeyedUnarchiver unarchiveObjectWithData:[itemDict objectForKey:@"TTShapeModelObject"]]; | |
item.position = pos; | |
[self addShape:item]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment