Go to file
Daniel Burgess ab286307c3 Fix a bug causing keyboard view offset to be incorrect (#204)
* Fix a bug causing keyboard view offset to be incorrect

In some rare cases, if the height of the view is a fractional point
(i.e., not a whole number), it would cause the views to not be offset
despite the keyboard being shown on top of them. This does not happen
with every fractional height. Different devices also behave a little
differently in seemingly identical layouts, due to their pixel density
being different.

The base issue is that, due to floating point rounding errors, two
values that _should_ be identical and pass the guard fail to do so,
because the lack of precision results in them not being equal. By
flooring the values, we can ignore really minor differences and ensure
rounding errors don't cause this issue.

* Unify bma_round methods to use correct calculation

Thanks to @diegosanchezr for the suggested improvement.

* Revert ChattoAdditions bma_round change

Unfortunately, removing this in favor of the Chatto version broke size
calculations, so putting it back...

* Switch to using infix operator to check float comparison

* Add utils to Chatto project
2016-08-22 15:46:32 +01:00
Chatto Fix a bug causing keyboard view offset to be incorrect (#204) 2016-08-22 15:46:32 +01:00
Chatto.xcworkspace Compatibility for Xcode 8 beta 2016-08-08 13:00:58 +01:00
ChattoAdditions So generated initialisers for structs are internal and not visible from another module.. 2016-08-12 15:03:16 +01:00
ChattoApp Fix a bug causing keyboard view offset to be incorrect (#204) 2016-08-22 15:46:32 +01:00
readme-images Chatto inception 2015-11-26 22:48:25 +00:00
.gitignore Initial commit 2015-11-25 16:30:26 +00:00
.swiftlint.yml Fixes swiftlint warnings 2016-03-21 20:55:56 +00:00
.travis.yml Makes builds not to fail silently 2016-03-23 23:34:35 +00:00
AUTHORS Add Igor Kashkuta to AUTHORS (#128) 2016-05-09 16:37:18 +01:00
CHANGELOG.md Updates Changelog and Readme 2016-08-08 12:46:33 +01:00
Chatto.podspec Bumps version to 2.0.1 2016-08-08 14:46:05 +01:00
ChattoAdditions.podspec Bumps version to 2.0.1 2016-08-08 14:46:05 +01:00
LICENSE Initial commit 2015-11-25 16:30:26 +00:00
README.md Removes references to dev branch in readme 2016-08-12 13:05:17 +01:00

README.md

Chatto Build Status codecov.io CocoaPods Compatible Carthage compatible

Chatto is a Swift lightweight framework to build chat applications. It's been designed to be extensible and performant. Along with Chatto there is ChattoAdditions, a companion framework which includes cells for messages and an extensible input component. You can find more details about how it was implemented in our blog. See them in action!

Features

  • Calculation of collection view changes and layout in background
  • Supports pagination in both directions and autoloading
  • Message count contention for fast pagination and rotation with thousands of messsages
  • Accessory view revealing by swiping from right
  • Interactive keyboard dismissal
  • Text bubbles
  • Photo bubbles
  • Extensible input bar

How to use

Check the wiki!

How to install

CocoaPods

  1. Make sure use_frameworks! is added to your Podfile.

  2. Include the following in your Podfile:

pod 'Chatto', '= 2.0.1'
pod 'ChattoAdditions', '= 2.0.1' # if you want to use the cells or the input component

If you like living on the bleeding edge, you can use the master branch with:

pod 'Chatto', :git => 'https://github.com/badoo/Chatto', :branch => 'master'
pod 'ChattoAdditions', :git => 'https://github.com/badoo/Chatto', :branch => 'master'
  1. Run pod install

Carthage

If youre using Carthage, simply add Chatto to your Cartfile:

github "badoo/Chatto"

Manually

  1. Clone, add as a submodule or download.
  2. Drag and drop Chatto and/or ChattoAdditions project to your workspace
  3. Add Chatto and/or ChattoAdditions to Embedded binaries

License

Source code is distributed under MIT license.

Android

Check our colleagues' project Chateau!

##Blog Read more on our tech blog or explore our other open source projects