0

i have a viewcontroller 1 and a viewcontroller 2. I want to make a switch statement. If it's an iphone, then go to viewcontroller 1, and if it's an ipad, go to viewcontroller 2.

I know i have to do this code:

switch     UIDevice.currentDevice().userInterfaceIdiom {
case .Phone:
// It's an iPhone
case.Pad
// It's an iPad:
case .Unspecified:
// Uh, oh! What could it be?
}

But what's next? Sorry, i know that i'm a beginner, but hope you guys can help me. That would be great.

Cs.John
  • 31
  • 7
  • What do you want to do push the ViewControllers ??? Or modally prsent them ??? Whats your intention ??? – Sandeep Bhandari Jun 09 '16 at 07:42
  • 1
    As you say you are a beginner I strongly suggest you adopt autolayout so that your UI adapts to the device it is running on rather than having specific ViewControllers for the different device families. If you are using storyboards then you can nominate different storyboards for iPhone and iPad if your UI is totally different – Paulw11 Jun 09 '16 at 07:45
  • Okay, i did it with different storyboards, thanks guys. – Cs.John Jun 09 '16 at 09:46

0 Answers0