 }
 
 // MARK: scrollViewDelegates
+
 extension JTAppleCalendarView: UIScrollViewDelegate {
+    /// Tells the delegate when the user finishes scrolling the content.
+    public func scrollViewWillEndDragging(scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
+        if pagingEnabled {
+            return
+        }
+
+        let cellDragInterval: CGFloat = (calendarView.collectionViewLayout as! JTAppleCalendarLayoutProtocol).itemSize.width
+        
+        var contentOffset: CGFloat = 0,
+            theTargetContentOffset: CGFloat = 0,
+            directionVelocity: CGFloat = 0,
+            contentInset: CGFloat = 0
+        
+        if direction == .Horizontal {
+            contentOffset = scrollView.contentOffset.x
+            theTargetContentOffset = targetContentOffset.memory.x
+            directionVelocity = velocity.x
+            contentInset = calendarView.contentInset.left
+        } else {
+            contentOffset = scrollView.contentOffset.y
+            theTargetContentOffset = targetContentOffset.memory.y
+            directionVelocity = velocity.y
+            contentInset = calendarView.contentInset.top
+        }
+        
+        var nextIndex: CGFloat = 0
+        var diff = abs(theTargetContentOffset - contentOffset)
+
+        
+        if (directionVelocity == 0) {
+            calendarView.collectionViewLayout.collectionViewContentSize().width
+            nextIndex = round(theTargetContentOffset / cellDragInterval)
+            targetContentOffset.memory = CGPointMake(0, nextIndex * cellDragInterval)
+        } else if (directionVelocity > 0) {
+            nextIndex = ceil((theTargetContentOffset - (diff * scrollResistance)) / cellDragInterval)
+        } else {
+            nextIndex = floor((theTargetContentOffset + (diff * scrollResistance)) / cellDragInterval)
+        }
+        
+        if direction == .Horizontal {
+            targetContentOffset.memory = CGPointMake(max(nextIndex * cellDragInterval, contentInset), 0)
+        } else {
+            targetContentOffset.memory = CGPointMake(0, max(nextIndex * cellDragInterval, contentInset))
+        }
+    }
+    
     /// Tells the delegate when a scrolling animation in the scroll view concludes.
     public func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) {
         scrollViewDidEndDecelerating(scrollView)

    ///     - cellState: The month the date-cell belongs to.
    func calendar(calendar : JTAppleCalendarView, isAboutToDisplayCell cell: JTAppleDayCellView, date:NSDate, cellState: CellState) -> Void
}
public extension JTAppleCalendarViewDelegate {
    func calendar(calendar : JTAppleCalendarView, canSelectDate date : NSDate, cell: JTAppleDayCellView, cellState: CellState)->Bool {return true}
    func calendar(calendar : JTAppleCalendarView, canDeselectDate date : NSDate, cell: JTAppleDayCellView, cellState: CellState)->Bool {return true}

            delegate.calendar(self, didDeselectDate: dateSelectedByUser, cell: selectedCell?.cellView, cellState: cellState)
        }
    }
    /// Asks the delegate if the specified item should be deselected. true if the item should be deselected or false if it should not.
    public func collectionView(collectionView: UICollectionView, shouldDeselectItemAtIndexPath indexPath: NSIndexPath) -> Bool {
        if let
            dateUserSelected = dateFromPath(indexPath),
