Posts

Showing posts with the label MVC

*Xcode Project Entry 3* Times Tables Quiz - Part 2

Image
Five days with no Swift but I'm back! Recently I've been getting much more into exercise - gym, tennis, yoga...all that is good for the mind and body but I haven't got that 'bug' to really work at the coding. This is not good! Though it may also just be temporary. So nothing to worry about basically; I need to focus on this own project and get that done - it will be cool to have something completed that I can then put onto the phone etc. THEN I will resume Angela's course - that is something I will definitely be doing next. OK time to crack on! Start time - 18:24 Last time, all I did was to make the 'to do' lists. These are always essential for any project. Let's get started by setting up all of the labels etc. Before that - here are all the 'view' items (from MVC) from last time: \ So let's get all of this done! *First thing is to get an image for the background. I remember that I need to generate this for the x2 and x3 quality...

*Xcode Project Entry 3* Times Tables Quiz - Part 1

OK, I am not sure if this is going to go anywhere! This entry was going to initially be a brief sojourn from Angela's excellent course - to see if I can get the ViewController option for the different difficulty levels of the F1Quiz. Having had a look over it, that app is too finicky, too fiddly to pick back up again. So a much better idea - a new app! This is a chance to put things into practice. I am going to stay well away from APIs, Cocoapods, JSON etc. and just focus on something simple - something educational. A times table app! *Screen replaced by the way - seems all shiny and new! Start Time - 19:13 So the idea of this is just to map out what I need to make a Times Tables app. Now, there are many, many out there so the idea here is not to try anything original at all - just to see if I can create something from scratch that has all the main facets required. Best place to start - a 'to do' list! It makes sense to do this for MVC - mapping out the main elements...

Angela Yu Xcode 12 Course - Part 9 (lectures 93 to 112)

Image
Managing to keep some momentum going! Have around 45 minutes or so now. The next chapter is the Quizzler app, which I used again recently to make my F1Quiz. So this really is a skim through. Couple of key things I want to go over are the pop ups and the progress bar. And the general MVC principle again. OK let's go! Start Time - 10:35 Status Bar Style - light. This is for the battery and anything else on the very top bar. You can also hide that as well. So you need to go to info.plist file. Add a new one and add view controller-based status bar; type boolean; answer NO. Info about the .plist   So this is the CLASS for a question/answer format. Much better than just using a dictionary - I tried using that before. Object Oriented Programming (OOP) Analogy of restaurant - I've seen this before but it's a really good one. I liked Sandra's pizza one too. So classes - blue print for an object. Ok difference with method/function - method is inside a class...

*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...

*Xcode Project Entry* Letters in a Word Part 1

Image
So here is the first (well, technically not quite first - Yahtzee - entry for my own stand-alone project!). The idea with these is that I will work on something separate to whatever I'm learning about from Udemy/other course. The first one is actually a really good, potentially unique idea. To be honest, it's more something that is important to my girlfriend - Cath. Cath is ridiculously quick and accurate at working out the number of letters in words! Yes very specific! But if I can get it to work, it would be a neat Christmas present... Before going headfirst into the actual Xcode project, something I picked up from Ray Wenderlich was to make a note of EVERYTHING needed. So let's do that... 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 arra...

Ray Wenderlich Course Part 14 (up to lesson 142)

So, continuing! I'm going to try to get through as much of the next three sections as possible. The next bit is about MVC. I know about that already. So here we go! So Brian mentions that we'll code the project in a sub-optimal way, then do it with MVC. I think I know what this will mean - that the code will repeat itself and not the use the 'model' part of it. Model View Controlle r This is a template solution to help you solve problems. I've used with MVC and actually already created a folder for each of these, then got the files that match up to these. It is a paradigm basically. There is communication between these that means you don't have to re-code/repeat yourself. MVC - First Attempt Refactoring - a posh way of saying rewriting/redoing. let row1Text = "Walk the dog"     let row2Text = "Brush my teeth"     let row3Text = "Do some coding"     let row4Text = "Watch GoT"     let row5Text = ...

Angela Yu Course part 8 (up to lesson 94)

Image
Continuing! Last time, classes were introduced. These seem to be - generally speaking - the way to go in all coding that involves objects. So the first part is going to be about object-oriented programming, something Pasan taught via the 'tower' game. That was a bit confusing to be honest, so hopefully this will clarify things! As before, I only have around half an hour - one our max, so here goes! Object Oriented Programming Machine Code - made up of 0 or 1. Technically, you could run with MC and do billions of lines of this but it would take forever! 1970s - C programming language. This is where all the other languages came from. Procedural Programming Language - Do this, then this, then this....repeated! Restaurant analogy - ONE person doing a long list of things including waiting on the tables, taking the orders...etc etc. Instead, you could have one person for the waiting, one for cooking. Good analogy! So in the restaurant analogy, messages can be passed aroun...

Angela Yu Course Part 7 (up to lesson 90)

Image
Before I go into the next part of Angela's course, I've been experimenting with the 'Yahtzee' app! It's actually gone much better than expected - I've managed to put together this: The dice roll when they are clicked, you click on the number buttons (1, 2 etc.) to assign that score...it took a lot of logic! One of the things I'm most proud of is the diceFunction, which combines several functions and bits of code together! unc diceFunction(diceNumber: Int ) {                  func isDiceEqual( _ : Int ) -> Int {                          var count = 0                          let diceIndexArray = [ randomDiceIndex1 , randomDiceIndex2 , randomDiceIndex3 , randomDiceIndex4 ]                          for x in diceIndexArray...