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.
This commit is contained in:
Taksh 2026-10-05 16:16:05 +05:30
parent 5e9287fae1
commit 4a83845083

View File

@ -0,0 +1,26 @@
//
// NicknameClipboard.swift
// bitchat
//
// This is free and unencumbered software released into the public domain.
// For more information, see <https://unlicense.org>
//
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
}
}