1

My objective is to verify that swift apps/code can run on iOS 7 simulators I am following this question Do Swift-based applications work on OS X 10.9/iOS 7 and lower? and specifically this answer -by @Anil https://stackoverflow.com/a/24038997

The following are the steps I followed

  1. Installed xcode6 beta
  2. Installed iOS 7.1 simulator from Xcode6->Preferences->Downloads
  3. Now, I created a new iOS Application Master Detail project and selected swift as language
  4. With default settings I was able to run the app
  5. Now I changed the simulator to iPhone 5- 7.1 by following this -https://stackoverflow.com/a/24038727 and changing the deployment target to 7.1.
  6. Now I can see my iOS 7.1 simulators When i try to run it I get build succeeded but the app crashes with swift dynamic cast excption

libswift_stdlib_core.dylib`swift_dynamicCast:

Community
  • 1
  • 1
satyajit
  • 1,470
  • 3
  • 22
  • 43
  • 3
    Try it on iPad. Your issue could be caused by the new `UISplitViewController` stuff. The documentation for that class says: `in previous versions of iOS, the class is available only on iPad.` – Andrew Jun 18 '14 at 16:53
  • @SantaClaus that worked! hmm, why don't you put it as an answer, I will accept it. – satyajit Jun 18 '14 at 17:23

1 Answers1

2

The Master-Detail Xcode project template creates a storyboard with a UISplitViewController as the root view controller.

Before iOS 8, UISplitViewController was iPad only. The documentation states:

In iOS 8 and later, you can use the UISplitViewController class on all iOS devices; in previous versions of iOS, the class is available only on iPad.

You might want to load a different storyboard for devices running an older version of iOS. I've been wondering how apple wants us to approach this with iOS 8. It might be a good idea to read up on what Apple calls Adaptive View Controllers, or watch a WWDC video on them. I believe "Building Adaptive Apps with UIKit" covers the new functionality of UISplitViewController

Community
  • 1
  • 1
Andrew
  • 15,357
  • 6
  • 66
  • 101