Posts

Showing posts from June, 2019

Stephen DeStefano Swift 5 Course - Part 3 (Lectures 8 to 11)

Image
Well it's been a good few days but I'm back! No need for more of a preamble than that - straight into functions! Start Time - 14:06 Functions These are SELF-CONTAINED. It is best to name what the function actually does. Syntax - the name, parameters, return bit etc. Nothing else new here. Bit about the return value and print statement used. Underscore - placeholder for a constant/var without an actual name. 9 out of 10! Only one that was wrong was a bit of a trick question. OK next! Returning Multiple Values So this of course means returning a tuple All very technical - again, Stephen combines lots of elements - for loops, if statements, optionals...all hard to keep on top off! Names of return types - optional. Used to improve readability of code. Argument Labels and Parameter Names Argument label - used when calling the functions. Better for readability. Swift used the parameter name as the default. Labels are used on the outside - on the left of th...

Stephen DeStefano Swift 5 Course - Part 2 (Lecture 7)

Image
So a busy few days; no time at the weekend at all to code! No issues - I've got a little amount of time today and will certainly make more time for coding this week. Going to continue with Stephen's course! Start Time - 19:52 Tuples Skimming through this. Multiple values declared together. It is not limited by a certain type. Use of . syntax e.g. .0, .1, .2  - indexes like an array. You can name the values in a tuple - this improves the readability. Still use the dot index or the name of the property. Either way. Decomposing - breaking down the tuple and storing elsewhere. You can use empty parameter name (__) Iterating through dictionary by the use of tuples - So the tuple names in brackets have been created for the purpose of iterating. Another example - In the above, the use of tuples is in the return value part. That's cool - I've generally only used one type in the return part. Cool! So I've noticed something. Stephen throws in a LOT...

Stephen DeStefano Swift 5 Course - Part 1 (Lectures 1 to 6)

Image
After completing (yes ALL of!) Nick's Swift 5 course, I'm going to undertake another one on Udemy. I'm content to focus on these refreshers/building in some new info course. The reason why I want to do this one is because there are built in quizzes. I want to make sure I understand what I'm doing! Start Time - 19:54 Intro So the first part is the basics of Swift (I will skim over), then it will go into actual projects. Cool! Language Intro More intro and info! Stephen makes the point of skimming through the language part of the course if I am at an intermediate level. I really want to go through the info and ensure I have a secure understanding, before the projects! Constants and Variables Real basics here. Yes all straightforward. Skimming through to get to the quiz! 10 out of 10 on first quiz! Now onto part 2... Multiple statements on a single line - use semi-colons to separate. To be honest I don't think I will ever do this! Double - precisi...

Nick Walter Swift 5 Course - Part 7 (lectures 38 to 39)

So the final part of Nick's course! This last chapter, the iPhone app project has been more recap but still well worth doing! Only got about 20/25 minutes now for today so just enough time.  Start Time - 17:51 If Statements Away from the project...so will just skim through this. Some focus on other operands e.g. < > == != <= etc. Challenge....why not! Make a var called temp to hold the temperature. Then create if statement to show if temp is greater than or equal to 30, print it's hot, if not, then print nice weather. Not even going to use a playground for this! var temp = 42 if temp >= 30 { print("It's hot!") } else { print("Nice weather!") } There we go. Too easy. Counting Right, so Nick states that the idea is to have 10 clicks and then the background colour changes. I'm just going to do this myself - good practice! DONE! var total = 0          var colourArray = [ UIColor . green , UIColor . b...

Nick Walter Swift 5 Course - Part 6 (lectures 35 to 37)

