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.
No time to waste! Only got a short amount of time now so going to get a few minutes or so in! Start Time - 20:14 Conditionals If statement for 'love calculator' example. So a simple example for this. The idea will be that conditionals are used to show that the print statement will do it differently for whatever the number is. With updated Swift, I would use the Int.random(0...100). Easy fix that would be. Also no UIInt32 needed but just an Int. So with the if statements, it would be a STRING being returned. Linked to the whole choose your own adventure - if/else for each choice. BMI Challenge No need to do this - easy enough to be honest. Just skimming through. BODMAS principles... So something I picked up on before is not needing the greater than AND less than value for the middle line (for the else if bmi > 18.5) A better solution, which Angela is already explaining before I could say it is returning a string instead of a Double. So the...
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...
So this is probably the shortest time between blogs! As described in my last entry, working through the eBook was not working. So I've decided to go back to Treehouse. I always had a positive experience with it before; it helped me to understand the concepts and there were constant practical challenges that helped me gain and develop my knowledge. It was basically more hands-on and an active way to learn. It does mean a charge of $25 a month, but to be honest, that should be a motivation to use it - rather than dread or guilt for not utilising it and wasting money! Rather like paying for a gym membership, then not actually going to it - that would be the worst thing of all! So this way, it will mean quality time with coding, rather than trying to make sense of something that is beyond me, with no way of testing whether I'm actually at the right point or not. Right now, I have re-enrolled on Treehouse, where all of my progress has also been saved. That makes life easier ...
Comments
Post a Comment