         }
     }
 
-    var delegate: RAReorderableLayoutDelegate! {
+    weak var delegate: RAReorderableLayoutDelegate? {
         set {
             self.collectionView?.delegate = delegate
         }
         get {
-            return self.collectionView?.delegate as RAReorderableLayoutDelegate
-        }
-    }
-    
-    var datasource: RAReorderableLayoutDataSource! {
+            return self.collectionView?.delegate as? RAReorderableLayoutDelegate
+        }
+    }
+    
+    weak var datasource: RAReorderableLayoutDataSource? {
         set {
             self.collectionView?.delegate = delegate
         }
         get {
-            return self.collectionView?.dataSource as RAReorderableLayoutDataSource
+            return self.collectionView?.dataSource as? RAReorderableLayoutDataSource
         }
     }
     

    
    private var fakeCellCenter: CGPoint?
    
    private var trigerInsetLength: CGFloat = 150.0
    
    private var insetTop: CGFloat {
        let contentInset = self.collectionView!.contentInset

    override func prepareLayout() {
        super.prepareLayout()
        
        if let insets = self.datasource?.collectionView?(scrollTrigerEdgeInsetsInCollectionView: self.collectionView!) {
            self.trigerInsets = insets
        }
    }
    
    override func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject]? {
