-1

I use a third party Code , this code has such a paragraph : view.superview.bounds = view.bounds

I don't know what it means ?

Could you help me please ?

user5465320
  • 719
  • 2
  • 7
  • 15

1 Answers1

0

view is your current view. view.superview is currentView's parent view.

The bounds rectangle, which describes the view’s location and size in its own coordinate system

so this means your current view's bounds is being assigned to it's parent view's bounds. After this assignment, both views size are the same.

Here is a very good illustration: https://stackoverflow.com/a/28923657/291240

Community
  • 1
  • 1
William Hu
  • 15,423
  • 11
  • 100
  • 121
  • 1
    Your second line is kind of misleading. You should be stating that the view's superview is being set to the same size and location as the view. – rmaddy Jan 08 '16 at 16:52
  • Your edit clarified the wrong part. You need to clarify that the superview's bounds is being set to the view's bounds. You claim that the two are the same (which they will be after the assignment) but you kind of imply that the assignment is being made in the opposite direction. – rmaddy Jan 08 '16 at 17:10