기본적으로 UIPasteboard 어플리케이션에서 공유해서 사용이 가능하다. 몇가지 사용방법을 소개하자면..
UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard];appPasteBoard.persistent = YES;[appPasteBoard setString:@"STRING TO COPY"];UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard];yourTextField.text = [appPasteBoard string];UIPasteboard *appPasteBoard = [UIPasteboard pasteboardWithName:@"CopyPaste" create:YES];appPasteBoard.persistent = YES;NSData *data = UIImagePNGRepresentation([UIImage imageNamed:@"COPIED.jpg"]);[appPasteBoard setData:data forPasteboardType:@"com.yourCompany.yourApp.yourType"];
UIPasteboard *appPasteBoard = [UIPasteboard pasteboardWithName:@"CopyPaste" create:YES];NSData *data = [appPasteBoard dataForPasteboardType:@"com.yourCompany.yourApp.yourType"];imageView.image = [UIImage imageWithData:data];
'Development > IOS & Mac' 카테고리의 다른 글
UITableView Cell Moving Control (0) | 2015.07.20 |
---|---|
인터페이스 빌드에서 커스텀 값 조정 가능하게 만들기 (0) | 2015.06.24 |
LLDB Quick Start Guide (0) | 2015.05.06 |
Particle 효과 (CAEmitterLayer, CAEmitterCell) (0) | 2015.04.29 |
iOS Touch ID Login (0) | 2015.04.10 |