RxSwiftCommunity / RxAnimated

Animated RxCocoa bindings
MIT License
688 stars 38 forks source link

Problem with Custom AnimatedSink #13

Closed vander2675 closed 6 years ago

vander2675 commented 6 years ago

While trying to add an AnimatedSink for UIEdgeInsets for an CollectionView. Compiler is complaining that self.type and self.baseare inaccessibble due to internal protection level. Why are they specifically marked internal?

extension AnimatedSink where Base: UICollectionView {
    var contentInsets: Binder<UIEdgeInsets> {
        let animation = self.type
        return Binder(self.base) { collectionView, insets in
            self.type.animate(view: collectionView, binding: {
                guard let collectionView = collectionView as? UICollectionView else { return }
                collectionView.contentInsets = insets
            })
        }
    }
}
icanzilb commented 6 years ago

I got to try this - it's probably a mistake. Did you manage to add the new sink when you changed the access level? Maybe send a PR

vander2675 commented 6 years ago

Yep it worked. I will send a PR.

icanzilb commented 6 years ago

awesome, thanks @vander2675 !

icanzilb commented 6 years ago

merged