Commit Graph

11 Commits

Author SHA1 Message Date
Diego Sánchez 0673909be5 Swiflint 0.13 fixes & Xcode 8 b2 compatibility (#253)
* 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
2016-11-18 22:12:40 +00:00
Diego Sánchez d1b01327d1 Swift 3 migration (#220)
* 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
2016-09-21 12:58:25 +01:00
Diego Sánchez 37dd3bd562 Minor performance improvements for TextBubble (#166)
* Minor performance improvements:
 - Avoids updating font and color in TextBubble if it's not needed: would make attributed text to update
 - Avoids updating views in selected setter if value didn't change (setter is called by the collection view as part of dequeuing)
 - Avoids creating dictionary of attributes all the time for date attributed string (for some reason this was appearing in profiling with some swift-to-objc conversions)

Uses enum as image key in text style for greater safety.

* Removes linter warnings
2016-06-27 23:03:32 +01:00
Anton Schukin 8021e972b9 Fixed tests for armv7 architecture 2016-06-25 14:27:31 +01:00
Diego Sánchez ee45cdee43 Adds some configuration to tweak how updates are performed: (#145)
- Coalesce updates: when receiving updates from the datasource while an update is being performed, only the last one will be actually executed.
 - Fast updates: allows next performBatchUpdate before completion of the previous one
 - Tracks visible views: keeps track of cells on-screen instead of relying of indexPathsForVisibleItems and indexPathForCell, which are unreliable on fast updates.
2016-06-01 16:33:29 +01:00
Diego Sanchez cf5901cf80 Avoids retaining the view controller until update completes 2016-02-26 11:06:07 +00:00
Diego Sanchez 340a2677f1 Removes completion block from pagination calls.
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
2016-02-24 18:23:16 +00:00
Diego Sanchez 4086d458e3 Allows a datasource to return different chatItem instances when it updates.
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.
2016-02-08 17:55:23 +00:00
Diego Sanchez a8933a3791 Renames ChatViewController -> BaseChatViewController 2016-02-01 14:57:06 +00:00
Diego Sanchez a0a071afa8 Fixes linter warnings and updates some rules. Also removes deprecated '++' and '--' 2016-01-27 22:04:32 +00:00
Diego Sanchez 2884160061 Chatto inception 2015-11-26 22:48:25 +00:00