//
//  UIViewController+Rotation.m
//  iPhly
//
//  Created by Ari Krupnik on 8/4/10.
//  Copyright 2010 lib.aero. All rights reserved.
//

#import "AutoRotatingUIViewController.h"
#import "util.h"

static int shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation interfaceOrientation) {
	if (device_has_audio_jack_on_bottom()) {
		return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
	} else {
		return (interfaceOrientation == UIInterfaceOrientationPortrait);
	}
}

@implementation AutoRotatingUIViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	return shouldAutorotateToInterfaceOrientation(interfaceOrientation);
}
@end

@implementation AutoRotatingUITableViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	return shouldAutorotateToInterfaceOrientation(interfaceOrientation);
}
@end
