Join Steven Lipton for an in-depth discussion in this video Use buttons for actions, part of iOS and watchOS App Development: Notifications.
- [Instructor] Okay, with our IB actions now in the code,…we can go ahead and start putting together buttons…and the first button we're going to do is a toggle…on the like button to go on like and unlike again.…And we'll also do that reflecting it…a little bit in the action.…So what we're going to do here is first…I'm going to just get the like button started,…and we're just going to do an if sender.titleLabel,…and I'm going to put a question mark here…'cause it tends to get really cranky on me,…and text equals like, in that case we're going to…set the sender.setTitle, and the title will change…to unlike for UI control state normal,…and I'ma just do if it isn't that,…we'll move it back to like.…
So I'm just going to do a Cmd + Copy here,…Cmd + C, Cmd + V, and turn that to like.…So that's the simplest thing that we can do,…but I'd like to also have this reflect…in my actions.…So I can change my actions here too,…from the button, and so what we're going to do…is do an extensionContext.notificationActions…equals, and in that array we'll do the snoozeAction,…
- Requesting user permission
- Static vs. dynamic notification content
- Sending local notifications
- Updating and removing notifications
- Creating custom notifications
- Adding categories and actions to notifications
- Pushing notifications
- Building push notification payloads: alerts and actions
- Adding service and content extensions
- Attaching rich media: images, audio, and video
- Creating watchOS notifications
Skill Level Intermediate
Apple watchOS 4 App Development Essential Trainingwith Steven Lipton3h 10m Intermediate
1. User Permissions
2. Local Notifications
3. Notification Management
4. Interacting with Notifications
5. Push Notifications
6. Push Notification Payloads
7. The Service Extensions
8. The Content Extension
9. Rich Media in Notifications
10. Apple Watch Notifications
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.