This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on: http://stackoverflow.com/a/31598663/234609 | |
// Original gist: https://gist.github.com/jim-rhoades/ea0c5b241ec77a37f86b | |
// (paste this into an Xcode playground for testing) | |
import UIKit | |
let currentCalendar = Calendar.current | |
var dateComponents = DateComponents() | |
dateComponents.day = 31 | |
dateComponents.month = 1 |