4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Swift】クリップボードに文字列をコピーする

Posted at

##やりたいこと

iOSアプリからクリップボードに文字列をコピーする。
アプリ開発していると時折必要となる要件かと思います。

##実装方法

実装方法は非常に簡単です。1行でできます。ライブラリのインポートも必要はありません。

copy2clipboard.swift
UIPasteboard.general.string = "コピーしたい文字列"

##動作確認環境
Xcode: 11.7
iOS: 13.7
Swiftバージョン: Swift5

以上

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?