Long Press Whether the Edit menu appears (Cut Copy Paste)
-(BOOL) CollectionView: (Uicollectionview *) CollectionView Shouldshowmenuforitematindexpath: (NSIndexPath *) Indexpath
{
return YES;
}
-(BOOL) CollectionView: (Uicollectionview *) CollectionView canperformaction: (SEL) Action Foritematindexpath: ( Nsindexpath *) Indexpath Withsender: (ID) sender
{
NSString * Selname=nsstringfromselector (action);
Only copy will appear in the menu
if ([Selname isequaltostring:@ "copy:"]) {
return YES;
}
return NO;
}
-(void) CollectionView: (Uicollectionview *) CollectionView performaction: (SEL) Action Foritematindexpath: ( Nsindexpath *) Indexpath Withsender: (ID) sender
{
You can perform some copy and paste operations
Please see Uipasteboard for more details.
Click Copy to execute the method
NSString * Selname=nsstringfromselector (action);
NSLog (@ "%@", selname);
}
IOS Collection Long Press edit function