This project is the "beginning iOS8 programming with Swift" project learning note = = "All Notes directory
--------------------------------------------------------------------------------------------------------------- ---
1. Create a new Single document view item Foodpin, and remove the use Size class tick.
2. Remove the default controller view and the corresponding class: Viewcontroller.swift.
3. Drag a tableviewcontroller to the interface and set it to initial View Controller.
4. Create a new class file that inherits from Uitableviewcontroller Resturanttableviewcontroller.swift, set as the interface controller class.
5. Set cell style to Bisic,identifier to Resturantcell.
6. Declaration of two member variables
name of all restaurants:
var restaurantnames = ["Cafe deadend","Homei","Teakha","Cafe LOISL","Petite Oyster","For Kee Restaurant","Po ' s Atelier","Bourke Street Bakery","Haigh ' s chocolate","Palomino Espresso","Upstate","Traif","Graham Avenue Meats","Waffle & Wolf","Five Leaves","Cafe Lore","Confessional","Barrafina","Donostia","Royal Oak","Thai Cafe "]
The corresponding picture name of all restaurants:
var restaurantimages = ["cafedeadend.jpg","homei.jpg","teakha.jpg","cafeloisl.jpg","petiteoyster.jpg","forkeerestaurant.jpg","posatelier.jpg","bourkestreetbakery.jpg","haighschocolate.jpg","palominoespresso.jpg","upstate.jpg","traif.jpg","grahamavenuemeats.jpg","wafflewolf.jpg","fiveleaves.jpg","cafelore.jpg","confessional.jpg","barrafina.jpg","donostia.jpg","royaloak.jpg","thaicafe.jpg"]
The data source method of the table is then implemented based on these two member variables.
:
Chapter I Project construction