Posts

Showing posts from December, 2018

*Xcode Project Entry 2* F1 Quiz - part 3

Image
Well last time was frustrating but, interestingly, I cracked it just after my entry! That was hugely rewarding, even though MOST of the work was from Angela's project. Anyway, I adapted well and understand each aspect to it. Yesterday, I had another go, changing the views first of all, including background colour etc. I found some cool things, like the font colour changing when the answer was correct or not. Anyway, I had left it on a real cliffhanger when I headed out to Wimbledon that evening. The huge breakthrough was creating a randomator function, so that the questions were not in a set order. This is clearly a game changer! However, I couldn't quite crack it! The answers weren't matching up to the questions...a bit like what I found initially in the last entry. Anyway, I sorted it! I did several things basically and here is the final code... Start Time - 21:14 import UIKit class ViewController: UIViewController {          //Global variabl...

*Xcode Project Entry 2* F1 Quiz - part 2

Image
Here we go! No chance to code on Christmas or Boxing Day but I'm back! I have around an hour or so to work on the next bit of the project. Last time, I got the views (including stack views), constraints and main question/answer bit of codes sorted. However, the next challenge will be communicating all of that so the questions/answers can be accessed! I'm going to try out a couple of things and when (yes, when!) that fails, look at Angela's Quizzler project for some inspiration. Start Time - 9:45 That's what I got last time in terms of the view. Yes, I will need some colour but I will do that last. Last time, I did that first and perhaps did a less than ideal version. So, cracking on with the actual code. How to do this? This is what I want - For the 'next question' to be randomly from drivers, numbers or cars array, then to choose one of these at random to be shown on the question label. Then the correct answer (the key-value pair) needs to be on o...

*Xcode Project Entry 2* F1 Quiz - part 1

Image
It's Christmas Eve and time to code! To think, a year ago, I was plodding along with some eBook, blindly convincing myself that I was on a steady road to coding greatness. Really, it was from June where I made the decision to start again, humbling as that may seem. It would have been comforting to have completed endless 'beginner' courses but branching out and applying the theory is the key thing, which brings us to this entry. Yes, my second Xcode OWN project! I thought about doing an educational one, as there is certainly a lot of scope and relevance for that, being a teacher and all. However, making a quiz makes sense, for various reasons.  First off, I have made this before through Angela's excellent tutorial. No offence to Sandra, but hers is not even close to the elegance and effectiveness of Angela's project. The one thing to take from Sandra is the stack views. Definitely something I will use from now on. This is one of the great things about learning from...

Sandra L Course Part 6 (lectures 40 to 47)

Image
Two days in a row - first time in a while. Boom! Yesterday was a really useful session, focusing on classes then applying it to a model. It made a few concepts clearer to me, especially the fact that custom types can be passed into parameters/arguments; THEN the object, when created, can be put into the function. Anyway, I said I'd start a new project next. Before I do that, I want to crack on with Sandra's Quiz Project - the next chapter in her course. THAT will be the project I will work on! Start Time - 13:13 Intro and Stack View Right so I have opened the project file then Sandra says that we can go from scratch. So I will actually do the same as that's the best way to learn! Reminder about the new position of the option button. Stack view needed! Vertical stack view put in. Constraints time. *Red - missing constraints *Yellow - conflicting constraints *Blue - all is OK! This is just to show that the label and button are like the 'children' of ...

Sandra L Course Part 5 (lectures 30 to 39)

Image
Well 3 days is better than the gap between the previous entries! My plan is to work through OOP today, then start working on my next independent app project. Let's go! Start Time - 10:50 Object Oriented Programming My take - this is about the creation of 'object's which are an instance of a particular class or type. There is functionality involved in this too. Let's see the actual definition! So data vs action is a key part. Procedural oriented programming - design program with a set of instructions. I get this as procedural text types/instructions is something I've taught. Data types - strings, ints etc. but also custom ones from classes/structs Coffee machine example - A good analogy for the fact that the machine has different functions and specifications (properties). The above are the functions. Engineers build the actual machine - it has specifications. It then has the propensity for different jobs/functions. An object is a coffee m...