     
     public func cleanPageIndex() {
         hCurrentIndex = nil
+    }
+    
+    func swapValue<T>(_ a: inout T, _ b: inout T) {
+        let temp = a
+        a = b
+        b = temp
+    }
+    
+    func modifying<T>(_ value: inout T, _ function: (inout T) -> ()) {
+        function(&value)
     }
     
     public func layoutContainerViews() {

        contentView.pre = datasource.flipView(flipView: self, pageViewWithIndex: contentIndex.pre) ?? UIView.init()
        containerView.pre.addSubview(contentView.pre)
        
        swap(&contentView.basemap.current, &contentView.basemap.pre)
        
        contentView.basemap.pre?.removeFromSuperview()
        contentView.basemap.pre = datasource.flipView(flipView: self, baseMapViewAtIndex: contentIndex.pre)

        contentView.next = datasource.flipView(flipView: self, pageViewWithIndex: contentIndex.next) ?? UIView.init()
        containerView.next.addSubview(contentView.next)
        
        modifying(&contentView.basemap) { basemap in swapValue(&basemap.current, &basemap.pre) }
        
        contentView.basemap.current?.removeFromSuperview()
        contentView.basemap.current = datasource.flipView(flipView: self, baseMapViewAtIndex: contentIndex.current)
