Re: NSSplitView in a separate NSWindowControl doesn't show for some reason

2015-10-24 Thread Nick
An interesting discovery. I went through all properties one by one in
NSSplitView, comparing ones that are set automatically to NSSplitView in a
MainMenu.xib and the one that are set automatically in
MyViewController.xib. When I load NSSplitView as part of another xib, its
property "arrangesAllSubviews" gets set to NO, which makes the split view
not work properly. Setting it to YES explicitly in viewDidLoad (of
NSViewController's subclass) seems to resolve the problem. I don't know
why, though. This property appeared first in ElCap 10.11.

2015-10-24 21:51 GMT+03:00 Nick :

> Hi
> I am trying to create an NSSplitView-based application.
> For the sake of modularity, I would like to separate different parts of
> the app into several view controllers (each has its own xib).
>
> The problem is when I add a split view as a child view of
> NSViewController.view, then load my view controller, and set my main
> window's contentView to viewController.view.
>
> All controls show except for NSSplitView.
>
> I tried this multiple times, with different test projects and every time I
> get this problem.
>
> It can be easily replicated. Just create a new non-storyboard based cocoa
> project, create a new NSViewController subclass, drag an NSSplitView onto
> its view into its xib, and in your AppDelegate have the following
>
> @interface AppDelegate ()
>
>
> @property (weak) IBOutlet NSWindow *window;
>
> @property TestVC *vc;
>
> @end
>
>
>
> @implementation AppDelegate
>
>
> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
>
> self.vc = [[TestVC alloc] initWithNibName:@"TestVC" bundle:nil];
>
> self.window.contentView = self.vc.view;
>
> }
>
>
> Where TestVC - is the name of your NSViewController's subclass.
>
>
> What am I doing wrong?
>
>
> What is interesting - when I do not load the view from a separate xib, but
> have the view in MainMenu.xib (even if it is not a subview of the main
> window's content view), the split controller shows normally, as expected.
>
>
> I am using Xcode 7.0.1, OS X ElCapitan 10.11
>
>
> Thanks for help!
>
>
___

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

Updated View Bounds After Orientation Change...

2015-10-24 Thread Peters, Brandon
Devs,

I have a UIStackView, which holds an image view and a text view. The image view 
has an activity indicator view as a subview (I add this programmatically). When 
the view initially view loads, I center the activity indicator view within the 
image view and starting the animation for the AIV. But, in the process of 
waiting for the image to load, if I rotate the image view, the AIV needs to be 
re-centered. I added code to listen for the status bar orientation change 
notification, and have a method to invoke upon the notification 
(UIApplicationDidChangeStatusBarOrientationNotification). In that method, I 
attempt to get the bounds of the image view and use that to re-center the AIV 
within the image view. But, it seems that the value of the bounds of the image 
view is not changing when the device orientation changes. Is there a “reliable" 
way to get the updated bounds for a view after the device orientation has 
changed? Code ->

// start listening for orientation changes
NSNotificationCenter.defaultCenter().addObserver(self, selector: 
"orientationDidChange:",
name: UIApplicationDidChangeStatusBarOrientationNotification, 
object: nil)
…
  func orientationDidChange(notification: NSNotification) {

// get image view bounds
let viewBounds = _imageView.bounds

// recenter the activity indicator
_activityIndicator.center = CGPointMake(CGRectGetMidX(viewBounds), 
CGRectGetMidY(viewBounds))

}

___

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

NSSplitView in a separate NSWindowControl doesn't show for some reason

2015-10-24 Thread Nick
Hi
I am trying to create an NSSplitView-based application.
For the sake of modularity, I would like to separate different parts of the
app into several view controllers (each has its own xib).

The problem is when I add a split view as a child view of
NSViewController.view, then load my view controller, and set my main
window's contentView to viewController.view.

All controls show except for NSSplitView.

I tried this multiple times, with different test projects and every time I
get this problem.

It can be easily replicated. Just create a new non-storyboard based cocoa
project, create a new NSViewController subclass, drag an NSSplitView onto
its view into its xib, and in your AppDelegate have the following

@interface AppDelegate ()


@property (weak) IBOutlet NSWindow *window;

@property TestVC *vc;

@end



@implementation AppDelegate


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

self.vc = [[TestVC alloc] initWithNibName:@"TestVC" bundle:nil];

self.window.contentView = self.vc.view;

}


Where TestVC - is the name of your NSViewController's subclass.


What am I doing wrong?


What is interesting - when I do not load the view from a separate xib, but
have the view in MainMenu.xib (even if it is not a subview of the main
window's content view), the split controller shows normally, as expected.


I am using Xcode 7.0.1, OS X ElCapitan 10.11


Thanks for help!
___

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: Hide UINavigationBar and keep UIPageController content static

2015-10-24 Thread Kyle Sluder
On Tue, Oct 20, 2015, at 11:21 AM, Stevo Brock wrote:
> The trick is, if in the storyboard, on the UIPageController, I set the
> “Under Top Bars” to yes, my custom view draws full screen.  But when I
> toggle the navigationBarHidden, the custom view and its superview scroll
> up and down the size of the navigation bar.

This sounds like it might be a bug in automatic content inset
adjustment. Please file a Radar with a sample project.

In the meantime, you can try turning off
automaticallyAdjustsScrollViewInsets on your view controller and
managing layout manually (relative to the view controller's
topLayoutGuide) in an override of -viewDidLayoutSubviews.

> 
> 
> Alternatively, if in the storyboard, on the UIPageController, I set the
> “Under Top Bars” to no, my custom view draws in the screen space under
> the navigation bar.  When I toggle the navigationBarHidden, the view
> stretches to fill the full height of the screen, but I never get a redraw
> call, so the drawing is stretched.

This is expected. Views that need to redraw when they change size should
override -setBounds: to call [self setNeedsDisplay].

--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