     }
     
     
-    private func randomSortArray(array:NSMutableArray){
-        let x = arc4randomInRange(0, to: self.views.count-1)
-        let y = arc4randomInRange(0, to: self.views.count-1)
-        array.exchangeObjectAtIndex(x, withObjectAtIndex: y)
-    }
+//    private func randomSortArray(array:NSMutableArray){
+//        let x = arc4randomInRange(0, to: self.views.count-1)
+//        let y = arc4randomInRange(0, to: self.views.count-1)
+//        array.exchangeObjectAtIndex(x, withObjectAtIndex: y)
+//    }
    
     override init(frame: CGRect) {
         super.init(frame: frame)

            if (index + 1) % self.numberOfRows == 0 {
                text += "\n"
            }
            
            index++
        }
        print(text)
        
    }
}


    
    func reloadData(){
        
        let imageW = (image?.size.width)!/CGFloat(self.numberOfRows) * (image?.scale)!
        let imageH = (image?.size.height)!/CGFloat(self.numberOfRows) * (image?.scale)!

        for temp in self.views {
            let item = temp as! JKGridInfo
            let x = (item.imageView?.tag)! % self.numberOfRows
            let y = (item.imageView?.tag)! / self.numberOfRows
            let rect = CGRectMake(CGFloat(x)*imageW, CGFloat(y)*imageH, CGFloat(imageW), CGFloat(imageH))
            let tempImage = UIImage.clipImage(self.image!, withRect: rect)
            item.imageView!.image = tempImage
            item.sort = self.views.indexOfObject(temp)
        }
    }
    
