Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

what does muteNoticications mean ?

probably a simple answer but what does "muteNoticications" mean ? (I know what the code does just not sure why he called it this name ) why did Pasan call it that ?

let week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

func weekdayOrWeekend(day: String) -> String { switch day { case "Saturday", "Sunday": return "Weekend" case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday": return "Weekday" default: return "This isn't a valid day in the Western calendar" } }

func muteNotifications(day: String) -> Bool { if day == "Weekend" { return true } else { return false } }

let result = weekdayOrWeekend(week[4]) let isMuted = muteNotifications(result)

1 Answer

Hey Jon,

He called the func muteNotification because if it is weekend, he does not want to be bothered with a 'notification' so he muteNotification =). The muteNotification func return true or false, so if it is indeed weekend, the func returns true and it means that the notification will be muted.

You can imagine an app that will mute notifications if it is weekend.

Hope this helps.

I see! Thanks Tassia