Posts

Angela Yu Course Part 6 (up to lesson 84)

Image
Yes - the first time not in the evening for a short while that I've been able to code. Here is my plan for the next couple of days: Complete Section 8 - Xylophone app! Make my own 'Yahtzee' app - this could take some time... Complete Section 9 - MVC for make a quiz app This will be plenty to sink my teeth into. Ok here goes! Introduction The aim is not so much about creating an app but actually using tools to get help - whether it's using the Swift documentation or other searches. There will be unfamiliar language etc. The purpose is to be more self-reliant - this is something I DEFINITELY need! When I need a certain functionality - finding out for myself. This will be key! There's no point just copying and pasting someone else's code without understanding it; it's much better to find things out and then apply them. Anyway, here goes! Using Tags Linking all of the buttons to one action....interesting! So they all trigger the same action. Usin...

Angela Yu Course Part 5 (up to lesson 72)

Image
Yes - managed to find some time late into the evening again - my last one at Basingstoke, for the time being. Tomorrow I'll be back to 'normal' if you will and really want to crack on with this course from Angela as I'm learning a lot from it. The last few and next few bits look like more recap/going over of concepts, so it'll be partly useful, partly confirming that I do know a lot about the actual syntax and language! Here we go! BMI Calculator Challenge! So this is what I am working on in a playground! func checkBMI(weightInKg weight: Double , heightInMetres height: Double ) -> String {          let bmi = weight / (height * height)          if bmi > 25 {                  return "Your BMI is \ ( bmi ). You are overweight."              } else if bmi >= 18.5 {              ...

Angela Yu Course Part 4 (up to lesson 67)

Image
Finding time for coding is tricky! Yesterday, I was hoping I would a fine a spare half hour on the train - didn't happen. Too crowded! I'm just about finding some time while staying with friends in Basingstoke. I think it's realistic to aim for 20 minutes per day - or a little longer every other day if it's not been possible to code that day. Anyway, I'm really enjoying the Angela Yu course and look forward to finding out more! I think the next few lessons are recapping some of the basics, which I have every need and right to skim over. We'll see though - her explanations are so clear that I'll probably understand some concepts properly for the first time!  Introduction to Programming Modules The last two apps have used a lot of fundamental aspects of Swift. Seeing how they work in real life THEN looking at some of the theory makes total sense. I would classify myself as 'Intermediate' at this stage, though this may be generous! Comments, Print...

Angela Yu Course Part 3 (up to lesson 59)

Image
I figured it out! So simple - the array string was as "dice 1" rather than "dice1". That explains why the dice would disappear - because the value didn't actually relate to anything! Ah! Phew - it would've been embarrassing to have posted that as a question. OK, so that's a relief. I was also thinking today - while walking around Hampton Court - that I code a Yahtzee game. It would take four dice and a load of labels of the options. I'm going to have a go at that, once the dice app is complete! Angela said that's the best way to learn so I'm revved about that.  The DRY Principle Now I know what this means - Don't Repeat Yourself. The 'View Did Load' screen - this is where we want to put in a set of new dice cases! We could copy and paste but DRY - there must be a better way. So a function would be better for this.   func updateDiceImages() {         randomDiceIndex1 = Int ( arc4random_uniform ( 6 ))         random...

Angela Yu Course Part 2 (up to lesson 43!)

Image
So this is the only chance I'll get probably for a bit of coding today! When reading about Angela's top 12 tips for coding, she mentioned plenty of useful tidbits. One was to WANT to do it - and I certainly do! If you do it enough days it does become a necessity! Realistically, there will be days when that will be difficult e.g. this weekend I'm staying with friends in Basingstoke. However, I can still do a bit on the train, or just more the following day. Anyway, she had some other useful advice, which I'll summarise at some point. Her point was to tell your brain that you'll do 'just 20 minutes' - then if you go over, it's no big deal! Whereas if you say that you'll do e.g. an hour, that can seem intimidating. So I'm going to do something in between that - no more than an hour anyway for now! Dicee App Great! Another hands on practical sounds ideal - more useful than going through endless playground examples! She does a lot of 'if you h...

Angela Yu Course - Part 1 (up to lecture 33!)

Image
So here we go! Switching over to Udemy makes sense. I've got so many courses that I've paid for that I need to go through. I've only actually completed 2 - out of 22!  Now, I could go through every single one of these, recapping the basics each time...Tempting to do another 'overhaul' where I essentially start from scratch again...but that's NOT the way to go! Instead, I'm going to go with the Angela Yu course - not because she is a girl and therefore seems like a refreshing change from the blokes - but I had started this one briefly a while back and would like to continue with it. The idea is that I gain experience of making apps and learn about coding as I do, rather than keep going over the key areas.  After I have completed the Angela Yu course, I will go for one of the others - possibly Ray Wenderlich, Mark Price, John Bura, Muhammad Haroon....plus a good few more!  So the challenge is to see this course through! Not give up! If I do need to check...

Programmatic Auto Layout (part 2 - final!)

The last few videos from this 'workshop'...hopefully it will be less confusing than where we got to last time! Complex Format Strings Pasan talks through the code required for layouts. The benefit is adding several constraints, all in one go! Orientation - horizontal or vertical. Optional as it would default to horizontal. H for horizontal; V for vertical. Leading relationship - superview connection (will come back to) View - this is required. Needs to refer to this. Type of connection - between view and any other view. Trailing relationship - can be optional (again linked to superview). Use of the |..... This is used for showing the superview. Known as the 'pipe' key apparently! "V:|-[redView(viewHeight)]" This is a strange one.       NSLayoutConstraint . constraints (withVisualFormat: "H:|-(customHorizontalSpacing)-[redView(viewWidth)]-customHorizontalSpacing-[greenView(redView)]" , options: [], metrics: m...