Nick Walter Swift 5 Course - Part 5 (lectures 27 to 34)
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 between the two.
Using Other People's Code
SwiftyJSON - I've used this before on Angela's course! So basically borrowing code from what someone else has done before.
CryptoSwift - separate to Bitcoin etc!
Right so the bit on the Swift file that we created has this as a default -
*Restart at 15:52
OK, so I figured it out! I got something copied and pasted wrong from the Git website. Git installed too now.
Lots of fiddly stuff with Terminal and having to restart etc. - still don't know what the 'big picture' of this is yet.
Right so importing the CryptoSwift module is NOT a native part of Swift. It is someone else's code. It is the whole point of this!
So everything in that module we now have access to.
I get the point of this even though Nick's example wasn't exactly exciting!
OK, last bit now - gonna start the Xcode project!
Intro
So just some clarification - Swift and Xcode are two separate things etc. Objective C was the previous language - much more complex and fiddly!
Nick's made a good point - if I just follow along with Nick and do it passively, I won't take much away. Spending time out on my own and trying them without Nick is how you actually learn! So I'm not going to race through this final section!
Xcode Walkthrough
Creating new project. Nick makes the point that it doesn't matter about which boxes are ticked/checked - those settings can be changed! HE also says to keep the Git box ticked - it's generally good practice to have that just in case!
Rest of walkthrough - all pretty straightforward. Just gonna do a little bit more for now.
One other thing I have taken away is text size - under preferences I have changed this to size 18 font. Anything to help the eyes!
Variables and Constants
This is all familiar stuff.
Challenge - make a variable called wallet and make it equal to what is in your wallet right now.
var wallet = 50
Done.
Strings and Ints
Yes this is all just a recap so whizzing through!
Challenge - create two constants. One to be an int constant and one to be a string constant.
let seasons = 7
let favSeason = "Season 2"
I know this is pointless really - no actual challenge so just skimming through.
Comments and Print
Last bit of recap for now, then I am done with this entry! Next time it will be the actual project...
Nothing new here.
So there we go! I am happy with the 'recap' part. The 'package' stuff is complex but I get it enough for now. Next time it will be completing Nick's course, then I am going to look into Treehouse!
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 between the two.
Using Other People's Code
SwiftyJSON - I've used this before on Angela's course! So basically borrowing code from what someone else has done before.
CryptoSwift - separate to Bitcoin etc!
Right so the bit on the Swift file that we created has this as a default -
import PackageDescription
let package = Package(
name: "HelloSwift",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "HelloSwift",
dependencies: []),
.testTarget(
name: "HelloSwiftTests",
dependencies: ["HelloSwift"]),
]
)
This is where you can put in custom information.
Right need to install Git - doing so now...
*Paused at 14:55
OK, so I figured it out! I got something copied and pasted wrong from the Git website. Git installed too now.
Lots of fiddly stuff with Terminal and having to restart etc. - still don't know what the 'big picture' of this is yet.
Right so importing the CryptoSwift module is NOT a native part of Swift. It is someone else's code. It is the whole point of this!
So everything in that module we now have access to.
I get the point of this even though Nick's example wasn't exactly exciting!
OK, last bit now - gonna start the Xcode project!
Intro
So just some clarification - Swift and Xcode are two separate things etc. Objective C was the previous language - much more complex and fiddly!
Nick's made a good point - if I just follow along with Nick and do it passively, I won't take much away. Spending time out on my own and trying them without Nick is how you actually learn! So I'm not going to race through this final section!
Xcode Walkthrough
Creating new project. Nick makes the point that it doesn't matter about which boxes are ticked/checked - those settings can be changed! HE also says to keep the Git box ticked - it's generally good practice to have that just in case!
Rest of walkthrough - all pretty straightforward. Just gonna do a little bit more for now.
One other thing I have taken away is text size - under preferences I have changed this to size 18 font. Anything to help the eyes!
Variables and Constants
This is all familiar stuff.
Challenge - make a variable called wallet and make it equal to what is in your wallet right now.
var wallet = 50
Done.
Strings and Ints
Yes this is all just a recap so whizzing through!
Challenge - create two constants. One to be an int constant and one to be a string constant.
let seasons = 7
let favSeason = "Season 2"
I know this is pointless really - no actual challenge so just skimming through.
Comments and Print
Last bit of recap for now, then I am done with this entry! Next time it will be the actual project...
Nothing new here.
So there we go! I am happy with the 'recap' part. The 'package' stuff is complex but I get it enough for now. Next time it will be completing Nick's course, then I am going to look into Treehouse!
Comments
Post a Comment