UIKit - Disable Slide Over and Split View programmatically - ios

I'm trying to port iOS Unity Game for the new Apple Silicon Mac. For supporting window resizing and fullscreen, I just set UIRequiresFullScreen to false, it works well on the Apple DTK.
But the slide-over and split automatically enabled with the plist property modified. The ARM Mac version runs on the iPad scheme, but we don't want the split and slide over feature enabled for iPad device. Can I disable the Split view feature programmatically when the device is determined not running on Mac?
It would be appreciated if anyone can give some ideas...
if (![NSProcessInfo processInfo].isiOSAppOnMac){
// code to disable split view and slide over
}

Programmatically, it is not possible for iPad. This is just plist value that can't be changed at runtime. You use case is valid You can raise a bug with apple, they might lok into it. they may introduce different plist for mac, or some other way around it. Right now at runtime this is not possible.

Related

Different versions of app for different devices - iPhone to iPad

I'd like to take my existing iPhone app and modify its layout/number of screens for an iPad.
I began by duplicating the Target with "Duplicate and Transition to iPad".
But I'm unsure where to go after that. I'll need a new Storyboard and some of the functions/viewControllers/views will need to be modified. Where/how do I do that?
All I can find are very old solutions that are no longer valid or leave too much out:
How to convert iPhone app to iPad app
This is the best one I've found, but again not current and still leaves a lot out:
http://innovationm.co/convert-iphone-application-to-universal-application/
I no longer see a "Universal" option. I am guessing that selecting all of these accomplish the same thing?
First, edit your target to make sure it is set for both iPhone and iPad:
Second, using two different storyboards is unusual nowadays, but you can easily do it. In your Info.plist configure two entries (using Raw Keys and Values): UIMainStoryboardFile and UIMainStoryboardFile~ipad. The result is that your app will load one storyboard for an iPhone and a different storyboard for an iPad.
Note that with a newer created project that uses window scenes under iOS 13 and later, you would configure UIApplicationSceneManifest and UIApplicationSceneManifest~ipad to specify different UISceneStoryboardFile values.
Here's a downloadable project that demonstrates the newer structure:
https://github.com/mattneub/Programming-iOS-Book-Examples/tree/master/bk1ch09p358universal

How disable splitView for app for iPad? [duplicate]

I have a large app that I will need some time to optimize for iOS9.
Edit: What I am worried about is all the UI getting squeezed together when the app window size is reduced. So my question is, is there any way to force full screen for the app?
To opt-out (disable) multi-tasking for your application:
Select your Target → General Section → Scroll Down and
check Requires full screen
It gets applied to the plist's UIRequiresFullScreen key value.
Note: Apps are required to support all screen orientations if it supports multitasking. Otherwise, apps will get the following error on publishing:
Invalid Bundle. iPad Multitasking support requires these orientations: ...
You have to modify your project to support multitasking. According to WWDC 2015 video, to adopt your app for multitasking, satisfy these requirements:
Build your app with iOS 9 SDK
Support all orientations
Use Launch Storyboards
So, if any of this is not done yet, your app will not be able to support multitasking.
Of course, if you don't use size classes, put it at the top of the list.
Edit: according to you question edit. There is a UIRequiresFullScreen key in Info.plist. See more at Apple docs
To opt out of Slide Over and Split View, do so explicitly by adding the UIRequiresFullScreen key to your Xcode project’s Info.plist file and apply the Boolean value YES.
You can set above thing using General tab of Targets, Select Requires Full Screen check. Refer below image for the same
Note :
A user can disable Slide Over and Split View in Settings > General >
Multitasking. If you think you’ve set up everything correctly and find
that these features still don’t work, check this setting.
See Adopting Multitasking Enhancements on iPad - Slide Over and Split View Quick Start.
It's still possible to opt-out of iPad multitasking — but Apple announced at WWDC 2019 that in April 2020, all iPad apps will be required to support multitasking.
The original announcement and discussion is in the first few minutes of "Modernizing Your App for iOS 13", and there's a (brief) announcement on their developer-news site as well.

How to implement Split Screen Multitasking on iPad using Third party apps?

