Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Improving Keyboard Appearance Synchronization

未关闭
#1,880 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
ios, swift
领域
mobile

调研方向

首先定位使用 delay(for: .milliseconds(200), scheduler: DispatchQueue.main) 的键盘处理代码。检查 keyboardWillShowNotification 和 keyboardDidShowNotification 的 userInfo 值,然后验证视图更新是否遵循报告的动画持续时间,并与键盘保持同步。

由索引模型根据 Issue 内容生成。

描述

feature request

Suggestion for Improvement:

Hi, I noticed that when the keyboard appears, the view shift has a noticeable delay. The current implementation uses delay(for: .milliseconds(200), scheduler: DispatchQueue.main), but a fixed 200ms delay is unreliable for the following reasons:

Keyboard animation duration is not fixed – The actual animation time varies across iOS versions, devices, and user settings (e.g., "Reduce Motion"). Using a hardcoded 200ms delay may cause desynchronization, leading to lag or visual inconsistencies.

Asynchronous execution may fluctuate – Since DispatchQueue.main might have other tasks running, the actual delay could be longer than expected due to main thread load, further impacting responsiveness.

Not in sync with keyboard events – iOS provides keyboardWillShowNotification and keyboardDidShowNotification, which include the actual animation duration and curve in userInfo[UIKeyboardAnimationDurationUserInfoKey]. Using these ensures smooth and synchronized UI updates rather than relying on an arbitrary delay.

I suggest listening to keyboardWillShowNotification and using the provided animation duration instead. This will help achieve a more consistent and fluid user experience.

Looking forward to your thoughts! Thanks for your great work on this library.

主要语言
Swift
星标
6.3k
派生
1.2k
平均合并
12 小时 4 分钟
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MessageKit/MessageKit 的其他 Issue

查看 MessageKit/MessageKit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。