gpt4 book ai didi

ios - UIPasteboard – 设置复制的文本过期

转载 作者:行者123 更新时间:2023-11-28 06:06:37 25 4
gpt4 key购买 nike

我有一个字符串要放入 UIPasteboard 中,它应该在 2 分钟后过期

UIPasteboard.general.setObjects(objects: [NSItemProviderWriting],
localOnly: true,
expirationDate: Date().addingTimeInterval(120))

objects 键的值应该是多少?

最佳答案

你可以 UIPasteboard.general.setItems

        let expireDate = Date().addingTimeInterval(TimeInterval(120))

UIPasteboard.general.setItems([[UIPasteboard.typeAutomatic: value]],
options: [UIPasteboard.OptionsKey.expirationDate: expireDate])

关于ios - UIPasteboard – 设置复制的文本过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48025390/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com