From the course: iOS and watchOS App Development: Notifications

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Time interval triggers

Time interval triggers

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Time interval triggers

- [Instructor] With the first step done, we next add triggers. Triggers are the event that set off a notification. The simplest, most common, and versatile trigger you'll use is the time interval trigger. I'll use this in the make pizza action. In the make pizza UI action, under the content here, add a time interval trigger. These are objects of class UN Time Interval Notification Trigger. So let's go ahead and add one by doing let trigger equal UN Time Interval Notification Trigger. Put the parentheses and you'll see that we've got a time interval and a repeats on here. And I'm going to set the time interval which is, of course a amount in seconds. So, I'm going to go for 10 seconds for this. And for now I'm going to put repeats to be false. We'll talk more about that later. Be aware here, that this number here's got some funkiness to it. You can set your time interval to any number greater than zero, as long as this is false. Zero or less will cause an error. If you want something…

Contents