Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPad机型上隔空接力粘贴板,一直弹出 xxx粘贴字xxx #591

Open
zhengshengxi opened this issue Jan 6, 2022 · 7 comments
Open

Comments

@zhengshengxi
Copy link

iPad机型上隔空接力粘贴板,一直弹出 xxx粘贴字xxx。有遇到这个问题的嘛

@huangyuding
Copy link

huangyuding commented Jan 6, 2022 via email

@Svyanto
Copy link

Svyanto commented Jan 6, 2022 via email

@zhengshengxi
Copy link
Author

原因是这个方法
/// Returns whether the text view can paste data from pastboard.

  • (BOOL)_isPasteboardContainsValidValue {
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    if (pasteboard.string.length > 0) {
    return YES;
    }
    if (pasteboard.yy_AttributedString.length > 0) {
    if (_allowsPasteAttributedString) {
    return YES;
    }
    }
    if (pasteboard.image || pasteboard.yy_ImageData.length > 0) {
    if (_allowsPasteImage) {
    return YES;
    }
    }
    return NO;
    }
    一直读取剪贴板

@wxwlcp
Copy link

wxwlcp commented Aug 4, 2022

解决了吗

@Svyanto
Copy link

Svyanto commented Aug 4, 2022 via email

@NBXXF
Copy link

NBXXF commented Nov 7, 2022

本质是 读取粘贴板多次 其实可以通过粘贴板的版本号来判断,将内容放到一个变量上 不要每次都读取,读取时候先判断版本号是否一样 才来读取 就解决问题了 api参考 pasteboard.changeCount

@Svyanto
Copy link

Svyanto commented Nov 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants