         self.backgroundColor = LayoutDefaults.defaultDayViewColor
         self.addGestureRecognizer(UILongPressGestureRecognizer(target: self, action: #selector(longPressAction)))
         self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(tapAction)))
+        self.prevHeight = self.frame.height
     }
 
     override func layoutSubviews() {

    private var seperatorLayers: [CAShapeLayer] = []
    // Event rectangle shape layers
    private var eventLayers: [CALayer] = []
    // PRevious height
    private var prevHeight: CGFloat?

    // Delegate variable
    weak var delegate: DayViewCellDelegate?

            guard eventsData[id] != nil else {
                return
            }
            let transform = CGAffineTransform(scaleX: 1.0, y: scaleY)
            var newFrame = frame
            if scaleY != 1.0 {
                self.eventFrames[id] = frame.applying(transform)
                newFrame = self.eventFrames[id]!
            }

            let eventRectLayer = CAShapeLayer()
            eventRectLayer.path = CGPath(rect: newFrame, transform: nil)
            eventRectLayer.fillColor = eventsData[id]!.color.cgColor

            let eventTextLayer = CATextLayer()
            eventTextLayer.frame = newFrame
            eventTextLayer.string = eventsData[id]!.title
            let font = FontVariables.eventLabelFont
            let ctFont: CTFont = CTFontCreateWithName(font.fontName as CFString, font.pointSize, nil)
