mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 00:21:12 +00:00
Added recent stickers clearing Added sending logs via email Added forward recipient change on forward acccessory panel tap Tweaked undo panel design Various UI fixes
18 lines
681 B
Swift
18 lines
681 B
Swift
import Foundation
|
|
import UIKit
|
|
import MobileCoreServices
|
|
|
|
public extension UIPasteboard {
|
|
public func set(attributedString: NSAttributedString?) {
|
|
guard let attributedString = attributedString else {
|
|
return
|
|
}
|
|
do {
|
|
let rtf = try attributedString.data(from: NSMakeRange(0, attributedString.length), documentAttributes: [NSAttributedString.DocumentAttributeKey.documentType: NSAttributedString.DocumentType.rtf])
|
|
self.items = [[kUTTypeRTF as String: NSString(data: rtf, encoding: String.Encoding.utf8.rawValue)!, kUTTypeUTF8PlainText as String: attributedString.string]]
|
|
} catch {
|
|
|
|
}
|
|
}
|
|
}
|