티스토리 뷰
반응형
문자열만 복사
UIPasteboard.general.string = "복사할 문자열"
이미지만 복사
UIPasteboard.general.image = UIImage(systemName: "photo")
문자열과 이미지 같이 복사
import UniformTypeIdentifiers
if let imageData = UIImage(systemName: "photo")?.pngData() {
let pasteboard = [
[UTType.utf8PlainText.identifier : "복사할 문자열"],
[UTType.png.identifier : imageData],
]
UIPasteboard.general.setItems(pasteboard)
}
iOS Swift Xcode SwiftUI Objective-C Combine RxSwift
Copy
Paste
Clipboard
UIPasteboard
사진 Image 텍스트 Text 함께 클립보드 복사 붙여넣기
반응형
'iOS Swift + UIKit' 카테고리의 다른 글
iOS Swift 배열 개수 자르기 Array Slice (0) | 2023.06.03 |
---|---|
iOS Swift 사용자 정의 연산자 Custom Operator (0) | 2023.01.01 |
원티드 프리온보딩 iOS 챌린지 1차 (Wanted Free Onboarding iOS Challenge) (0) | 2022.11.16 |
iOS Swift URLSession (Alamofire 없이 http 통신) (0) | 2022.10.01 |
iOS Swift UISheetPresentationController.Detent (하프 모달 Half screen size custom modal drag bottom sheet present) (3) | 2022.09.01 |
댓글