Merge pull request #239 from MessageKit/ar/equal

Fix MediaMessageCell’s off center play button
This commit is contained in:
Andrew Robinson
2017-10-05 21:49:41 -05:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -55,6 +55,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
- `scrollIndicatorInsets` to match the insets of the `MessagesCollectionView`.
[#174](https://github.com/MessageKit/MessageKit/pull/174) by [@etoledom](https://github.com/etoledom).
- `MediaMessageCell` had an offset `PlayButtonView` that was being constrained to the cell and not the message container.
[#239](https://github.com/MessageKit/MessageKit/pull/239) by [@SirArkimedes](https://github.com/SirArkimedes).
### Changed
- **Breaking Change** `snapshotOptionsForLocation` method is now part of `LocationMessageDisplayDelegate`.
+2 -2
View File
@@ -40,8 +40,8 @@ open class MediaMessageCell: MessageCollectionViewCell<UIImageView> {
private func setupConstraints() {
playButtonView.translatesAutoresizingMaskIntoConstraints = false
let centerX = playButtonView.centerXAnchor.constraint(equalTo: centerXAnchor)
let centerY = playButtonView.centerYAnchor.constraint(equalTo: centerYAnchor)
let centerX = playButtonView.centerXAnchor.constraint(equalTo: messageContainerView.centerXAnchor)
let centerY = playButtonView.centerYAnchor.constraint(equalTo: messageContainerView.centerYAnchor)
let width = playButtonView.widthAnchor.constraint(equalToConstant: playButtonView.bounds.width)
let height = playButtonView.heightAnchor.constraint(equalToConstant: playButtonView.bounds.height)