mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
74 lines
No EOL
2.4 KiB
Objective-C
74 lines
No EOL
2.4 KiB
Objective-C
//
|
|
// DetailViewController.m
|
|
// NewsBlur
|
|
//
|
|
// Created by Roy Yang on 6/9/12.
|
|
// Copyright (c) 2012 NewsBlur. All rights reserved.
|
|
//
|
|
|
|
#import "DetailViewController.h"
|
|
#import "NewsBlurAppDelegate.h"
|
|
|
|
@implementation DetailViewController
|
|
@synthesize masterPopoverController = _masterPopoverController;
|
|
|
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
|
{
|
|
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
|
if (self) {
|
|
// Custom initialization
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)viewDidLoad
|
|
{
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view from its nib.
|
|
}
|
|
|
|
- (void)viewDidUnload
|
|
{
|
|
[super viewDidUnload];
|
|
// Release any retained subviews of the main view.
|
|
// e.g. self.myOutlet = nil;
|
|
}
|
|
|
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
|
// NSArray *subviews = [[self.view subviews] copy];
|
|
// for (UIView *subview in subviews) {
|
|
// if (subview.tag == 12) {
|
|
// if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
|
|
// NSLog(@"portrait");
|
|
// subview.frame = CGRectMake(0,44,768,960);
|
|
// } else {
|
|
// NSLog(@"landscape");
|
|
// subview.frame = CGRectMake(0,44,704,704);
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
}
|
|
|
|
#pragma mark - Split view
|
|
|
|
- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
|
|
{
|
|
// barButtonItem.title = NSLocalizedString(@"Master", @"Master");
|
|
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
|
|
self.masterPopoverController = popoverController;
|
|
}
|
|
|
|
- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
|
|
{
|
|
// Called when the view is shown again in the split view, invalidating the button and popover controller.
|
|
// [self.navigationItem setLeftBarButtonItem:nil animated:YES];
|
|
self.masterPopoverController = nil;
|
|
}
|
|
|
|
@end |