Reputation:
I was wondering if what I want is possible and if so if somebody could point me in the right direction. What I want is to SET a date for something to happen, and then when that time comes some piece of code gets executed...for example it sends a notification and when the app is opened and the notification is tapped another piece of code is ran...but that code could not run unless the date and time has come.
I have seen similar questions for other languages like javascript and they all get negative votes.
Upvotes: 1
Views: 498
Reputation: 27
I think you should dive into how NSDate works. From what I understand, you want to get a future date and then compare it to the current date. You can create a future date like this:
How do you create a swift Date object
I think this explains best what you want to achieve:
Upvotes: 0