Skip to content

Commit

Permalink
Merge pull request MessageKit#1126 from bguidolim/fix-orientation-not…
Browse files Browse the repository at this point in the history
…ification

Set the proper notification to invalidate layout.
  • Loading branch information
nathantannar4 authored Jul 9, 2019
2 parents 2029800 + a73cb9f commit b60a1a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

The changelog for `MessageKit`. Also see the [releases](https://github.com/MessageKit/MessageKit/releases) on GitHub.

## Upcoming Release
## Upcoming release

### Fixed

- Set the proper notification to invalidate layout. MessageKit now relies on `UIApplication` orientation notification instead of `UIDevice`, which invalidates the layout only when it is needed. [#1126](https://github.com/MessageKit/MessageKit/pull/1126) by [@bguidolim](https://github.com/bguidolim)

### Added

Expand Down
2 changes: 1 addition & 1 deletion Sources/Layout/MessagesCollectionViewFlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ open class MessagesCollectionViewFlowLayout: UICollectionViewFlowLayout {
}

private func setupObserver() {
NotificationCenter.default.addObserver(self, selector: #selector(MessagesCollectionViewFlowLayout.handleOrientationChange(_:)), name: UIDevice.orientationDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(MessagesCollectionViewFlowLayout.handleOrientationChange(_:)), name: UIApplication.didChangeStatusBarOrientationNotification, object: nil)
}

// MARK: - Typing Indicator API
Expand Down

0 comments on commit b60a1a1

Please sign in to comment.