Working out the start and end of a day. Swift
问题 I have a function to work out the start and end of a week which works as expected. I want to implement another function which works out the start and end of a single day. I have the code below however I get the following error: Type of expression is ambiguous without more context. public class Date { let dateFormatter = NSDateFormatter() let date = NSDate() let calendar = NSCalendar.currentCalendar() func calcStartAndEndDateForWeek(durationOccurance: Double) { print("Calculating start and end