Posts

Showing posts from November, 2018

*Xcode Project Entry* Letters in a Word - Part 3

So great progress last time! I got to the point where I need to work on a couple of key things - getting a way to type in the answer is the first priority. One option is to try to add in the return key, this could sort out the issue with using text field. IF NOT, then I will have to add the buttons separately. Then find a way of linking those to a label display...easier said than done! Start Time - 20:16 First thing's first, let's try out the return key option.... OK tried a couple of things on Stack Overflow but not clear. Now trying this: https://www.youtube.com/watch?v=bhp08NX4Pe4 So I've followed various steps but the app is taking an AGE to load. This is not a good sign obviously! From the tutorial:      func hideKeyboard() {         textFieldDisplay . resignFirstResponder ()              }     func textFieldShouldReturn( _ textField: UITextField ) -> Bool {   ...

*Xcode Project Entry* Letters in a Word - Part 2

Image
Yes, I'm back to it! Last time in this project, I barely got started as I was figuring out the new layout - mostly where new labels were kept! It's a bit simpler sure, but I didn't see what was wrong with the old one. Something I have learned with Xcode and Swift is that there is no point yearning for a previous feature - it moves on rapidly! Start Time - 15:20 So, using last time's 'to do list', here's a reminder of what I need to focus on: On the view of the app Label to display random words A number pad to type in answer for how many letters are in the word A timer - from 5 seconds to 0 each time A scoring system for tracking Scoring system to link to timer (potentially!) The model (code) of the app An array of words - this is easy enough; can be updated too! A randomising way so a different word is displayed each time Functions to calculate the score each time and total score Functions to update question number etc Function for the ac...

Bob Lee Course Part 17 (Lecture 29)

Image
Unusual time to be doing an entry? Yes, absolutely! I have laryngitis - so I basically have to be off work, both yesterday and today.  A blessing? Probably! Well, the upshot is that I get to do some coding today, a rare treat. It's been difficult finding any time recently due to going to the F1 in Abu Dhabi, work and laryngitis! So, let's pick that up with Bob's course. Last time it was an introduction to closures. It was hard! From what I remember, closures are another way of writing functions. They can actually be simpler - VERY simple if you use the $ syntax for accessing the values. Still, the whole thing was tricky. Let's continue with the aim of finishing Chapter 3 today! Start Time - 11:27 Lazy Init with Closures My take - I know a bit about lazy already. I know that this means the value does not take up any space until it is used. So it is good for memory management. So that is the code for creating a UIButton. Bob's point here is that to create ...

Bob Lee Course Part 16 (lectures 26 to 28)

Image
Back to Bob! Now, I have genuinely been ill for the last few days - headaches, sore throat, cold...flu but really overwhelming. Not so bad to be off work but pretty horrible. Anyway, I have some time at last! I forgot to post the first (proper) Xcode project, so that's now several days out of sync. Not to worry. I will add to that later if I can! Now, the plan is to continue with Bob's Intermediate course, with the possibility of switching to Sandra's after chapter 3. Realistically, that's 2 main entries of the content with one consolidation one. Let's see how it goes! Start Time - 17:15 CHAPTER 3! Bob makes the point that people usually struggle with closures. Good - because I always have! Introduction to Closures (1) So the key point with closures is that they are essentially functions without using the 'func' keyword. You can also create a variable and assign it to a function, then it has the same functionality. Cool! var addClosure: ( Int...