Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of -subviews in UIView #96

Open
ghost opened this issue Mar 19, 2013 · 0 comments
Open

Implementation of -subviews in UIView #96

ghost opened this issue Mar 19, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2013

I did some testing, and the real iOS (at least in the emulator) doesn't re-order the subviews to match sublayer order.

NSLog(@"View %@ \n", [[self.window subviews] objectAtIndex:0]);
NSLog(@"Layer %@ \n", [[windowLayer sublayers] objectAtIndex:0]);
[self.window exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
NSLog(@"View after view swap %@ \n", [[self.window subviews] objectAtIndex:0]); //Swapped
NSLog(@"Layer after view swap %@ \n", [[windowLayer sublayers] objectAtIndex:0]); //Swapped
[magentaLayer removeFromSuperlayer];
[yellowLayer removeFromSuperlayer];
[windowLayer insertSublayer:yellowLayer atIndex:1];
[windowLayer insertSublayer:magentaLayer atIndex:0];
NSLog(@"View after layer swap %@ \n", [[self.window subviews] objectAtIndex:0]); //Still the same
NSLog(@"Layer after layer swap %@ \n", [[windowLayer sublayers] objectAtIndex:0]); //Swapped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants