Angela Yu Xcode 12 Course - Part 19 (lectures 185 to 190)
Get link
Facebook
X
Pinterest
Email
Other Apps
Two entries in a day?! Yes! Well the previous one was more of a 'what I did before' so not that much of an achievement, really. Anyway, I am going back to Angela's course after a brief detour for my own project. I've already got an idea for another project, a much more tricky one - Guess Who! With that, I would have a number of different pictures i.e. 16. The computer would randomly choose one, then the player would select questions to eliminate the pictures that do not match to it. Until there is just one left - number of questions it took gives them a score. Anyway, leaving that for now and doing some more learning! Let's go!
Start Time - 15:52
Flash Chat App
This has got about storing data - cloud-based. That could be really interesting. Also table view controller...again something else that I want to know more about. Firebase, cocoa pods....so some technical stuff again!
Firebase
A service from google. It has cloud based infrastructure to save and receive data. It means we don't have to create our own site for that - google take care of that! Cool. So storing the messages on the server and receiving these on to a device/devices. It can run on iPhone and Android - using the same database. Cloud-based. Authentication feature - register and login options too to authenticate the user. Cool!
Firebase account
So this uses a Google Account. No probs.
So I have created a new project.
Ah one thing with the Flash Chat download is that it needs to be on my desktop...so let me download that all again! Bit of a setback - getting a GitHub desktop app before I can get the project there....
A note about this -
As some of the steps we will ignore, e.g. for step 5, we will be verifying installation in our own way so you don't need to worry about this part on the firebase website.
Second, remember that we are working with the Firebase Realtime Database and not the Cloud Firestore.
OK, so bearing those things in mind!
I've been playing around for ages now and to put it simply, the button to add the iOS app to the project DOES NOT WORK! Gonna try rebooting the computer to see if that helps....
Paused at 16:32 (20 minutes so far - time taken into account for faffing with firebase)
Rebooted - YES now it works! Something so simple!
OK got the google service p list copied over now.
Then Terminal to do the pods!
Right so various steps to this - not writing about them all now. In fact, a good time to stop where I have all of the pods etc. added.
Paused at 16:55 Continued at 18:21
So I've done most of the steps at this stage - as usual, cocoapods are fiddly. Checked the messages again from Angela and will skip the fifth part.
Some warnings on the above link as the Firebase site is different now.
*This is one of things with tutorials in general - stuff gets updated so often it's hard to follow all steps. Anyway, it's fine for now.
Finished time - 18:25 (total time approx 45 minutes)
So some interesting stuff again. It's exciting learning new content! This will give me some new 'tools' down the line even though I'm a way off making proper sense of it yet.
Here we go! Haven't had the chance over the past two days so am going to do a good half an hour or so now! Last time, it was a big focus on initialisers. I've made of sense of those and hopefully I'll be able to apply that. Now we're moving on to something else - can't remember. Anyway, let's go! Value Semantics Value types - structs, enums etc. struct Point { var x: Double var y: Double } var p1 = Point (x: 1 , y: 2 ) var p2 = p1 If we change the x value of p1, then let's see what happens to p2. It does not change! A value type is COPIED ON ASSIGNMENT! We are copying the underlying value. let p3 = Point (x: 2 , y: 4 ) Here, this constant is IMMUTABLE. You cannot then change the values! However with var (p1 or p2) you can change values, as long as the stored properties are variables (which they are!) struct AnotherPoint { let x: Doubl...
So, once again I've managed to leave a huge gap between these blogs! The good news is that the Summer Holidays are approaching and there will DEFINITELY be time to code then! So, between now and then, I need regular entries so I can learn what is left in 'Learn to Code in Swift 4', then make a new plan for how to take my knowledge forward. Anyway, the next chapter is all about 'Unit Testing', which sounds interesting! The three facets of a successful app are: well designed, stable and easily adaptable to change. Apparently, many app developers do not test their code properly; the most effective approach is to test one line at a time, after writing. That makes sense! So 'Unit Testing' is a method to test individual 'units' - usually methods. Having read over the next few pages, a lot of this seems unnecessary at present; I'm still getting used to writing codes let alone testing and debugging! This is something that I can revisit when I have ha...
Yes - one day's break, but not because I needed or wanted one! I was genuinely to busy for any Swift yesterday, so it feels good to be back! Having written entries each day for a week, I missed it! Enumerations are done for now; Optionals are next... The Absence of Data I think the idea of this is 'nil' - nothing! Pasan explains 'safe' code, where crashes need to be avoided. Optionals are new - since the inception of Swift I believe. struct Person { let firstName: String let middleName: String ? let lastName: String } I've pre-empted the ? - to make middleName an optional. If I didn't have this, then an error would be caused - you can't input nil. The question mark - making it an optional - means that nil CAN be used. So it means it may have a value OR may be nil. They do seem cumbersome, but apparently they are powerful and useful! In the example above, it means that it is a string and ma...
Comments
Post a Comment