From 4a838450830fc783bd1dd0cbc3795c6a97bf969c Mon Sep 17 00:00:00 2001 From: Taksh Date: Mon, 5 Oct 2026 16:16:05 +0530 Subject: [PATCH] feat: add NicknameClipboard helper for people-row copy One pasteboard write path for iOS and macOS so mesh and geohash menus do not duplicate UIKit/AppKit branches. --- bitchat/Utils/NicknameClipboard.swift | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bitchat/Utils/NicknameClipboard.swift diff --git a/bitchat/Utils/NicknameClipboard.swift b/bitchat/Utils/NicknameClipboard.swift new file mode 100644 index 00000000..88e94f48 --- /dev/null +++ b/bitchat/Utils/NicknameClipboard.swift @@ -0,0 +1,26 @@ +// +// NicknameClipboard.swift +// bitchat +// +// This is free and unencumbered software released into the public domain. +// For more information, see +// + +import Foundation +#if os(iOS) +import UIKit +#elseif os(macOS) +import AppKit +#endif + +/// Pasteboard writes for people-sheet nickname / display-name copy actions. +enum NicknameClipboard { + static func copy(_ string: String) { + #if os(iOS) + UIPasteboard.general.string = string + #elseif os(macOS) + NSPasteboard.general.clearContents() + NSPasteboard.general.setString(string, forType: .string) + #endif + } +}