Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:30:49+00:00 2026-06-08T11:30:49+00:00

I have a custom UIView set as my UIViewController’s rootView. I start the application

  • 0

I have a custom UIView set as my UIViewController's rootView. I start the application in landscape mode and I was having some issues regarding the bounds of my rootView. After some debugging I just used Xcode’s console to check what was going on. The ITCustomView's class, is my UIViewController's rootView and it’s a UIView's subclass. So I did:

po self

And the result:

ITCustomView: 0x15af30; frame = (20 0; 748 1024); transform = [0, -1, 1, 0, 0, 0]; autoresize = W+H; layer = <CALayer: 0x15b070>>

And then I did:

po [self layer]

And the result:

CALayer:0x15b070; position = CGPoint (394 512); bounds = CGRect (0 0; 1024 748); delegate = <ITCustomView: 0x15af30; frame = (20 0; 748 1024); transform = [0, -1, 1, 0, 0, 0]; autoresize = W+H; layer = <CALayer: 0x15b070>>; sublayers = (<CALayer: 0x15a390>, <CALayer: 0x15b2c0>, <CALayer: 0xce2f6a0>); transform = CATransform3D (0 -1 0 0; 1 0 0 0; 0 0 1 0; 0 0 0 1); backgroundColor = <CGColor 0x15b040> [<CGColorSpace 0x1356e0> (kCGColorSpaceDeviceRGB)] ( 0.818317 0.818317 0.818317 1 )

So my questions really are:

  1. Being in landscape shouldn’t the frame be changed according to the orientation?

  2. Are these transformation (the orientation change) only “visible” on the layer?

  3. Should I start checking the bounds (to know when a UIView's subclass ends) using the self.layer.bounds instead of self.frame?

  4. Is is safer (aka: a best practise) to go always with the self.layer.bounds, because of possible transformations?

I find it odd (and also a bit ashamed of myself) to only have noticed this kind of behaviour now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:30:50+00:00Added an answer on June 8, 2026 at 11:30 am

    frame is only really relevant from the perspective of the superview, since it is expressed in the superview’s coordinate system.

    For any internal purposes, the view’s bounds rect should be used.

    So, for your sub-questions:

    1. No, check the bounds instead.
    2. No, check the bounds instead.
    3. No, check the bounds instead.
    4. No, check the bounds instead.

    You don’t need to check the layer’s bounds, you can use the view’s bounds. So, your question should really be titled self.frame vs self.bounds, and bounds usually wins.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom UIView that has some set of UILabels in it.
I have created a custom UIView (without .xib) for a finger paint application. Paint
I have a custom UIViewController, which is the only subView of UIView. The UIViewController
I have a custom UIViewController subclass controlling a UISCrollView containing an UIImageView, set up
I have a custom UIView that generates a set of subviews and display them
I have a custom UIView that contains an interactive drawing that is drawn in
I have one ViewController, in this i have added one Custom UIView named as
I have a UIScrollView that contains a custom UIView. In my UIView I am
I have a custom view (inherited from UIView ) in my app. The custom
I have a complex UIView with lots of custom subviews, and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.