FSCalendar Dark Mode issue for title color

FSCalendar is a very good calendar library in Swift but it does not support dark mode, I’m using version 2.8.1.

We can easily change all date color by one of its delegate’s FSCalendarDelegateAppearance func.

func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, titleDefaultColorFor date: Date) -> UIColor? {
        
        let defaultColor = appearance.titleDefaultColor
        
        if #available(iOS 12.0, *) {
            if self.traitCollection.userInterfaceStyle == .dark {
                return .orange
            } else {
                return defaultColor
            }
        } else {
            return defaultColor
        }
        
    }

Also, don’t forget to reload the calendar data

override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
        self.calendar?.reloadData()
    }

Summary of The Science of Getting Rich

The Science of Getting Rich by Wallace D. Wattles

This is my first book of Wallace D. Wattles and it was first published in 1910 by the Elizabeth Towne Company. I bought the printed copy from a local online store The Science of Getting Rich.

I’m amazed by the author’s style of writing which gives you a clear idea about how to think and what to think and what not to think.

If you want to get ahead in your career or business this book might help you to think clearly about your future business or things you like to do. This is a must-read book as Goodreads review says read the review.

My received copy was 128 pages and the font was big enough for eyes. I also suggest Think and Grow Rich before this book.