Restaurant details
In order to show data in Restaurant Details, we must first pass the data over to the Restaurant Detail View, just like we did with our Map. We will start with displaying data in our Restaurant Detail View and, then, in our Restaurant List View.
Displaying data in the Restaurant Detail view
First, let's set up our RestaurantDetailViewController
and add the following:
Under import UIKit, add:
import MapKit
Add the following variables after the class declaration and before the
selectedRestaurant
variable:@IBOutlet var lblName: UILabel! @IBOutlet var lblCuisine: UILabel! @IBOutlet var lblHeaderAddress: UILabel! @IBOutlet var lblTableDetails: UILabel! @IBOutlet var lblAddress: UILabel! @IBOutlet var mapView: MKMapView! @IBOutlet var reviewsContainer: UIView! @IBOutlet var lblUser: UILabel! @IBOutlet var txtReview: UITextView! @IBOutlet var imgRating: UIImageView! @IBOutlet var btnHeart: UIBarButtonItem! @IBOutlet var noReviewsContainer: UIView!
Make sure you save the file.
Now that...