Q:

Why constant instances of classes can be changed in properties value?

Why constant instances of classes can be changed in value ?
For example consider the code below:
class A {
var var1: String

init(var1: String) {
    self.var1 = var1
    }
}

Then:
let a = A(var1: "foo1")
a.var1 = "foo2"

Why doesn't the compiler come up with an error ?

A:

As per the  Swift document.

if Struct instance is declared as a constant (with the let
  keyword), it is not possible to change its property, even
  though its property is a variable property.
This behavior is due to structures being value types. When an instance
  of a value type is marked as a constant, so are all of its properties.
The same is not true for classes, which are reference types. If you
  assign an instance of a reference type to a constant, you can still
  change that instance’s variable properties.

This actually states that when we have constant (let) class instance we can change its property's value as its a reference type.
And in case of constant (let) struct instance we cannot change its property's value as its value type.
Everything actually boils down to heap memory and stack memory.
Struct instances are stored in stack memory whereas Class instances are stored in heap memory which enables to change its property's value.

