I am using NSDateComponents a lot in my app. The code is long and I have to do a lot of copy & pasting and when that happens in programming it’s a sign that something can be done better :).
I read the ticked answer for that question and got all excited:
(Read the comments)
How can I wrap them on a struct? Sorry if that’s a really beginners question but well… I’m a beginner.
Or is there any other way to deal with that?
Thanks!
You can declare your structure like this:
Then assign the parts: