Posts

Showing posts with the label storyboards

RW.com: Storyboards Segues Article - Consolidation

So, as mentioned, I need to consolidate this particular article. There was so much code there, I just wanted to look over it one more time and make sense of it all - from the Xcode project.  Start Time - 13:05 Let's look at one Swift File at a time. First of all the model - this is what was already created before the article: struct Player {   var name : String ?   var game : String ?   var rating : Int } A simple struct here. Name and game are optional because there may be no value (nil) put in - stops the program from crashing. Rating is an int - a score out of 5. That's interesting as anything could actually be set for it! The rating part wasn't actually covered in this project.  Now we have the view file: import UIKit class PlayerCell : UITableViewCell {      @IBOutlet weak var gameLabel : UILabel !   @IBOutlet weak var nameLabel : UILabel !   @IBOutlet weak var ratingIma...

RW.com: Storyboards Segues Article - Part 1

Image
Here we are! Onto the next article. The first one was useful as it gave me a lot more confidence with connecting the different bits and pieces, along with a few segues. This next article (same author) is all about segues. So I'm sure that there will be various useful bits! Start Time - 8:07 Here is the link I'm following: https://www.raywenderlich.com/5055396-ios-storyboards-segues-and-more Great, something he makes clear that there will be full functionality this time! That's a relief as last time it was a bit strange not to have it after all that work! This time the project has been set up and organised. New VCs are going to be created. So a new Swift file made under the view controller folder. And here's the code added: class PlayersViewController : UITableViewController {      var playerDataSource = PlayersDataSource () } We have a UITableViewController, and in this an instance of the PlayersDataSource class (same name).  It is...