简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM