jessesquires / JSQMessagesViewController

An elegant messages UI library for iOS

Home Page:https://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatibility with App Extensions Due to Use of UIApplication.shared

paulstringer opened this issue · comments

New issue checklist

General information

-JSQMessagesViewController version: All

  • iOS version: all
  • Devices/Simulators: all
  • Reproducible in the demo project? (Yes/No): No
  • Any related issues:

What happened?

  • When linking with a App Extension target, compiler errors occur related to usage of UIApplication which is unavailable in App Extensions. This results in JSQMessagesView being unusable in Extensions.

Examining the usage of UIApplication shows that it's being used by JSQMessagesBubbleImageFactory. Further investigation shows that an alternative Extension Safe approach would be to use the alternative UIView.effectiveUserInterfaceLayoutDirection.

An investigation was done by changing the BubbleFactory default initialiser to use UIView().effectiveUserInterfaceLayoutDirection in the Swift Example. An arabic language was added to the example and then when switching between Right to Left and Left to Right languages showed that the current behaviour was preserved.

The benefit would be that by implementing the alternative JSQMessagesViewController would be safe to implement the APPLICATION_EXTENSION_API_ONLY=YES setting giving it broader use in not only Application but also Extensions.

I propose a pull request be submitted for version 8.0 for consideration for this release.

Investigation SwiftExample left to right (English) with Extension Compatibility
Swift Example left to right (English) with Extension Compatibility
Investigation SwiftExample left to right (English) with Extension Compatibility
Swift Example right to left (Arabic) with Extension Compatibility

Hello everyone!

I'm sorry to inform the community that I'm officially deprecating this project. 😢 Please read my blog post for details:

http://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/

Thus, I'm closing all issues and pull requests and making the necessary updates to formally deprecate the library. I'm sorry if this is unexpected or disappointing. Please know that this was an extremely difficult decision to make. I'd like to thank everyone here for contributing and making this project so great. It was a fun 4 years. 😊

Thanks for understanding,
— jsq