I am coming from C++ and learning Swift now and I have some problems to understand the Swift const concept. This code is from a IOS development book and I have problems to understand why this is working.
let firstFrame = CGRect(x: 160, y: 240, width: 100, height: 150)
let firstView = UIView(frame: firstFrame)
firstView.backgroundColor = UIColor.blueColor()
view.addSubview(firstView)
As far as I can see it: firstView is a constant UIView object but even though the object is constant and completly initialised I can change the value of a member of UIView in the next line?
I am confused can anybody explain that to me, because in C++ that would be impossible or do I overlook something?
Regards Ruvi