Angela Yu Xcode 12 Course - Part 9 (lectures 93 to 112)

Managing to keep some momentum going! Have around 45 minutes or so now. The next chapter is the Quizzler app, which I used again recently to make my F1Quiz. So this really is a skim through. Couple of key things I want to go over are the pop ups and the progress bar. And the general MVC principle again. OK let's go!

Start Time - 10:35

Status Bar Style - light. This is for the battery and anything else on the very top bar. You can also hide that as well. So you need to go to info.plist file.

Add a new one and add view controller-based status bar; type boolean; answer NO.

Info about the .plist

 

So this is the CLASS for a question/answer format. Much better than just using a dictionary - I tried using that before.



Object Oriented Programming (OOP)

Analogy of restaurant - I've seen this before but it's a really good one. I liked Sandra's pizza one too.

So classes - blue print for an object.

Ok difference with method/function - method is inside a class or other OOP type code. Function is separate and outside of that.

Properties are let/var within an OOP - and are const/var outside of one.
Easy stuff!

So new file for the QuestionBank class.

 
That's setting up the array of questions which have questions and answer within the list.

The init () needed no information passed into it.

 

But even better than doing that every time, you can use this way -



MVC

M - Model. This is a structure that manages the data. It is NOT the data itself but it is responsible for it.

C - Controller - Liaises between the model and the view. Takes requests, if appropriate then sends the request to the model, then the data is served back, then prepared for display.

Restaurant analogy again.

Data - raw ingredients
Model - the kitchen
Controller - the waiters
View - what the customer sees on the table

OK all makes sense.

Benefits of using MVC  -



UI Alert - done these before but useful to see.

*Something worth doing - check Apple guidance for options for alerts. Then I can see all of the options for the various settings. Easy to play around with this.

SELF

If you see the keyword 'in', you should think to use the 'self' keyword after it.

So Objective C




So this is to get the little pop ups after each question.

So you need to add the files first of all, then type out some code to include these.

I'm not THAT fussed but I could use them at some point.

Finish Time - 11:14 (Total Time 40 minutes)

Perfect session! Really quick but useful recap. Next time - Destini app. That is one I really want to build on!!


Comments

Popular posts from this blog

*Xcode Project Entry 2* F1 Quiz - part 1

Angela Yu Course Part 10 (up to lesson 112)

Angela Yu Xcode 12 Course - Part 7 (lectures 74 to 79)