Re: Presenting modal vc repositions root vc

2014-01-27 Thread Rick Mann
Well, by chance I found the cause of the problem, although I don't understand 
why. In my root view controller, I had this code, based on a StackOverflow 
answer I found about positioning a custom UIToolbar such that it would not be 
obscured by the status bar:

- (void)
viewWillLayoutSubviews
{
self.view.frame = [UIScreen mainScreen].applicationFrame;
[super viewWillLayoutSubviews];
}

I did this many months ago, probably before this technote: 
https://developer.apple.com/library/ios/qa/qa1797/_index.html

Anyway, removing that fixed all the weird behaviors. I don't know how or why. 
It seems that presenting a modal, full-screen VC from the root VC shortly after 
viewDidAppear causes a couple of things:

- The current root view controller is removed from the window, and the 
presented VC is made the root.
- The application frame changes size.

Removing that code, and installing the top layout guide constraint on the 
UIToolbar seems to have fixed the resize issue, but not another issue I have 
where removing a sub view of the root view controller causes the 
UIBarButtonItems' text to shrink. This one still eludes me.

On Jan 25, 2014, at 16:37 , Rick Mann rm...@latencyzero.com wrote:

 I can't figure this out. I've got a view hierarchy that's been working fine. 
 I added a modal, full-screen tutorial to my storyboard that's triggered on a 
 segue from a button in a popover-contained table view. That works fine, too.
 
 Now I'm trying to display the same tutorial the first time the user runs the 
 app. I get it from the root view controller's storyboard, and call -[self 
 presentViewController:animated:completion:] on it. Just before presenting it, 
 I see my entire view hierarchy shrink down (to what might be portrait width 
 in landscape mode; it's a landscape-only app). Elements inside a smaller, 
 too, not just repositioned.
 
 After the modal VC is dismissed, you see the shrunken view, then it snaps 
 back to full size, but the UIBarButtonItems stay shrunken.
 
 Why is this happening? Why does Apple not test anything any more?
 
 -- 
 Rick
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
 
 This email sent to rm...@latencyzero.com


-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-27 Thread David Duncan

On Jan 27, 2014, at 2:44 PM, Rick Mann rm...@latencyzero.com wrote:

 Well, by chance I found the cause of the problem, although I don't understand 
 why. In my root view controller, I had this code, based on a StackOverflow 
 answer I found about positioning a custom UIToolbar such that it would not be 
 obscured by the status bar:
 
 - (void)
 viewWillLayoutSubviews
 {
self.view.frame = [UIScreen mainScreen].applicationFrame;
[super viewWillLayoutSubviews];
 }


Basically a view or view controller should never modify their external 
coordinate system, and this does that. There are a great many places where a 
parent view controller or window assume they have full control over the views 
of their children, and doing stuff like this breaks that control pretty 
handidly.
--
David Duncan

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-27 Thread Rick Mann

On Jan 27, 2014, at 14:57 , David Duncan david.dun...@apple.com wrote:

 Basically a view or view controller should never modify their external 
 coordinate system, and this does that. There are a great many places where a 
 parent view controller or window assume they have full control over the views 
 of their children, and doing stuff like this breaks that control pretty 
 handidly.
 

Indeed. Well, it had the desired effect for many, many months, so it got 
forgotten.

The new status bar behavior induced a lot of stuff like this. The official 
solution, AFAICT, won't work for non-storyboard projects, either (since they 
don't have top  bottom layout guides).

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-27 Thread Kyle Sluder
On Mon, Jan 27, 2014, at 03:01 PM, Rick Mann wrote:
 
 On Jan 27, 2014, at 14:57 , David Duncan david.dun...@apple.com wrote:
 
  Basically a view or view controller should never modify their external 
  coordinate system, and this does that. There are a great many places where 
  a parent view controller or window assume they have full control over the 
  views of their children, and doing stuff like this breaks that control 
  pretty handidly.
  
 
 Indeed. Well, it had the desired effect for many, many months, so it got
 forgotten.
 
 The new status bar behavior induced a lot of stuff like this. The
 official solution, AFAICT, won't work for non-storyboard projects, either
 (since they don't have top  bottom layout guides).

Layout guides work just fine regardless of use of storyboards. But
because layout guides are owned by the _view controller_, not the view,
there is nowhere for IB to offer them in non-storyboard views.

You can still use them in an override of -updateViewConstraints just
fine.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-27 Thread Rick Mann

On Jan 27, 2014, at 15:31 , Kyle Sluder k...@ksluder.com wrote:

 Layout guides work just fine regardless of use of storyboards. But
 because layout guides are owned by the _view controller_, not the view,
 there is nowhere for IB to offer them in non-storyboard views.

Well, since a NIB can be owned by a view controller, it seems to me that IB 
could provide layout guide widgets when that's the case.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-27 Thread Kyle Sluder
On Mon, Jan 27, 2014, at 03:39 PM, Rick Mann wrote:
 
 On Jan 27, 2014, at 15:31 , Kyle Sluder k...@ksluder.com wrote:
 
  Layout guides work just fine regardless of use of storyboards. But
  because layout guides are owned by the _view controller_, not the view,
  there is nowhere for IB to offer them in non-storyboard views.
 
 Well, since a NIB can be owned by a view controller, it seems to me that
 IB could provide layout guide widgets when that's the case.

Storyboard object graphs are much more restricted than NIB object
graphs. The relationship between view controllers and their views is
much more concrete within a storyboard. NIBs are much more flexible—you
can specify the _class_ of File's Owner, but that object does not exist
in the NIB at design time. Therefore the constraint object can't be
encoded into the nib. Labeling File's Owner as a UIViewController also
implies absolutely nothing about the relationship between the view
controller and the view—the view controller might manually load the NIB
with itself as File's Owner for purposes other than assigning its own
view.

These difficulties are theoretically surmountable and you should file an
enhancement request asking Apple to do so. But as it stands, the only
way to use the layout guides for views loaded from NIBs is in code.

--Kyle Sluder

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Presenting modal vc repositions root vc

2014-01-25 Thread Rick Mann
I can't figure this out. I've got a view hierarchy that's been working fine. I 
added a modal, full-screen tutorial to my storyboard that's triggered on a 
segue from a button in a popover-contained table view. That works fine, too.

Now I'm trying to display the same tutorial the first time the user runs the 
app. I get it from the root view controller's storyboard, and call -[self 
presentViewController:animated:completion:] on it. Just before presenting it, I 
see my entire view hierarchy shrink down (to what might be portrait width in 
landscape mode; it's a landscape-only app). Elements inside a smaller, too, not 
just repositioned.

After the modal VC is dismissed, you see the shrunken view, then it snaps back 
to full size, but the UIBarButtonItems stay shrunken.

Why is this happening? Why does Apple not test anything any more?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Presenting modal vc repositions root vc

2014-01-25 Thread Kyle Sluder
On Jan 25, 2014, at 4:37 PM, Rick Mann rm...@latencyzero.com wrote:
 
 Why is this happening? Why does Apple not test anything any more?

You have provided no code and no evidence that you are complying with all view 
and view controller containment requirements. Please stop accusing other 
parties of negligence before you perform your own due diligence.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com