Skip to content

Conversation

@CocoaBob
Copy link
Contributor

What does this implement/fix? Explain your changes.

MessageKit shows timestamps when showMessageTimestampOnSwipeLeft = true, but I notice a bug that timestamp label layout is wrong when app isn't in fullscreen or is using UISplitViewController. So actually if we run the built-in Example project in iPad simulator, since it uses UISplitViewController, we can easily find this issue (screenshots below).

The fix is easy, just replace UIScreen.main.bounds.width + paddingLeft with self.frame.maxX + paddingLeft. Because the timestamp labels are relatively positioned to the MessageContentCell, not the screen.

Does this close any currently open issues?

No, I didn't find any related discussion.

Any relevant logs, error output, etc?

No, only UI layout

Any other comments?

No

Where has this been tested?

Devices/Simulators: Both simulator and real devices (iPad Pro 11-inch 2018)

iOS Version: iOS 17.5

Swift Version: Swift 5

MessageKit Version: v4.2.0

Screenshots before & after

Simulator Screenshot - iPad (10th generation) - 2024-07-30 at 18 55 26

Simulator Screenshot - iPad (10th generation) - 2024-07-30 at 18 49 53

@Kaspik Kaspik enabled auto-merge August 22, 2024 23:41
@Kaspik Kaspik merged commit cac86a9 into MessageKit:main Sep 10, 2024
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

Successfully merging this pull request may close these issues.

2 participants