jeudi 1 décembre 2016

Static vs dynamic type

In Swift we can determine type of variable by type(of:) and Mirror(reflecting:).subjectType.

Documentation about Mirror.subjectType says:

The static type of the subject being reflected.

This type may differ from the subject’s dynamic type when self is the superclassMirror of another mirror.

I did not find docs for type(of:) but the proposal says that it's replacement for .dynamicType property.

So we have dynamic and static types. What the difference between them and in what circumstances does it show up?





Aucun commentaire:

Enregistrer un commentaire