-3

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

Dani
  • 187
  • 2
  • 7

1 Answers1

2

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+.

Community
  • 1
  • 1
David Seek
  • 16,783
  • 19
  • 105
  • 136
  • The problem is that my boss wants it working for iPhone 4 which will never use iOS 9. – Dani Mar 15 '16 at 10:26
  • I can see that and I really get your problem. But you have the current limitation. So you can decide. Either Stack View or iOS7. If you need to have iOS7 Support, you have to delete the Stack View. – David Seek Mar 15 '16 at 10:28
  • I've already tried OAStackView on storyboard but didn't work for me when I run it... Don't solve the initial problem though, because i still don't want to remove views of storyboard that already work on iOS 9 – Dani Mar 15 '16 at 10:45
  • I see that you don't want that, but you don't have a CHOICE! If you want to run your app on iOS7 you HAVE TO remove the stack view... – David Seek Mar 15 '16 at 10:46