Posts

Showing posts with the label structures

Ray Wenderlich Fundamentals Course - Part 5

Image
OK last part! I'm going to complete this fundamentals course today! Also, Xcode looks like it's ready for the official update - so I won't need Beta anymore. Anyway, time to go for it. Start Time - 20:44 Structures Grouping sets of related data together. Technically, all of the below are structs!   struct Student {          let name : String     let grade : Int     let pet : String ? } let bobStudent = Student (name: "Bob" , grade: 33 , pet: nil ) Most of this is recap so skimming through *Technical glitch for 5 approx minutes. Wifi back on! Mutating. I've made sense of this at last! If you do a function that alters one of the STORED PROPERTIES e.g. grade, then I have to use the mutating keyword. Cool.  Value type. I could clone an instance. That new version is unique and does not affect the original. Class (reference types) do.. It's also got to be a var, to change any of the va...

Treehouse Intermediate Course - Part 18 (Build Interactive Story App Project 2)

Image
Back in Dubai and back to the code! I knew yesterday would be a right off. But just to clarify, I do NOT need to code every day. I reckon that 3-4 times a week for 30 minutes to 1 hour. That may not hit the self-imposed three hours a week target. Realistically, however, with school about to start again, I cannot guarantee three hours a week. I need to put together my long term plan for coding, which I will actually do below. I need more vision and purpose for it. Having faced several setbacks with it, I can't let that deter me. These may seem like random, unconnected thoughts but they do actually link together. So, before continuing with Treehouse, let's map out my long term plan! Step 1(June 2018-December 2018) - learn the basics syntax and principles of coding with Swift. Step 2 (January 2019 - June 2019) - learn more intermediate level coding and create several of my own projects. Step 3 (July 2019 to December 2019) - build on the intermediate concepts, learn some more...

Sandra L Course Part 4 (lectures 23 to 29)

Image
Well, what a busy time it has been - hence the lack of entries! Not going to go into detail; I just want to crack back on with my work! I have missed it and am not going to recap anything at all, just continue with where I got to. So far, Sandra's course has been easy but useful for some consolidation. I'm sure it will get harder soon! Start Time - 19:15 If/else statements If statements - that all seems pretty logical so far. let temp = 20 let sun = "Sunny!" let clouds = "Cloudy!" if temp >= 20 {     print ( sun ) } else  {     print ( clouds ) } Another example -  if temp >= 20 {     print ( sun ) } else if temp > 10 {     print ( clouds ) } else {     print ( "Awful weather!" ) } They key thing here is that the if/else block is followed in order. If more than one statement is true - like in the one  above (temp being treater than/equal t...

Nick Walter Challenges (Part 4)

Image
Yes, here we go - third day of consecutive entries, whoo! I need to ensure that this does not become a habit - being able to code only at the weekend. I must ensure that I code at least on two days out of Sunday to Wednesday. Anyway, back to Nick's challenges. I've loved these so far however they are certainly getting harder. At some point I will have to go through the course content, which is absolutely fine. First off, it will be functions which I'll be fine with. Optionals - definitely something I need more practice with. Let's do it! The screen shots I took STILL not did not get saved here properly. So back to typing it all until I find another way! This is fine - it's part of the learning process. My new idea is to save a screenshot as usual, THEN save it as a JPEG. We'll see if that does it! *Delaying start of coding as Xcode is still updating.  Start time - 11:17 Functions So none of these look hard at all. 1) needs lyrics printed when t...