Angela Yu Course Part 14 (Lectures 134 to 145)

I'm back! Having tried out Ray Wenderlich's course (started off well but tailed considerably, especially after the other instructor came in), Pasan's Intermediate one on Treehouse (some interesting theory but not enough challenges to make the content applicable) and Chris Ching's beginner's course (a great consolidation with tough challenges at the end), I've concluded that Angela's course is the best. So I'm going back to hers! With her course, I created apps of increasingly complexity and interest, with great explanations and I thoroughly enjoyed all of it. Last time it was about constraint views, which wasn't the most exciting; at that point (back in July or whenever it was), I figured it was time to try out other purchased courses. However, I can see now that hers was the best - in all ways. So thank you Angela for this course as hopefully it's just what I need right now!

Clima App

Right, this is the app I'm going to be making! I'm going to be using Cocoa Pad and APIs - both of these are built-in features which I will get to utilise! Cool!

The weather app grabs your current longitude and latitude of your GPS and will show the current temperature and weather condition. It will have more than one screen too. Neat!


Start time - 11:42

I've just downloaded the project. Looking forward to learning in context again!

*Paused at 11:45 (3 mins)

*Restarted at 11:52

Right so there are various elements here. First of all, there are two view controllers (I've used multiple ones of these before in Ray's bullseye app) and a few text labels. So far, straightforward enough!

There is a segue button that switches between the view controllers. That makes sense.

There is a 'GetWeather' button that has a design flaw in that it doesn't look much like a button. A challenge from Angela is to change the look of it so that it looks more like an actual button! Linked up with an IB Action of getting weather.

*Pausing at 11:59 to sign up with this app thing... (7 mins)

*Restart at 12:04

Well I think I've done that but haven't copied any app id yet. Not sure about this yet.

OK my understanding is that this website: https://openweathermap.org/api allows you to try to get a certain piece of data to use within an app e.g. which you can then use within code. So I don't need to do anything yet but I have signed up for it, so hopefully it can be used easily when the time is right!

Now we're looking at CocoaPods. So this is for finding certain objects and things that you can 'window shop' through code bases and incorporate within your own code. The idea is to save time and just select. Cool!

Setting up CocoaPods

First of all - Terminal! This is a cool feature - can be found using spotlight (the command and space bar) to then search for it. It looks like a programme hackers would use! But as Angela says, it's actually more for searching through directories - basic stuff really....

It gives you control over the computer basically.

So the dollar sign means you are ready to receive inputs. OK!

Flashing cursor - means it is 'doing something' and if you type something then it won't be ready to receive any commands.

Well it seems to have worked! Lots of comments on the sidebar made me think that it wasn't going to!

So I need to look out for my username and the dollar sign when everything is ready....

Yes I think we are!

Right so this will take at least a few minutes the 'verbose' part. So this is the only time I should have to install CocoaPods. Cool! I'm going to let it keep loading and move on with the next lesson, assuming I don't need anything directly from the CocoaPods yet...

*Paused at 12:21 - can't do anything else until installation is complete! 17 mins

OK, so I'm stopping here - I did a few other tasks while that was loading, installing some software to help speed up my Mac! I'm going to come back to this again today, as the CocoaPods stuff was getting interesting! Back soon....

*Restart at 12:59

I'm back! Sorted out a few bits now continuing with Angela's course...

So 'cd' is a shortcut for 'change directory' - useful one.

Typing 'cd Desktop' means I am now in the desktop. Neat. Cool, so I've done the cd and the Clima folder (the exact name) then initialised it (pod init) and I've got a pod file in the folder.

Right so after opening this in Terminal, I'm now in the pod file which is a kind of text file. It's using 'Ruby' as the language - something I've never looked at before.

'do' and 'end' - the equivalents of { and }

So I've put in a few pods as per Angela's instructions. Presumably, I'll be able to access some neat CocoaPods! In fact, searching for them here: https://cocoapods.org is useful to see....

Right after some troubles I've found out the version number (1.5.3).

Everything seems to have been installed! Angela mentions with updates then this is the best way to do it, just to avoid fiddly methods etc. I trust and believe you completely Angela!

WOW - that took some figuring out! It shows you how you must listen to EVERY instruction! I was opening the wrong file; I now have the write Xcode file - it was WORKSPACE, not PROJECT! OK...

So that feels like a good place to stop. I haven't actually done any coding, it's been more of setting up CocoaPods, using Terminal, getting my head around some new stuff basically. I'm going to have a look through other courses, JUST to see if there is a coding challenge I can have a go at, just to keep my eye in...

*Stopped at 13:42 (43 mins) - total so far: 1 hour and 10 minutes

Right so going in hot - could be a mistake! But I'm using Nick Walter's Swift Essentials course and am looking just at the variables/constants challenge...

// 1) Make a variable named age and set it equal to your age
// 2) Change your variable age to -100
// 3) Make a constant named myName and set it equal to your name


These look easy enough. Annoyingly my Xcode keeps running but I'll go ahead as then I can check against the solutions. 

var age = 33

age = -100

let myName = "Josh Gonet"

Easy peasy but let's check... Yep all correct. Let's do another one of these, just for fun and keeps my eye in!

// 1) Make a String variable
// 2) Make an Int variable
// 3) Make a string constant that has both the String and the Int variables in it (interpolation)
// 4) Change the string variable and the int variable

// 5) Do division with both a Double and an Int

var myString = "Kiran"

var myInt = 26

let combinedInfo = "Her name is \(myString) and she is \(myInt) years old"

// 4 - done

Number 5 I cannot check as the Xcode file is not launching properly - this is getting a real problem. 

var intDivision = 9 / 3

var number = 3


var doubleDivision = 9.7 / Double(number)

It started working! Then stopped again. 

So all good. Nice to do some easy-ish challenges just to keep my coding going. That will do for today!

*No times for these as I stopped and started several times. 

Comments

Popular posts from this blog

*Xcode Project Entry 2* F1 Quiz - part 1

Angela Yu Course Part 10 (up to lesson 112)

Angela Yu Xcode 12 Course - Part 7 (lectures 74 to 79)