Huy Nguyen e78d70eec4 [ASCollectionView] Small improvements (#407)
* Minor refactors in ASCollectionView and its private cell classes
- `_ASCollectionReusableView` and `_ASCollectionViewCell` no longer expose getters for their collection element and cell node properties. This is to make sure that clients can only obtain elements from the visible map which is always the source of truth.
- Since the map can return `nil` for an element request, it's much safer to check and avoid adding/removing a nil pointer to an `NSArray`.
- Since we use a special way to check whether an object of kind of `_ASCollectionViewCell` or `_ASCollectionReusableView`, based on the assumption that these classes are subclass restricted, I added cast-or-return  macros in the header files, closer to where the restrictions are declared.

* Add ASDynamicCastStrict

* Add element and node properties back to _ASCollectionReusableView and _ASCollectionViewCell

* Assert unexpected nil elements

* Always mark an element visible even if it is backed by an UIKit / non-_ASCollection* view

* Fix typo

* Remove unnecessary changes

* Dump mistakes

* Update CHANGELOG

* Can't track visibility of elements backed by non-_AS views
2017-07-06 17:38:23 +00:00
..
2017-04-24 16:59:57 -07:00