I tried to implement the Multitasking feature Apple provided using AIR application, but I seem to miss something.
I did the following as apple recommended:
Compiled the app with iOS9 SDK.
All orientation implemented.
Storyboard added.
Still I do not see the vertical bar that divides the two app's for multitasking.
Let me know if you implemented this successfully in any third party apps?
All 3 listed steps are correct. Please also make sure Requires Full Screen is set to NO. It works perfectly for me.
Please let me know if you (or anyone else) still have trouble with Split View support.
What iPad are you using to test your app? Not all iPads support this behavior. This table shows which iPads support Slide Over, Picture in Picture and Split View:
Documentation from Apple for more information.
By the way how did you manage to use launch screen storyboard with Adobe AIR application?
Split screen wasn't working for me because even though I had a Storyboard, I wasn't using it. Make sure your Launch Screen File is set, and your Launch Images Source is blank.
Check off Portrait, Upside Down, Landscape Left, and Landscape Right under Deployment Info. Also make sure that Requires full screen is not checked off.
Finally you should double check that your Info.plist is correct. UIRequiresFullScreen should be NO. Supported interface orientations and Supported interface orientations (iPad) should have all 4 orientations.

iOS XCode Storyboard controls moved and now look strange in simulator

I am following the course on iOS through iTunes university and working on the calculator project. I moved the controls on the storyboard to make room for another control at the top. Everything looks fine on the storyboard but when run in the simulator, controls are bunch up, on top of each other, and some are clearly off the top of the simulator screen. This leads to the following very related questions.
How does one move controls around on the storyboard? I went to the size inspector of each control (buttons in my case) and changed the 'Y' value (increased it by 10). I did this for each control. I didn't think about it as I was doing it because as I said, all looks fine on the storyboard. Is there a better way to move controls around? I could not figure out how to grab more than one control at a time and move them. Grabbing all and moving or all but one and moving would have been ideal.
I anticipate someone is going to say, "We need more info. " How do I show the storyboard? Is there a xml file somewhere? How is the storyboard saved? How should I show the results of the simulator?
In general, what the heck is going on? Why would things look so different in the simulator?
Is there a better forum/group to ask newbie questions about iOS programming?
My specs are these:
XCode 4.5.2
Ios simulator versions set to 6.0 and iPhone
Any other info needed? Thanks in advance,
Dave
Try setting your simulated device size to 'freeform' instead of 'inferred'. This screen is a bit smaller so the controls are no longer overlapping. The latest xcode sets it by default to ios6 (screen size of iPhone 5)
edit For a better insight in xcode IDE, please refer to the documentation provided by apple (includes screenshots for clarity)
https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/000-About_Xcode/about.html#//apple_ref/doc/uid/TP40010215

Displaying different Launch Images based on IOS Version

I have a situation causing me to have a need to support two different launch images for Portrait orientation on iPads as the views will be different depending on the IOS version.
I'm developing iPad/iPhone app that supports a UISplitViewController as the root window when the device is an iPad. In IOS 5.0, supports the master view controller being displayed in split view while in portrait mode by responding "NO" in the shouldHideViewController UISplitViewControllerDelegate method. In IOS 4.2, this method is not called and thus the Master View Controller is not displayed in Portrait orientation. Instead, it is a popover presented when a Nav button is pressed.
Is there a way to create a single version of the application (from an iTunes customer perspective) that includes the appropriate launch image based on IOS version?
The iPhone App Programming Guide within the Advanced Tips and Tricks section describes how different launch images can be specified based on platform and device, but no IOS version as so: key_root-platform~device
Another post's answer indicated that I may be able to solve a similar problem by creating multiple targets to support multiple versions. Is it possible to create multiple targets and upload them to Apple as a single application and have them distribute the appropriate binaries based on version? Any tips on how would be greatly appreciated.
No, there is no way to do what you are asking for. Your best bet is to come up with some launch image that's not trying to be a faithful reproduction of what your home screen is.
Could you not just show the split view with the popover/sidebar closed in landscape view? That way it will look much the same for iOS4 and iO5.
I think you can accomplish this by creating a custom splash screen. Then you can perform a runtime check and load the appropriate image based on the iOS version. I have seen custom splash screens before (eg animated splash screens).
I think you would overide startupImageWithOrientation:, see this post more for info.
As for your question about having multiple targets be one app, the answer is no.

Resources