                 setContentOffset(CGPoint.init(x: offset, y: 0), animated: animated)
             }
         } else {
-            let offset = (item.frame.origin.y - contentInset.top) - fittingContentHeight / 2 + item.frame.size.height / 2
+            var offset: CGFloat = 0
+            switch positionScroll {
+            case .top:
+                offset = item.frame.origin.y - contentInset.top
+            case .middle:
+                offset = (item.frame.origin.y - contentInset.top) - fittingContentHeight / 2 + item.frame.size.height / 2
+            case .bottom:
+                offset = (item.frame.origin.y - contentInset.top) - fittingContentHeight + item.frame.size.height
+            }
             if offset < minOffset.y {
                 setContentOffset(minOffset, animated: animated)
             } else if offset > maxOffset.y {


enum ScrollDirection {
    case Unknown, Up, Down
}

typealias ScrollDirectionHandler = (_ isUp: Bool) -> ()

        return items.filter(test)
    }
    
    @discardableResult public func scrollToItemPassingTest( test: (StreamItem) -> Bool, positionScroll: PositionScroll = .middle, animated: Bool) -> StreamItem? {
        let item = itemPassingTest(test: test)
        scrollToItem(item: item, positionScroll: positionScroll, animated: animated)
        return item
    }
    
    public func scrollToItem(item: StreamItem?, positionScroll: PositionScroll = .middle, animated: Bool)  {
        guard let item = item else { return }
        let minOffset = minimumContentOffset
        let maxOffset = maximumContentOffset
        if layout.horizontal {
            var offset: CGFloat = 0
            switch positionScroll {
            case .top:
                offset = item.frame.origin.x - contentInset.right
            case .middle:
                offset = (item.frame.origin.x - contentInset.right) - fittingContentWidth / 2 + item.frame.size.width / 2
            case .bottom:
                offset = (item.frame.origin.x - contentInset.right) - fittingContentWidth + item.frame.size.width
            }
            if offset < minOffset.x {
                setContentOffset(minOffset, animated: animated)
            } else if offset > maxOffset.x {
