Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9 Swift UIView has no member

I used swift auto layout.

This is the code

overlayView.setTranslatesAutoresizingMaskIntoConstraints(false)

This was worked perfectly in iOS 8. But in xcode 7 it is not working. It is giving the error

Value of type 'UIView' has no member setTranslatesAutoresizingMaskIntoConstraints
like image 328
Puvanarajan Avatar asked Sep 19 '15 11:09

Puvanarajan


Video Answer


1 Answers

It now seems to be:

view.translatesAutoresizingMaskIntoConstraints = false

I think they changed it to be more consistent with the general pattern for properties in Swift in Swift 2

like image 74
Rich Tolley Avatar answered Nov 15 '22 07:11

Rich Tolley