I saw a few posts but they seemed a bit complex, so wanted to just phrase my question very specifically and see if there was a relatively easier way to achieve this.
I want to create an extension method in Swift for NSDate called changeTimeOfDay(hour: Int) that will change the time of a given NSDate to the time you pass in.
For example, if my current NSDate variable, d, happens to be a week from now, I'd like to specifically set that date to be at 8am (so it's a week from now, at 8AM).I already have an extension method that can add weeks to a particular date, and one that can add hours, but in this case I'd like to actually set the hours to 8AM.
Any thoughts on the way to go about this? I'd like to support ios7 and 8. I'm a little confused (based on what I was able to find so far) as to a simple way to do this.
Thanks!