Posts

Showing posts with the label type properties

Bob Lee Course Part 15 (Consolidation of Chapter 2 - lectures 16 to 25)

So, a great chance to make sense of all of the concepts in Chapter 2. I will then crack on with Chapter 3 tomorrow! Chapter 2 was all about Object Oriented Swift. A lot of the terminology was familiar but I do feel on the most part (other than singleton stuff...) that my understanding improved with all of this. So let's go over it now! Start Time - 12:03 Convenience Init My Take - this is very simply another way to initialize an object. It's called convenience because the block of code for that init method has it all going on, then the initialisation process is very simple, or convenient. It could be as simple as using () after the class name. Yep, got it! Here's my example from before: class  Human {      var  name:  String      init (name:  String ) {          self . name  = name     }           convenience   init () {     ...

Bob Lee Course Part 13 (lectures 21 to 23)

Image
Back to Bob! I have genuinely missed learning new information, having spent a few days doing my mega consolidation project! The will be updated at the end of each 'stage' or mini stage. So my aim now is to complete the rest of this chapter, then I will do a consolidation review of the entire chapter - object oriented Swift. OK, let's get stuck in! Start Time - 17:02 Override Method, Init, Property SO this is what we will be looking at - the super.viewDidLoad bit... I get the idea of the override method. If you have a function with a class, then in the subclass, you want to change how the method works. So you need to use the override keyword. Bob makes the point that if you use the original value of what is returned, then you need to use the super keyword... Xcode doing an update so am screenshotting rather than typing out actual code. All the above is fine - I had forgotten that I still need to use the super bit - even if the value is not...

Treehouse Intermediate Course Part 2 (properties)

So a decent start yesterday with the first Treehouse Intermediate course. Just to recap it was about properties - stored, computed and typed. I get the difference between these and am getting more used to the syntax of get/set. My concern with this Treehouse course is that there seem to be no practical Xcode projects. This isn't necessarily a bad thing; it could be useful to explore some key concepts at greater depth before I resume with a Udemy course - mostly likely Angela's.  Anyway, just to reiterate my plan - I am to cover approx 3 hours per week. Yesterday was around an hour so half an hour today maximum. Here we go! Reading Modes This is the code that Pasan has created which I've just copied and pasted: mport UIKit enum ReadingMode {     case day     case evening     case night          var statusBarStyle: UIStatusBarStyle {         switch self {     ...