UIKit: UIView.translatesAutoresizingMaskIntoConstraints should be a property

Originator:adrian.kashivskyy
Number:rdar://17968788 Date Originated:09-Aug-2014 01:11 PM
Status:Dupe/15540890/Closed Resolved:Yes
Product:iOS SDK Product Version:iOS 8 SDK Beta 5 (12A4345d)
Classification:Other Bug Reproducible:Always
 
Summary:
UIView's translatesAutoresizingMaskIntoConstraints should be a property, so it translated into Swift without any unexpected results.

In Objective-C, when a "-setSomething:" method is declated, we can use a dot syntax to trigger it, such as: "foo.something = bar". This is not the case in Swift.

UIView has two instance methods: "-translatesAutoresizingMaskIntoConstraints" and "-setTranslatesAutoresizingMaskIntoConstraints:", which, in the public interface, should be declared as a property, not two separate methods.

Steps to Reproduce:
1. Install and Open Xcode 6.0 Beta 5 (6A279r), which includes iOS 8 SDK Beta 5 (12A4345d)
2. Create a new iOS playground file.
3. Enter the following code:

    import UIKit
    UIView().translatesAutoresizingMaskIntoConstraints = true


Expected Results:
No syntax error, the UIView instance receives "setTranslatesAutoresizingMaskIntoConstraints:YES" message implicitly.

Actual Results:
Syntax-related playground execution error – "error: cannot assign to the result of this expression"

Version:
iOS 8 SDK Beta 5 (12A4345d)

Notes:


Configuration:
Xcode 6.0 Beta 5 (6A279r), OS X 10.9.4 (13E28), MacPro5,1

Attachments:


--- 28-Aug-2014 07:16 PM / ADR

Engineering has determined that your bug report is a duplicate of another issue and will be closed. 

15540890

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!