Applying mvc

16 important questions on Applying mvc

Is Range a generic?

Yes, just like an array and enum

Can you nemumerate a range?

yes just like arrays and dictionary

What are the three fundamental data structures in swift?

classes, structures and enums
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

Can classes, structures and enums have properties and functions?

YES, enums has computed propertys though

Which of the following can have initialisers: Structs, classes, enums

Structs and classes

Structs and enums are passed by value, true or false?

TRUE

When you assign a struct or enum to a variable, what happens?

The variabele gets a copy of it!, remember this, important!!

When do you use the keyword "mutating" ?

When a function can mutate/ change itsself

What does the keyword "final" mean

It means none can override the function

When a property is accessed you can implement two methods, which are they?

willSet and didSet
i.e.
var anInt: Int = 8 {
willSet { println("i will be set set")}
didSet { println("i just got set")}
}

Can you lazily intitialize let properties?

No, only var's

Do you have to create an init method in a struct?

No, you can get one for free that initialises all properties. But you could create one.

What can you do inside an init?

Set properties value, even if they already have a default value.

Can you call other init(args) in init()?

Yes you can, and you can call super.init()

How can you describe "AnyObject"

Pointer to unknown class

How can you typecast anyObject?

force it with "as" prefix i.e. myString as NSString,
or check with as?. If u use as? it will return will if its not the correct type.

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo