     
     func setupUI() {
         
-        let rowNum: Int = Int(frame.height / EmojiHeight)
-        let colNum: Int = Int(frame.width / EmojiWidth)
+        let rowNum: Int = Int(frame.height / EmojiSize.height)
+        let colNum: Int = Int(frame.width / EmojiSize.width)
         let numOfPage: Int = Int(ceil(CGFloat(emojis.count) / CGFloat((rowNum * colNum))))
         
         guard rowNum != 0 && colNum != 0 else {

                column = 0      // The number of columns is 0
            }
            
            let currentRect = CGRect(x: (CGFloat((page-1)) * frame.width) + (CGFloat(column) * EmojiWidth),
                                     y: CGFloat(row) * EmojiHeight,
                                     width: EmojiWidth,
                                     height: EmojiHeight)
            
            if (row == (rowNum - 1) && column == (colNum - 1)) {
                // last position of page, add delete button


public class ISEmojiView: UIView, UIScrollViewDelegate {
    
    let EmojiSize = CGSize(width: 50, height: 50)
    let EmojiFontSize = CGFloat(32.0)
    
    var scrollView: UIScrollView = {
