Remove storyboard view controller iOS at build time - ios

The fact is that I have a View Controller in my storyboard that is using StackViews. Now, I'm trying to make the application iOS 7 compatible but I don't want to remove that view controller. Is there a way to compile the project without that view controller? I tried to keep the build target of the storyboard to 9 but i would prefer if there is a way to hide that view controller at build time working with iOS 7 on the storyboard

Stack View came with iOS9 and you can't tell the Stack View to disappear depending on the running iOS. It's not possible to build the Storyboard depending on the iOS either. But it seems to be possible to select different storyboards depending on the used iOS. See this link. The cody is ojective-c, but it seems not that hard to transfer the logic.
You can either remove the Stack View or, what I'd suggest, build your App for iOS9, since some survey I've recently read, tells that up to 90% of all Apple Users upgrade to the newest iOS within a week. Your 3rd possibility is to build different storyboards depending on the iOS.
Edit: You may want to check out the OAStackView. Which implements most of the features from UIStackView and supports iOS 7+.

Related

Xcode Project Settings Preventing TabBar at Bottom of iPhone X Models?

I have an old project that I've been working on and off on for about 4 years now - the project has gone through many upgrades of XCode versions from 6 to 10 (I'm now using XCode 10.2.1 with 12.2 SDK). The main problem I'm having with it is that it utilizes a Tab View Controller to switch tabs, and no matter what I do, I cannot get the tab bar to appear on the bottom of an iPhone X family device correctly: it appears much higher than it should.
To try and finally narrow down the problem, I've essentially temporarily "replaced" all code and storyboard items from the project to see if anything will move the tab bar to where it's supposed to (if I just create a blank new project with a tab bar controller, the tab bar does appear where it should). I created a test storyboard with just a Tab Bar Controller going to one navigation controller (no constraints have been put in). There is no viewController codes attached to them. I've replaced the app delegate with a "blank" app delegate so there are essentially no extraneous code or restraints there at all. And I still get the tab bar moved:
This happens on the simulator and the device, and there is no code or storyboard setting that's doing this (this same setup on a new project puts the tab bar in the right place).
I've looked around in the Build Settings and other properties that I may have missed to see if I constrained something years ago that may affect this, and didn't see anything.
Is there anything I should be looking for in the project settings that would do this?
I don't want to rebuild the project in a new project - there are many linked libraries, certificates, cocoapods, storyboard items, and I know it would be horrible to try and put it all back in one piece.
My Deployment Target is set to iOS 11, Devices: iPhone, Base SDK: iOS
Any help would be greatly appreciated!
This is usually caused by not having a correct launch image for the iPhone X. The easiest way to fix this is to tell the app target not to use launch images (from the app bundle or from the asset catalog) but to use the LaunchScreen.storyboard instead. (If you don't have one, make one; be sure to set it as a launch screen storyboard by clicking Use As Launch Screen and configure your target to point to it. Examine a plain vanilla new project to see what I mean.) You might not want to keep things that way in the long term but at least it will allow your app to launch to the correct size on all devices.

Xcode8 Controllers are Grey which are designed in Xcode 7 with size classes

I am making my iOS Application Compatible with iPad.I have designed the UI of my Application with Xcode 7 with size classes which is more specifically designed for iPhone, Now i have to upgrade it to support iPad also.
Now with Xcode 8 when i select iPad from Storyboard with Device Pan then most of the controller are Greyed i.e. those controllers are not showing on iPad on the device also and on the Storyboard also. Please check the screenshot for that
I know the reason why they greyed out, because they are designed with size classes for a different size.
Now my question is, is it possible somehow to use this controller for iPad without Redesigning the UI and updating the Auto layouts, as of now i am not seeing any way to make this controllers available for iPad.
Also i have tried with a way but i think that will be very long, I have to delete this controllers and then add it back and set the layouts again.
Also another way would be design separate storyboard.
So please suggest me what will be a better solution to overcome from this.
Thanks
Even after compatibility conversion to Xcode 8, if still it doesn't seem to work, then you need to check if there are any leftovers like below:
If you want to make sure it works with any width and height, find the constraint:
and remove it by clicking on the x, leaving only installed checked:
That should solve it for Xcode 8.

how to transition an older project whose UI is written by code to support Slide Over and Split View of iOS 9?

hi,I want to transition an an older project to support Slide Over and Split View of iOS 9,but I find all the demo projects I found was written by storyboard or xib, but my older project's UI is written by code, can any one suggest, thanks!
Just FYI.
I was not able to adopt Split View until disabled this setting in Project settings->Deployment Info->(Switch iPad)->Status Bar Style->Requires full screen.
I would suggest switching to storyboards to make your life easy.
I would highly recommend you watch the following WWDC videos and then think about what exactly you need to do in order to support multi tasking.
Mysteries of Auto Layout, Part 1
What's New in Storyboards
Implementing UI Designs in Interface Builder
Getting Started with Multitasking on iPad in iOS 9
Optimizing Your App for Multitasking on iPad in iOS
Just add LaunchScreen storyboard and set it as LaunchScreen from the General settings of your project. You can keep everything else as the code.

MonoTouch UISplitViewController - Device and Simulator different

Are there any known issues with UISplitViewController in MonoTouch? I am using MonoDevelop 2.8.8.4, MonoTouch 5.2.10 and xCode 4.3.2 (4E2002)
I have a UISplitViewController. When I go to portrait I display a button which the user can click to view the 'master' view in a popup controller. On the simulator it works exactly as expected - the master is displayed in a popupviewcontroller.
However, on the device (running iOS5.1), the master view will get pushed in from the side (like it would on a UINavigationController.PushController()
and this from iOS 5.1 Release Notes:
In 5.1 the UISplitViewController class adopts the sliding presentation
style when presenting the left view (previously only seen in Mail).
This style is used when presentation is initiated either by the
existing bar button item provided by the delegate methods or by a
swipe gesture within the right view. No additional API adoption is
required to obtain this behavior, and all existing API, including that
of the UIPopoverController instance provided by the delegate, will
continue to work as before. If the gesture cannot be supported in your
app, set the presentsWithGesture property of your split view
controller to NO to disable the gesture. However, disabling the
gesture is discouraged because its use preserves a consistent user
experience across all applications.
Are there any known issues with UISplitViewController in Monotouch?
Nothing specific to MonoTouch and UISplitViewController - but like you found out the later has changed quite a bit internally for iOS 5.1 and this can show up in applications.
I am using MonoDevelop 2.8.8.4, Monotouch 5.2.10 and xCode 4.3.2 (4E2002)
What's even more important is which version of the iOS simulator are you using ? i.e. iOS 5.0 or iOS 5.1 ?
In any case be aware that different version of iOS calls their selectors at different times. This can lead to cases where the same code will behave differently on different iOS versions.
One known case for this is about UISplitViewController. You can read about it (why and how it can occurs) and how to fix this properly to work identically across both versions of iOS.
Disclaimer: link to my own blog
Yes this is the "new Feature".
There is no Popover(UISplitViewController MasterView) anymore.
I tried to change but nothing works. I asked the Monotouch Support for help. But the also dont know anything.
Here is a Link to my Question maybe this can answer your question better;)
UISplitViewController problems with IOS 5.1

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