Guest User

Untitled

a guest
Dec 16th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. var matchingComponents = DateComponents()
  2. matchingComponents.day = 5
  3. let nextDate = Calendar.current.nextDate(after: Date(), matching: matchingComponents, matchingPolicy: .nextTime, repeatedTimePolicy: .first, direction: .forward)
  4.  
  5. var matching2 = DateComponents.init(calendar: Calendar.current, timeZone: TimeZone.current, era: 1, year: nil, month: nil, day: 5, hour: nil, minute: nil, second: nil, nanosecond: nil, weekday: nil, weekdayOrdinal: nil, quarter: nil, weekOfMonth: nil, weekOfYear: nil, yearForWeekOfYear: nil)
  6.  
  7. let nextDate = Calendar.current.nextDate(after: Date(), matching: matching2, matchingPolicy: Calendar.MatchingPolicy.nextTime, repeatedTimePolicy:.first, direction:.forward)
Add Comment
Please, Sign In to add comment