Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CLFContainerViewController/CLFContainerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@


// This property determines the frame that will be used for child view controllers in a non-transitioning state. Unless
// overriden by your subclass it will return self.view.bounds
// overriden by your subclass it will return self.containerView.bounds
@property (readonly, nonatomic) CGRect childRestingFrame;

// This property determines the view into which child view controller's view should be inserted as subview.
// This could be convenient if container controller manages somewhat complex layout.
// Unless overriden by your subclass is self.view
@property (readonly, nonatomic) UIView *containerView;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark - Properties that should only be used by subclasses
Expand Down
10 changes: 7 additions & 3 deletions CLFContainerViewController/CLFContainerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,13 @@ - (void)dealloc

- (CGRect)childRestingFrame
{
return self.view.bounds;
return self.containerView.bounds;
}

- (UIView *)containerView
{
return self.view;
}

- (void (^)())rotationInterruptionCleanupBlock
{
Expand Down Expand Up @@ -379,7 +383,7 @@ - (void)registerTransitionFromViewController:(UIViewController *)fromViewControl
if (![self.childViewControllers containsObject:toViewController])
[self addChildViewController:toViewController];

if (![self.view.subviews containsObject:toViewController.view])
if (![self.containerView.subviews containsObject:toViewController.view])
[self addViewFromViewController:toViewController];
}

Expand Down Expand Up @@ -412,7 +416,7 @@ - (void)addViewFromViewController:(UIViewController *)viewController

view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

[self.view insertSubview:view atIndex:0];
[self.containerView insertSubview:view atIndex:0];
}


Expand Down