* Updates swiftlint config
* Fixes swiftlint erros and warnings
* Makes ChattoApp compatible with Xcode 8 b2
* Carthage compatibility with Xcode 8 b2
* Updates .travis.yml to use stable image with Xcode 8.1
* Runs the Swift 3 migrator in ChattoApp.
Affects ChattoApp, ChattoAppTests, Chatto and ChattoAdditions. Does not migrate ChattoTests or ChattoAdditionsTests
* Configures Chatto And ChattoAdditions projects to use Swift 3
* Updates .travis.yml to use Xcode 8 and iPhone 7
* Uses flatMap instead of filter and force cast
* Fixes createCollectionViewLayout not being a function
* Removes useless init overrides
* Fix for new implicit unwrapping optional non-propagation rule
* Removes useless casting
* Audits accessor levels in Observable
* Fixes UIControlState.Normal replaced by UIControlState()
* Favours private over fileprivate where possible
* Audits open/public access level
* Removes conditional if for Swift 2
* Removes label from simulateTapOnTextViewForDelegate
* Audits open/public access levels
* 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
- Just one capture session per input component.
- Avoids starting/stoping capture during collection reloads, which can make the live camera take longer to capture or even hang.
- Moves creation/destruction of capture session to the background: when opening/closing the input component many times it was resulting in capture start / stop blocking the main thread for some seconds on iOS 8
- Queues updates in the collection view: doing a reloadData right after reloadItemsAtIndexPaths (update video) results in the visible cells not being refreshed
Adds more customizable options to the input bar
Bar with icons gets customizable height
Buttons get customizable intrinsic contentSize, so they can be bigger and easy to tap
Buttons get customizable images for any UIControlState
Send button gets customizable text colors for any UIControlState
Also allow user to override layoutConstants in
BaseMessageCollectionViewCell and allow user to specify
VerticalAlignment of avatar: Top, Bottom or Center
Now DataSource is responsible for notifying the exact type of change. This implicitly allows more flexibility in the dataSource ( like ignoring such a request! ) and reduces entry points from where changes are enqueued
MessageModelProtocol should not require setter for status property.
MessageViewModelProtocol should not require messageModel property.
Both are convenience shortcuts for DemoChatApp and should be removed since they are not used by ChattoAdditions framework.
Previously, due to the mapping between chatItem instance and presenter, a new presenter would be created. This fixes:
1) That new presenter will have invalid itemVisibility property (would cause a crash when long pressing a text cell)
2) If a new chatItem instance is returned by the dataSource for a previous existing message, but the previous chatItem is leaked, then the presenter would leak too (and it might try to update its cell, as in downloading an image)
This introduces ChatItemCompanion, a structure which attaches a ChatItem with its presenter and decoration attributes. This solves 1) and 2). Still new instances of presenters will be created for new instances of chatItems --> Presenters should avoid keeping any state in its internal storage.