Nick Walter Swift 5 Course - Part 6 (lectures 35 to 37)

So here we go! The last part of Nick's course. It's been a really useful 'refresher'. Having missed a month's worth of coding, and to be honest before that, I hadn't really touched on those concepts of late, it was much needed! I think it's healthy to go over the core concepts, especially when there have been updates to Swifts. I always glean useful things or had forgotten certain elements. The coding challenge at the end of the Intermediate Swift Chapter was soooo hard but I learned from it. Last part - Xcode app. Only several lessons ago so will probably be pretty basic. Still worth doing!

Start Time - 18:33

Labels

Just a walkthrough of the main view screen etc. Reminders of the device type affects screen size. Matching up the screen on Xcode to what you will view on for sanity's sake!

Outlets

Under Super.ViewDidLoad - this is separate to the main code on the view controller.

view.backgroundColor = .red

OK, maybe it's a Swift 5 thing but I used .red instead of UIRed. 

Paused at 18:48 (15 minutes so far)

Continued at 20:23

So I noticed this - 

Hi Nick!

When changing the background colour to red, I found that you can do the following -

view.backgroundColor = .red

Same
So the UIColor keyword is not needed. Is this a feature of Swift 5? Or is it the case for accessing properties for views etc. in general?

Thanks,

That's my message to put on the course Q&A!

Other key things with labels - checking the outlet, renaming etc. Things like that. I'm fine with connecting these.

Buttons

Again, all of this is easy.

@IBOutlet weak var textLabel: UILabel!
    
    @IBAction func changeText(_ sender: Any) {
        textLabel.text = "The text has now changed!"

    }



Finish Time - 20:42 (TOTAL TIME - 34 minutes)

I've ran out of time for today - just a short session with the interruptions! So will finish off tomorrow instead....or the next day! Either way, I feel good to be back in the coding zone. Next time it will be if statements and counting - all easy enough. 





Comments

Popular posts from this blog

*Xcode Project Entry 2* F1 Quiz - part 1

Angela Yu Course Part 10 (up to lesson 112)

Angela Yu Xcode 12 Course - Part 7 (lectures 74 to 79)