O'Reilly logo

Learn iOS 11 Programming with Swift 4 - Second Edition by Craig Clayton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up notifications 

Now that we have permission, we need to set up notifications. We start setting up our buttons:

  1. Open the RestaurantDetailViewController.swift file and add the following method after our showAllReviews() method and before the last curly brace of our class file:
@IBAction func onTimeTapped(sender: UIButton) {}
  1. Save the file, and you see an empty circle appear next to this new @IBAction.
  2. Now, open the RestaurantDetail.storyboard and select the RestaurantDetailViewController.
  3. Select the Connections inspector in the Utilities panel and, under Received Actions, you see onTimeTappedWithSender:
  1. Click and drag from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required