Auto Layout Guide Incorrect Sample Code

Originator:mp
Number:rdar://15250026 Date Originated:17.10.2013
Status:Closed Resolved:
Product:Documentation Product Version:
Classification: Reproducible:Always
 
Summary:
In Auto Layout by Example chapter of Auto Layout Guide there is a following sample code, describing animations handling in iOS:

[containerView layoutSubtreeIfNeeded]; // Ensures that all pending layout operations have been completed
[UIView animateWithDuration:1.0 animations:^{
     // Make all constraint changes here
     [containerView layoutSubtreeIfNeeded]; // Forces the layout of the subtree animation block and then captures all of the frame changes
}];

and OS X:

[containterView layoutIfNeeded];
NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
     [context setAllowsImplicitAnimation: YES];
     // Make all constraint changes here
     [containerView layoutIfNeeded];
}];

Howewer, methods order is wrong: layoutSubtreeIfNeeded is not available in iOS and should be used in OS X sample and layoutIfNeeded should be used in iOS sample instead of OS X.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Regression:
N/A

Notes:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/AutoLayoutbyExample/AutoLayoutbyExample.html

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!