Re: My Phone does not work upside down
Re: My Phone does not work upside down
- Subject: Re: My Phone does not work upside down
- From: Roland King <email@hidden>
- Date: Tue, 14 Apr 2015 23:44:38 +0800
> On 14 Apr 2015, at 23:28, Gerriet M. Denkmann <email@hidden> wrote:
>
>
>
> I obviously have some problems understanding the documentation.
Indeed.
> My app is just the what Xcode gives me for iOS Master-Detail.
> There are MasterViewController (UITableViewController) and DetailViewController : UIViewController
Exactly - and if you look at the generated storyboard or NIB or XIB you’ll see that the root view controller is
1) in the case of the iPhone master-detail app a Navigation controller
2) in the case of the iPad master-detail app, a SplitView controller.
Neither of those are the MasterViewController nor the DetailViewController so implementing the method in those doesn’t do a thing for you.
However, and again as I pointed out in the third line of my original reply (with reference to NavigationViewController at that time as you were taking about an iPhone app), look at the delegate methods. Both UINavigationController and UISplitViewController have delegates which have methods which allow you to specify the supportedInterfaceOrientations *without* subclassing them. Those methods are there for exactly that.
>
> I just created a SplitViewController : UISplitViewController, which implements just one method: supportedInterfaceOrientations and now everything works as intended.
>
> So: what is the point of the checkboxes and Info.plist?
it’s meant to be a global statement of intent. So if you have a universal app where you have custom UIViewControllers and they support all orientations you don’t have to put, in every one,
if( isIphone )
return one_load_of_stuff;
else
return another_load_of_stuff;
You return the modes that your viewcontroller supports and the global plist lets you then remove the upside down one when you’re on a phone.
The one thing I’ve never understood is why ‘upside down portrait’ is discouraged on the phone. My large iPhone is hardly smaller than my small iPad, it works just fine upside down really, I never knew where the HID guideline came from that thou-shalt-not-hold-thy-iphone-upside-down. So I always check the box and override the method and allow myself an illicit mode.
>
> Anyway. Thanks to your help I have it now working. Thanks a lot!
>
> Kind regards,
>
> Gerriet.
>
>
>>
>>>>
>>>
>>>> +1.
>>>>
>>>> In addition to what Roland said, it’s also staring you right in the face in the General tab of the target settings as a set of friendly checkboxes.
>>>
>>> When I click on Target → General I see under “Deployment Info - Device Orientation” 4 checkboxes, which look friendly enough. Only the first two (Portrait and Upside Down) are selected.
>>>
>>> But iPad works in all 4 orientations. Seams that the Info.plist overrides the friendly checkboxes.
>>> And iPhone works only in Portrait - NOT upside down.
>>
>> No, the Info.plist *is* the friendly checkboxes, they are one and the same. The boxes you select there are what ends up in the Info.plist file. It has separate sets of boxes for iPhone and iPad, which one are you looking at, the iPhone one only I suspect.
>>
>> And, again per the documentation you’ve been reading
>>
>> "The default values for a view controller's supported interface orientations is set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom."
>>
>>
>>
>>>
>>> Kind regards,
>>>
>>> Gerriet.
>>>
>>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden