Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to put Image on specific dates like array #184

Closed
ZAPHIT opened this issue Jan 13, 2016 · 1 comment
Closed

How to put Image on specific dates like array #184

ZAPHIT opened this issue Jan 13, 2016 · 1 comment

Comments

@ZAPHIT
Copy link

ZAPHIT commented Jan 13, 2016

Hi thanks for this library..

I would like to ask about the following code:

return [theDay].containsObject(calendar.dayOfDate(date)) ? UIImage(named: "icon_cat") : nil

how to implement
var datesWithCat = ["20160129","20160130"] and so on.

on the example it has specific date for all of the month.

@WenchaoD
Copy link
Owner

WenchaoD commented Feb 3, 2016

A recommented way is to use a Dictionary , for example

var datesWithCat = ["20160129","20160130"]

func calendar(calendar: FSCalendar!, imageForDate date: NSDate!) -> UIImage! {
    var dateString = calendar.stringFromDate(date, format: "yyyyMMdd")
    return datesWithCat.containsObject(dateString ? UIImage(named: "icon_cat") : nil
}

@WenchaoD WenchaoD closed this as completed Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@WenchaoD @ZAPHIT and others