VACalendar icon indicating copy to clipboard operation
VACalendar copied to clipboard

When I present screen it's view not display proper

Open Ilesh opened this issue 6 years ago • 2 comments

Please find below image for more information from below link. Image

Ilesh avatar Jan 01 '19 15:01 Ilesh

Also, I am not able to load the calendar with my selected month and year. Can you please help me to find solutions? @Binusz, @spase84 , @Binusz , @Vodolazkyi

Ilesh avatar Jan 07 '19 10:01 Ilesh

"Also, I am not able to load the calendar with my selected month and year. Can you please help me to find solutions?" - I have fixed adding below methods in the pod.

// IN VACalendarView.swift Class 

// specify all properties before calling setup()
    public func setup() {
        delegate = self
        calendar.delegate = self
        directionSetup()
        calculateContentSize()
        setupMonths()
        scrollToStartDate()
    }
    // ADD THESE LINES FOR SET CALENDAR MONTHS
    public func setUpMonthData(date:Date){
        self.scrollToDate(date: date)
    }

func scrollToDate(date:Date) {
        let startMonth = monthViews.first(where: { $0.month.dateInThisMonth(date) })
        var offset: CGPoint = startMonth?.frame.origin ?? .zero
        
        setContentOffset(offset, animated: false)
        drawVisibleMonth(with: contentOffset)
        
        if viewType == .week {
            let weekOffset = startMonth?.week(with: startDate)?.frame.origin.x ?? 0
            let inset = startMonth?.monthViewAppearanceDelegate?.leftInset?() ?? 0
            offset.x += weekOffset - inset
            setContentOffset(offset, animated: false)
        }
    }

Ilesh avatar Jan 08 '19 05:01 Ilesh