So here we go! The last part of Nick's course. It's been a really useful 'refresher'. Having missed a month's worth of coding, and to be honest before that, I hadn't really touched on those concepts of late, it was much needed! I think it's healthy to go over the core concepts, especially when there have been updates to Swifts. I always glean useful things or had forgotten certain elements. The coding challenge at the end of the Intermediate Swift Chapter was soooo hard but I learned from it. Last part - Xcode app. Only several lessons ago so will probably be pretty basic. Still worth doing! Start Time - 18:33 Labels Just a walkthrough of the main view screen etc. Reminders of the device type affects screen size. Matching up the screen on Xcode to what you will view on for sanity's sake! Outlets Under Super.ViewDidLoad - this is separate to the main code on the view controller. view . backgroundColor = . red OK, maybe it's a Swift 5...

Nick Walter Swift 5 Course - Part 5 (lectures 27 to 34)

Image
The roll continues! Last time, it was a focus on consolidating the challenge from Nick (which had MANY tricky elements!) and then finding out what's new with Swift 5. All of that was positive and I feel like I gleaned various useful bits from it.  This time it will be a focus on  Swift Package Manager;  I'm not sure what this is - I assume that it's to do with building own custom code or possibly modules... Anyway, we will see! Start Time - 14:23 Making Your Own Package So terminal is needed. Right so the first bit was OK but it did not like 'exit'! Strange... OK back out and into it and I've created the directory using Terminal. Cool! OK so a lot of what to run from terminal, how to link to Xcode... All of that worked but I don't see the point of it yet, to be honest. From what I've gathered, it's about the use of having Terminal directly interacting with the Xcode file - having the results come up on terminal and working betwe...

Nick Walter Swift 5 Course - Part 4 (lectures 25 to 26)

Image
Cool! Now I have some closure (pun unintended!) on Nick's last, very complex, challenge, I am moving on with 'what's new in Swift 5'... Start Time - 13:15 This will be very recent information. ABI Stability ABI is how Swift interacts with the computer. What are the benefits here? Every Swift app (whatever the device is) it comes with a run time with whatever Swift version you have Now, with S5 and ABI stability, any device will already have Swift there so this will shrink app sizes. Frameworks in Swift also shrink in size, app load times reducing...cool! As you'll have different versions of Swift on different apps etc. it will now speed things up. Stability part - From Swift 1 to 2 there were MASSIVE changes. Each new Swift has resulted in small changes. This is good news as it means you don't have to RELEARN the language! Cool! This is also great as you can go ahead with using what you know with Swift 5, knowing it's not going to change so m...

*CONSOLIDATION ENTRY* Nick Walter Challenge Revisited!

Image
So, I was happily coasting through the beginner and intermediate aspects of Swift in Nick's course when WHAM! The challenge was just so tough. To be fair, I could have been much more willing to search for how to do the various elements. So I'm going to have another go at it, trying to do what I can from memory. I will then see if I can find out where to get the info from.  Start Time - 11:29 Right, first off let's see what the challenge was... So that is the task! Here is what should be returned as an example So I am going to, again, try this without any help at all, remembering what I did yesterday. Yesterday was such a rush and I didn't even attempt to look up how to complete the different parts to it. Right. Various elements to this. As before, I know that I need the following elements - A function that takes in a string I am going to print rather than do a return String as that it is too fiddly! A way of putting the string into separate values in...

Nick Walter Swift 5 Course - Part 3 (lectures 23 to 24)

Image
Getting onto a good roll now! This is what I need to maintain - not every day, but finding and making time. Of course it's easier during the Eid break - the real challenge will be next week, getting back to 'normal' hours and being at work etc. So a bit of time now and possibly some more later on! Start Time - 11:40 This is the last part of the Intermediate section before a challenge! Then it will be the 'Advanced' part. Switches I am all too familiar with - similar to if statements with a few differences in syntax. Also, it's good to use switches for various numerical options. Here is Nick's example. It's good for numerical values because the ... is an easier range to use than the greater than/less than symbols. The default keyword must be used if the conditions are NOT exhaustive. This is going to be the case for numbers! It works really well with enums - I think I made this point last time when Nick was using a function to find out th...